Difference between revisions of "GeoJSON Export"

From floodzilla-wiki
Jump to navigation Jump to search
(Created page with " { "type": "FeatureCollection", "features": [ { "id": "SVPA-25", "type": "Feature", "geometry": { "type": "Point", "coordinates":...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
Test at http://geojson.io/
  
{ "type": "FeatureCollection",
+
Add GeoJSON formatting option to GetLocations (or a separate endpoint that behaves the same) that returns a GeoJSON doc:
 +
 
 +
{ "type": "FeatureCollection",  
 
     "features": [
 
     "features": [
 
       { "id": "SVPA-25",
 
       { "id": "SVPA-25",
Line 9: Line 12:
 
           },
 
           },
 
           "properties": {
 
           "properties": {
 
+
            "id": "USGS-SF17",
 
+
            "locationName": "South Fork Snoqualmie River",
"id": "USGS-SF17",
+
            "latitude": 47.4151086,
"locationName": "South Fork Snoqualmie River",
+
            "longitude": -121.5873213,
"latitude": 47.4151086,
+
            "isOffline": false,
"longitude": -121.5873213,
+
            "rank": 5,
"isOffline": false,
+
            "yMin": 9           ,
"rank": 5,
+
            "yMax": 18,
"yMin": 9,
+
            "groundHeight": 0,
"yMax": 18,
+
            "deviceTypeName": "USGS",
"groundHeight": 0,
+
            "timeZoneName": "America/Los_Angeles",
"deviceTypeName": "USGS",
+
            "currentStatus": {
"timeZoneName": "America/Los_Angeles",
+
            "lastReading": {
"currentStatus": {
+
            "timestamp": "2020-06-24T08:15:00",
"lastReading": {
+
            "waterHeight": 11.53,
"timestamp": "2020-06-24T08:15:00",
+
            "groundHeight": 0,
"waterHeight": 11.53,
+
            "waterDischarge": 296,
"groundHeight": 0,
+
            "stage1": 12.5,
"waterDischarge": 296,
+
            "stage2": 13.5,
"stage1": 12.5,
+
            "isDeleted": false
"stage2": 13.5,
+
            },
"isDeleted": false
+
            "floodLevel": "Normal",
},
+
            "levelTrend": "Steady",
"floodLevel": "Normal",
+
            "waterTrend": {
"levelTrend": "Steady",
+
            "trendValues": [
"waterTrend": {
+
            0,
"trendValues": [
+
            0,
0,
+
            0,
0,
+
            -0.009999999999999787
0,
+
            ],
-0.009999999999999787
+
            "trendValue": -0.009999999999999787
],
+
            }
"trendValue": -0.009999999999999787
 
}
 
 
 
 
 
 
 
 
           }
 
           }
 
         }
 
         }
 +
      }
 
     ]
 
     ]
}
+
}

Latest revision as of 16:14, 24 June 2020

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
           }
         }
       }
     }
   ]
}