-
Notifications
You must be signed in to change notification settings - Fork 458
docs: describe GeoJSON fields in directions response #2154
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
base: main
Are you sure you want to change the base?
Conversation
aoles
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the prompt fix! ❤️
Do you think we could include the description in the interactive docs (aka API Playground) as well? Cheers! 🙏
aoles
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for documenting the missing bits! 🙏
We should probably verify the changes on staging before the merge.
aoles
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for for adding the descriptions 👍 I've noticed that properties and segments are still missing them, do you think you could still fix this?
Please find some additional points for your consideration in my comments below. Cheers! 🤟
| } | ||
|
|
||
| @Schema(implementation = JSONObject.class, description = "The geometry of the route. For GeoJSON route responses this is a JSON LineString.") | ||
| @Schema(name = "GeoJSONGeometry", implementation = JSONObject.class, description = "The geometry of the route. For GeoJSON route responses this is a JSON LineString.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The geometry field of a GeoJSON feature incorrectly shows up under the name GeoJSONGeometry. It is also missing the internal structure, namely the mandatory type field and the coordinates array. Instead, it displays an empty boolean field. It would be really great if you could look into fixing this ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getGeometry needs to return a JSONObject and thus cannot be switched with a fitting subclass to display type and coordinates in the docs. I haven't found a way yet to make it display anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your efforts! ❤️ I think this could be solved by implementing a dedicated GeoJSONGeometry class containing the required fields properly annotated and described. You might want to introduce such class matching the following replacement code. Let JSONWarning class or similar serve you as a template.
@Schema(name = "geometry", description = "The geometry of the route formatted as a GeoJSON LineString.")
@JsonProperty("geometry")
public GeoJSONGeometry getGeometry() {
return new GeoJSONGeometry("LineString", GeometryJSON.toJSON(this.routeCoordinates, includeElevation));
}
ors-api/src/main/java/org/heigit/ors/api/responses/routing/geojson/GeoJSONSummary.java
Show resolved
Hide resolved
|



Pull Request Checklist
have been resolved.
[Unreleased] heading.
along with a short description of what it is for, and documented this in the Pull Request (below).
(at least Germany), and the graphs build without problems (i.e. no out-of-memory errors).
importer etc.), I have generated longer distance routes for the affected profiles with different options
(avoid features, max weight etc.) and compared these with the routes of the same parameters and start/end
points generated from the current live ORS.
If there are differences then the reasoning for these MUST be documented in the pull request.
and why the change was needed.
Fixes #2084.
Information about the changes
JsonandGeojsonresponses of the directions endpoint.Examples and reasons for differences between live ORS routes, and those generated from this pull request
Required changes to ors config (if applicable)