GeoJSON Export

From floodzilla-wiki
Jump to navigation Jump to search

Test at http://geojson.io/

Add GeoJSON formatting option to GetLocations (or a separate endpoint that behaves the same) that returns a GeoJSON doc:

{ "type": "FeatureCollection", 
   "features": [
     { "id": "SVPA-25",
       "type": "Feature",
       "geometry": {
         "type": "Point",
         "coordinates": [-121.5873213, 47.4151086]
         },
         "properties": {
           "id": "USGS-SF17",
           "locationName": "South Fork Snoqualmie River",
           "latitude": 47.4151086,
           "longitude": -121.5873213,
           "isOffline": false,
           "rank": 5,
           "yMin": 9            ,
           "yMax": 18,
           "groundHeight": 0,
           "deviceTypeName": "USGS",
           "timeZoneName": "America/Los_Angeles",
           "currentStatus": {
           "lastReading": {
           "timestamp": "2020-06-24T08:15:00",
           "waterHeight": 11.53,
           "groundHeight": 0,
           "waterDischarge": 296,
           "stage1": 12.5,
           "stage2": 13.5,
           "isDeleted": false
           },
           "floodLevel": "Normal",
           "levelTrend": "Steady",
           "waterTrend": {
           "trendValues": [
           0,
           0,
           0,
           -0.009999999999999787
           ],
           "trendValue": -0.009999999999999787
           }
         }
       }
     }
   ]
}