maplibre / maplibre

Documents that span across multiple MapLibre projects
https://www.maplibre.org/
Creative Commons Zero v1.0 Universal
75 stars 35 forks source link

Onboarding repository polyline #373

Open mbalfour-amzn opened 1 month ago

mbalfour-amzn commented 1 month ago

https://github.com/maplibre/polyline

Motivation

This is a follow-up to the MapLibre discussion on adding compressed polyline support into the core MapLibre library. The community feedback from that discussion was that support would be helpful, but that it should be introduced as a separate optional library.

Compressed polylines are a category of data formats for performing lossy compression on coordinate data. Despite the name, the compression format is used to encode/decode both line strings and polygons. This compressed format is used as both input and output to various route and isoline APIs from a number of different location service providers: Google, Mapbox, HERE, Stadia Maps, OSRM, Valhalla, etc.

The compression formats used in the APIs are all based on Google’s Encoded Polyline Algorithm Format. Two of the three common variations are the mapbox/polyline library called with either 5 or 6 decimals of precision. The third variation is the heremaps/flexiblepolyline format, which improves upon the format by adding varying amounts of precision, better character encoding, and optional 3D support.

For users to display the compressed geometry in MapLibre, they need to use the correct library to decode the geometry, flip the lat/lng coordinates to lng/lat, and then embed them in the correct geometry in GeoJSON to then use as a MapLibre GeoJSON source.

This repository would contain a library that wraps the existing polyline formats in mapbox/polyline and heremaps/flexiblepolyline to make it easier to use these APIs in conjunction with MapLibre. The library would decode the geometry directly into GeoJSON that can be used as a MapLibre GeoJSON source.

The API would look like the following:

Acceptance

Licensing

Special files

Repo Settings

General page

Access

Branches

Miscelaneous

Community

HarelM commented 1 month ago

Is there a repo that needs to be maintained under the maplibre org as part of this onboarding request? If so, please update the post above.

mbalfour-amzn commented 1 month ago

I have the code locally, but I haven't submitted it to a repo yet since I didn't want to create a repo that was going to need to be deleted shortly afterwards. If that's a requirement for this process though, I can do that.

HarelM commented 1 month ago

yes, please publish it, and then we are transferring the repo if all goes well. Github will redirect the old repo to the new one, no need to delete anything.