earthobservations / luftdatenpumpe

Acquire and process live and historical air quality data without efforts. Filter by station-id, sensor-id and sensor-type, apply reverse geocoding, store into time-series and RDBMS databases, publish to MQTT, output as JSON, or visualize in Grafana. Data sources: Sensor.Community (luftdaten.info), IRCELINE, and OpenAQ.
https://luftdatenpumpe.readthedocs.io/
GNU Affero General Public License v3.0
34 stars 3 forks source link

Invalid JSON file for stations from LDI #17

Closed amotl closed 4 years ago

amotl commented 4 years ago

Users already reported that luftdatenpumpe would yield an invalid JSON file for the stations of luftdaten.info, see also https://source.irceline.be/corona-eu/luftdatenpumpe/issues/11.

Now, we have been able to confirm this on our reference dashboard, see https://weather.hiveeyes.org/grafana/d/AOerEQQmk/luftdaten-info-karte.

On the particular dashboard, it looks like:

image

At the particular location within the JSON file, it looks like that:

  {
    "key": "293",
    "name": "Mecklenburger Stra\u00dfe, Lenensruhe, Wismar, Nordwestmecklenburg, Mecklenburg-Vorpommern, DE"
  }
][
  {
    "key": "293",
    "name": "Mecklenburger Stra\u00dfe, Lenensruhe, Wismar, Nordwestmecklenburg, Mecklenburg-Vorpommern, DE"
  },
  {
    "key": "294",
    "name": "Reutlinger Stra\u00dfe, Neckarsulm, Baden-W\u00fcrttemberg, DE"
  },
amotl commented 4 years ago

We just found out that invoking Luftdatenpumpe like

luftdatenpumpe stations --network=ldi --source=${rdbms_uri} --target=json.grafana.kn+stream://sys.stdout

on our workstation did not yield duplicate stations within the invalid JSON output as outlined above.

amotl commented 4 years ago

The reason for this issue was that batch processing / flushing was also performed on JSON output. Oh my - don't do that.

amotl commented 4 years ago

Fixed by b7614986 within 0.19.1.