Closed gbreen12 closed 4 years ago
It's just a warning. It probably means your polygon coordinates are not wound in the direction specified by the GeoJSON specification. You may be able to ignore it. If you have problems, you can rewind your geometry using https://github.com/mapbox/geojson-rewind.
If you want to suppress the warning set the environment variable: KOOP_WARNINGS=suppress
.
Also - It looks like have set your geometryType
wrong. It's set to Point
, but you have Polygon
data.
Please paste the warning when you get a chance.
WARNING: source data for /database/rest/services/FeatureServer/0/query contains invalid GeoJSON.
I guess I don't really care about the warning so much as I thought it might be messing me up. I'm able to get data back from my koop instance but when I try to use it in an esri map it doesn't show anything. I've narrowed it down to two parameters that are being used:
Ok, this is likely due to the coordiate system of your data, or the outSR
you are requesting it to be served as. Does the GeoJSON you are creating in your provider have its coordinates in WGS84? Note that GeoJSON spec is for coordinates to be in WGS84, so that is what Koop is expecting to get from all providers.
Assuming your GeoJSON is in WGS84, you can run into problems when requests include an outSR
. Unlike ArcGIS server, Koop doesn't contain full re-projection capabilities (at least out of the box); maintaining a complete dictionary of all potential coordinate system is currently considered outside of the scope of the application. Out of the box, koop only can manage a handful of outSR values. See this for more details, and this for a suggestion for supporting other outSRs in your provider.
OK. I think I'm understanding now but I am not sure that Koop is the correct solution for us. Basically our data is already in the spatial reference we want but the Geoservices output plugin seems to assume it is in the WGS84 spatial reference so even if I do something like the following, it takes my data (which is already in the spatial reference we want) and tries to project it. Is the Geoservices plugin able to be customized to basically ignore the outSR
and let me set the spatial reference to what I want on the way out? Again Koop may not end up being the correct solution...
Thanks for your help.
Right, Koop assumes it is WGS84 (GeoJSON spec). Currently this is critical for the GeoServices output plugin, because of the geometry
filter. If Koop has to filter geometry, it has to compare the passed geometry enveloped to the data. Making this comparison means it needs to know the coordinate system of the data as well as that of the geometry envelope so that it can do the conversion so that it's apples to apples.
You can ignore outSR
by removing it the before
or after
functions (or in the getData
method if you are authoring a custom provider). Just set req.query.outSR = undefined
. Whether or not this will cause you problems depends on the which clients you are using and the types of request they are making.
This issue has comes up for several other users. We're planning on adding a sourceSR
parameter to handle it. For now, other users have taken the approach noted here. Essentially you get your data and reproject to WGS84 before Koop does anything else with it.
OK Thanks for the info.
I'm getting a warning with every request that my geoJSON is invalid. I don't believe it's invalid based on the spec.
The following is what I am returning from my
getData
method: