Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OSM-based synthetic geolocation field for micro-regions #52

Merged
merged 1 commit into from
Dec 17, 2022

Conversation

amotl
Copy link
Member

@amotl amotl commented Dec 17, 2022

Dear @ohobby,

at Luftdatenpumpe: Aiming to focus on sensor id instead of station id, you asked about a different formatting of the popup label when displaying measurement values on the Panodata Map Panel.

This patch adds a corresponding improvement.

Field:   district_postcode_city_sensorid
Format:  District, Postcode, City (#SensorID)
Example: Regierungsbezirk Darmstadt, 60385, Frankfurt (#76777)

The new field can then be used on the step when exporting station metadata from PostGIS to JSON for the map panel:

luftdatenpumpe stations \
  --network=ldi \
  --source=postgresql://luftdatenpumpe@localhost/weatherbase \
  --target=json.flex+stream://sys.stdout \
  --target-fieldmap='key=station_id|str,name=district_postcode_city_sensorid'

You can update the installation within your virtualenv to the version within this branch on GitHub by running:

pip install --upgrade git+https://github.com/earthobservations/luftdatenpumpe@popup-label-dpcs

With kind regards,
Andreas.

Field:   district_postcode_city_sensorid
Format:  District, Postcode, City (#SensorID)
Example: Regierungsbezirk Darmstadt, 60385, Frankfurt (#76777)
@codecov
Copy link

codecov bot commented Dec 17, 2022

Codecov Report

Base: 55.89% // Head: 55.89% // No change to project coverage 👍

Coverage data is based on head (a3540c7) compared to base (4fae26d).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #52   +/-   ##
=======================================
  Coverage   55.89%   55.89%           
=======================================
  Files           3        3           
  Lines         297      297           
=======================================
  Hits          166      166           
  Misses        131      131           
Flag Coverage Δ
unittests 55.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@amotl
Copy link
Member Author

amotl commented Dec 17, 2022

Oh, and you will also have to update the ldi_network database view.

luftdatenpumpe database \
  --network=ldi \
  --target=postgresql://luftdatenpumpe@localhost/weatherbase \
  --create-views --grant-user=grafana

@amotl amotl merged commit 9389977 into main Dec 17, 2022
@amotl amotl deleted the popup-label-dpcs branch December 17, 2022 16:56
@ohobby
Copy link

ohobby commented Dec 17, 2022

Hi @amotl ,

i was wrong with the "District" at OSM it is the Tag "suburb".

i have change it to:
concat(concat_ws(', ', osm_suburb, osm_postcode, osm_city), ' ', sensor_id_suffix) AS suburb_postcode_city_sensorid

And it looks good, but how is it possible to remove the comma between postcode and city?
Would it be possible to write the PM10 and PM2.5 values in the next line?
image

Thanks,
Oliver

@amotl
Copy link
Member Author

amotl commented Dec 17, 2022

Hi again,

thanks. Let's continue the discussion about this topic and its refinement at https://community.panodata.org/t/luftdatenpumpe-aiming-to-focus-on-sensor-id-instead-of-station-id/254/11.

With kind regards,
Andreas.

@ohobby
Copy link

ohobby commented Dec 17, 2022

However, there is the problem that the sensor ID of the PM or the temperature/humidity sensor is sometimes displayed. The ID of the PM sensor should always be used.

@amotl
Copy link
Member Author

amotl commented Dec 17, 2022

Thank you. I have diverted your report to GH-57.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants