-
Notifications
You must be signed in to change notification settings - Fork 8
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
Improve error message on invalid AOI polygon input #55
Comments
//edit: It might be common knowledge but we could update the documentation to inform the user that we apply no cleaning on geometries returned through the extraction endpoints and they might be invalid if the source OSM-data creates invalid geometries OR can we apply more cleaning methods to ensure clean geometries? another case: geometry of relation/540344 at 2020-05-04 requested from ohsome cannot be used as bpoly with the same error message: slightlyInvalidGeojson.geojson.txt |
The error message is even more cryptic when supplying an invalid geojson (e.g. supllying a list of geometries instead of a list of features in the FeatureCollection):
|
As I remember we don't want to perform any fixing on the OSM data and try to return it as it is. This means if the data is partially broken then we still try to return it in that state, if possible.
Can you provide such a GeoJSON? There is the following method in the ohsome API which creates the geometry out of the provided GeoJSON: ohsome-api/src/main/lombok/org/heigit/ohsome/ohsomeapi/inputprocessing/GeometryBuilder.java Line 225 in f7cb2b7
I guess we would have to extend it then to a degree that also your mentioned issues are tackled there. |
Yes, that discussion should probably be continued in a separate issue in the OSHDB repository. I've created one here: GIScience/oshdb#367. Feel free to add further info there. Regarding the remarked issue with the error response: I am using a JSON library to validate the JSON conformity, but I could not find yet any GeoJSON equivalent for it. If you know of something, please let me know too. The fix in #164 should at least help for now. |
these are the two I know of: https://www.npmjs.com/package/geojson-validation and https://geojsonlint.com/ (are they the same?) but at least the latter one is extremely strict (e.g. right hand rule) and I don't know if that can be adapted, I have not used them |
Ah yeah maybe I did not write it explicitly: I mean Java libraries of course :D I know of geojsonlint.com or geojson.io and also use them regularly, but I don't know of a Java library that I can easily use to check GeoJSON validity. We use |
If I remember correctly, geojsonlint.com uses https://www.npmjs.com/package/@mapbox/geojsonhint, so no, they are probably not the same.
why do you find that to be extremely strict when the standard defines this as a |
better handling of geojson parsing exceptions closes issue #55 fix of not properly working GetControllerTest class in case port1 parameter was omitted
More information in the error returned by the following POST request at /elements/geometry would help the user to debug the problem. The request contains an 'edge case of validity' as bpoly that our code cannot handle.
The error:
I would expect an information like 'provided invalid input geometry' and an 'input error' rather than an internal server error.
This is the requests body (sorry, its rather long but it is the one at hand at the moment):
The text was updated successfully, but these errors were encountered: