Skip to content

Commit

Permalink
InfluxDB adapter: Interpret "latitude/longitude" fields as tags
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jan 15, 2020
1 parent b710cd8 commit ef8c6ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Expand Up @@ -5,7 +5,14 @@ Changelog

in progress
===========


.. _kotori-0.24.0:

2020-01-15 0.24.0
=================
- Adjust packaging for Debian stretch vs. buster
- InfluxDB adapter: Interpret "latitude/longitude" fields as tags


.. _kotori-0.23.0:
Expand Down
6 changes: 6 additions & 0 deletions kotori/daq/storage/influx.py
Expand Up @@ -184,6 +184,12 @@ def format_chunk(self, meta, data):
chunk["tags"]["geohash"] = data["geohash"]
del data['geohash']

if "latitude" in data and "longitude" in data:
chunk["tags"]["latitude"] = data["latitude"]
chunk["tags"]["longitude"] = data["longitude"]
del data['latitude']
del data['longitude']

# Extract more information specific to luftdaten.info
for field in ['location', 'location_id', 'location_name', 'sensor_id', 'sensor_type']:
if field in data:
Expand Down

0 comments on commit ef8c6ff

Please sign in to comment.