Skip to content
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

feat: add snapping endpoint #1524

Merged
merged 18 commits into from
Oct 6, 2023
Merged

Conversation

sfendrich
Copy link
Contributor

Pull Request Checklist

  • 1. I have rebased the latest version of the master branch into my feature branch and all conflicts
    have been resolved.
  • 2. I have added information about the change/addition to functionality to the CHANGELOG.md file under the
    [Unreleased] heading.
  • 3. I have documented my code using JDocs tags.
  • 4. I have removed unnecessary commented out code, imports and System.out.println statements.
  • 5. I have written JUnit tests for any new methods/classes and ensured that they pass.
  • 6. I have created API tests for any new functionality exposed to the API.
  • 7. If changes/additions are made to the ors-config.json file, I have added these to the ors config documentation
    along with a short description of what it is for, and documented this in the Pull Request (below).
  • 8. I have built graphs with my code of the Heidelberg.osm.gz file and run the api-tests with all test passing
  • 9. I have referenced the Issue Number in the Pull Request (if the changes were from an issue).
  • 10. For new features or changes involving building of graphs, I have tested on a larger dataset
    (at least Germany), and the graphs build without problems (i.e. no out-of-memory errors).
  • 11. For new features or changes involving the graphbuilding process (i.e. changing encoders, updating the
    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.
  • 12. I have written in the Pull Request information about the changes made including their intended usage
    and why the change was needed.
  • 13. For changes touching the API documentation, I have tested that the API playground renders correctly.

Fixes #1519 .

Information about the changes

  • Key functionality added: snapping endpoint that returns locations snapped to the nearest edge in the graph

@sfendrich sfendrich changed the title Feat/add snapping endpoint Feat: add snapping endpoint Aug 10, 2023
@sfendrich sfendrich changed the title Feat: add snapping endpoint feat: add snapping endpoint Aug 10, 2023
@github-actions github-actions bot added feature and removed feature labels Aug 11, 2023
@TheGreatRefrigerator
Copy link
Contributor

I can't run the normal Application run configuration of spring-boot.
It doesn't work with my old ors-config.json but even if i remove that and it uses the default files (after uncommenting the pbf line).

11 Aug 16:12:13 INFO                                                  main [ o.h.o.a.Application                      ]   Starting Application using Java 17.0.6 with PID 26175 (/Users/abutzer/Workspace/openrouteservice/ors-api/target/classes started by abutzer in /Users/abutzer/Workspace/openrouteservice)
11 Aug 16:12:13 INFO                                                  main [ o.h.o.a.Application                      ]   The following 1 profile is active: "default"
11 Aug 16:12:15 INFO                                              ORS-Init [ o.h.o.a.s.l.ORSInitContextListener       ]   Initializing ORS...
11 Aug 16:12:15 INFO                                              ORS-Init [ o.h.o.r.RoutingProfileManager            ]   Total - 110 MB, Free - 82.99 MB, Max: 4 GB, Used - 27.01 MB
11 Aug 16:12:15 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   
11 Aug 16:12:15 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   No profiles configured. Exiting.
11 Aug 16:12:15 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   
11 Aug 16:12:15 INFO                                                  main [ o.h.o.a.Application                      ]   Started Application in 2.803 seconds (process running for 3.698)
11 Aug 16:12:15 INFO                         SpringApplicationShutdownHook [ o.h.o.a.s.l.ORSInitContextListener       ]   Shutting down ORS and releasing resources.

Copy link
Contributor

@TheGreatRefrigerator TheGreatRefrigerator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One general question we should consider is wether we want to return this as geojson as well?

apart from that some smaller issues to resolve.

@TheGreatRefrigerator
Copy link
Contributor

@MichaelsJP @sfendrich Do we want this endpoint on the live API or should it be hidden in the Playground?
If yes we also need to consider this endpoint in the tyk policies and quota plans.

@MichaelsJP
Copy link
Member

@MichaelsJP @sfendrich Do we want this endpoint on the live API or should it be hidden in the Playground? If yes we also need to consider this endpoint in the tyk policies and quota plans.

I'd say we open it up on the live API with the next major Release 8.

@MichaelsJP
Copy link
Member

One general question we should consider is wether we want to return this as geojson as well?

apart from that some smaller issues to resolve.

@TheGreatRefrigerator Should be effortlessly integrable and would make the endpoint similar to the others. I'd say let's do it.

@MichaelsJP
Copy link
Member

MichaelsJP commented Aug 15, 2023

So, just three things missing:

  1. Decide on a request limit. We need one. If it's possible, we could just do it in the API-Gateway. It would make our lives easier.
  2. Add a few more test cases (parametrized) and failing.
  3. Add the GeoJSON return.
  4. Test performance

Adjust the documentation?

@MichaelsJP
Copy link
Member

So, just three things missing:

  1. Decide on a request limit. We need one. If it's possible, we could just do it in the API-Gateway. It would make our lives easier.
    We should integrate a config level request limit for the number of points to query. Even though we might add another check in the future in the api gateway

@MichaelsJP MichaelsJP marked this pull request as draft September 5, 2023 12:08
Copy link
Member

@aoles aoles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Add endpoint to services listed at localhost:8082/ors/v2/status.
  2. Instead of the somewhat lengthy API parameter name maximum_search_radius wouldn't just radius be sufficient?

@MichaelsJP
Copy link
Member

Snap is added to Status

aoles
aoles previously requested changes Oct 4, 2023
Copy link
Member

@aoles aoles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following TODO needs to be addressed.

// TODO: replace usage of matrix search context by snapping-specific class

@TheGreatRefrigerator TheGreatRefrigerator force-pushed the feat/add-snapping-endpoint branch 2 times, most recently from cb125ca to 20e2337 Compare October 5, 2023 14:57
@jhaeu jhaeu force-pushed the feat/add-snapping-endpoint branch from f74ae36 to cb125ca Compare October 5, 2023 15:07
@TheGreatRefrigerator TheGreatRefrigerator force-pushed the feat/add-snapping-endpoint branch 2 times, most recently from 18b902b to d0bdc81 Compare October 5, 2023 15:30
Copy link
Contributor

@TheGreatRefrigerator TheGreatRefrigerator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ready now

@TheGreatRefrigerator TheGreatRefrigerator dismissed stale reviews from MichaelsJP and aoles October 6, 2023 12:42

changes implemented review re-requested

@TheGreatRefrigerator TheGreatRefrigerator merged commit a9f8487 into master Oct 6, 2023
13 checks passed
@TheGreatRefrigerator TheGreatRefrigerator deleted the feat/add-snapping-endpoint branch October 6, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting release
Development

Successfully merging this pull request may close these issues.

Integrate snapping endpoint
5 participants