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

Save data as a GeoJSON #66

Open
sebaxtian opened this issue Oct 28, 2020 · 0 comments
Open

Save data as a GeoJSON #66

sebaxtian opened this issue Oct 28, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@sebaxtian
Copy link

Summary.

Currently, the data is saving in JSON files for each record. Each JSON file has the following format:

{
   "data":[
      {
         "P10":0,
         "P25":12,
         "alt":0.0,
         "lat":3.4459262,
         "lon":-76.5418435,
         "spd":0.0,
         "timestamp":1603844377
      },
      {
         "P10":0,
         "P25":11,
         "alt":0.0,
         "lat":3.4459244,
         "lon":-76.5418444,
         "spd":0.0,
         "timestamp":1603844396
      }
   ],
   "date":"Oct, Tue 27",
   "lastLat":3.4459643,
   "lastLon":-76.5418128,
   "lastSensorData":{
      "P10":0,
      "P25":11,
      "alt":0.0,
      "lat":3.4459643,
      "lon":-76.5418128,
      "spd":0.0,
      "timestamp":1603844525
   },
   "name":"20201027192206",
   "size":16
}

To get better compatibility we can use the GeoJSON format bellow:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "sensor-class": "P25",
        "data-value": 13,
        "altitude": 950,
        "speed": 18,
        "temperature": 31,
        "humidity": 64,
        "timestamp": 1603844377
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          620203.4581875801,
          3.446077154360625
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "sensor-class": "P25",
        "data-value": 5,
        "altitude": 1005,
        "speed": 6,
        "temperature": 30,
        "humidity": 60,
        "timestamp": 1703745313
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          620203.4586596489,
          3.4460717996424504
        ]
      }
    }
  ]
}

Attributes:

  • sensor-class: is the sensor class, can be PM2.5, PM10, etc.

  • data-value: is the sensor data value according to the sensor class.

  • altitude: is the altitude msnm

  • speed: is the speed km/h

  • temperature: is the temperature data value

  • humidity: is the humidity data value

  • timestamp: is the timestamp when the data was capture

@sebaxtian sebaxtian added the enhancement New feature or request label Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant