USGS-WiM / STNServices2

Web services for the Short-Term Network (STN) database
Other
0 stars 0 forks source link

GeoJSON codec is returning invalid geoJSON #111

Open BlakeDraper opened 7 years ago

BlakeDraper commented 7 years ago

Marty noticed that the geoJSON endpoint is failing a geoJSON linter. He discovered this:

"bbox":[-96.08236,29.91331], bounding box should not be a point, should be 4 points.

Example endpoint that has this problem: https://stn.wim.usgs.gov/STNServices/Events/180/HWMs.geojson

troddick commented 7 years ago

I am not very familiar with the setup of the geojson codec, but I looked at it a bit and it seems that a bbox is calculated behind the scenes for each feature via the .net FeatureBase in Jeremy's WiMServices. I'm thinking it is up to the client app to determine the full extent based on some kind of spatial loop over the feature's bbox property. Is this a feasible solution? If not, I'd have to spend some more time digging in to what Jeremy has going on in the inherited WiMservices project to find a solution, if one is possible.

BlakeDraper commented 7 years ago

The best solution is just to drop the bbox property from the output - it's not required, and a point feature should not have a bbox anyway. I am not using the bbox property in any WiM app or trying to, but having it in there and being invalid makes the whole geoJSON output invalid, and that may be why AGOL is rejecting it. Even if it isn't the cause of the AGOL failure, we should fix it anyway so we are returning valid geoJSON.

troddick commented 7 years ago

the bbox property is being returned from @jknewson WiMServices Feature class. Jeremy, should this be stripped out of WiMServices, or should I try to remove this property in the loop that builds my FeatureCollection in the STNGeoJsonDotNetCodec?

lprivette commented 4 years ago

Ensure refactored services are using valid geojson