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

compressed polylines #455

Open
GerdC opened this issue Feb 27, 2024 · 4 comments
Open

compressed polylines #455

GerdC opened this issue Feb 27, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@GerdC
Copy link

GerdC commented Feb 27, 2024

RE issue #452 Motis potential

There are multiple ways to compress polylines.

Often Googles compressed polyline format is used. It is efficient, proven, and there are libraries in many languages supporting it.

There are reasons to extend this format, like HERE did with flexible-polyline: https://github.com/heremaps/flexible-polyline (MIT license). Standard application of this format is to compress elevation for each coordinate in the polyline.

(When ORS is told to return a polyline with elevation, it uses this format, which to my knowledge is undocumented apart from these decoder implementations: https://giscience.github.io/openrouteservice/api-reference/endpoints/directions/geometry-decoding
I wouldn't seriously consider this format)

Also, routers like GraphHopper and OpenRouteService have an additional way to add properties to a polyline (more properties than would fit into HEREs flexible-polyline)

Their idea is the following. Let's take steepness as an example:
They return a structure that says: from polyline index 7 to index 13, the steepness id is 1, meaning a steepness between 4% and 7%.

Different modes have different properties that are interesting for them.
While for walking and bike, the steepness is interesting, for cars it is interesting if it is a toll road.
Examples for such properties are in this ORS documentation: https://giscience.github.io/openrouteservice/api-reference/endpoints/directions/extra-info/

GraphHoppers/ORSs idea can be combined with polyline and with flexible-polyline.

These are the options I came across using real world routing APIs.

@felixguendling felixguendling added the enhancement New feature or request label Feb 27, 2024
@felixguendling felixguendling mentioned this issue Feb 27, 2024
27 tasks
@felixguendling
Copy link
Member

This depends on software that is not really part of MOTIS (only linked as a library or in the future used as third-party API). Since we might evolve the MOTIS API protocol, we can still keep this issue here.

@mlundblad
Copy link

RE issue #452 Motis potential

There are multiple ways to compress polylines.

Often Googles compressed polyline format is used. It is efficient, proven, and there are libraries in many languages supporting it.

Is this the same as EPAF, right? This is what we currently support in GNOME Maps (the format used in GraphHopper and OpenTripPlanner).

@GerdC
Copy link
Author

GerdC commented Feb 27, 2024

Never heard of EPAF before, but this Gnome code implements EPAF and a few lines later links to Googles polyline documentation: https://mail.gnome.org/archives/commits-list/2022-August/msg02657.html
So yes, EPAF should be identical with Googles polyline format.

@mlundblad
Copy link

Never heard of EPAF before, but this Gnome code implements EPAF and a few lines later links to Googles polyline documentation: https://mail.gnome.org/archives/commits-list/2022-August/msg02657.html So yes, EPAF should be identical with Googles polyline format.

Yeah, I don't remember exactly where this code came from originally, I think it might be borrowed from another project, so not actually sure what EPAF stood for, but yeah the link suggest Google.

@felixguendling felixguendling changed the title MOTIS potential: compressed polylines compressed polylines Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants