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

Encoding stations.stationArea with polyline #526

Merged
merged 6 commits into from
Aug 29, 2024

Conversation

Goplen
Copy link
Collaborator

@Goplen Goplen commented Aug 27, 2024

Summary

  • This PR adds polylineEncodedMultiPolygon to Station.
  • All the rings in polylineEncodedMultiPolygon are encoded with Mapbox Polyline

Issue

Closes ETU-51094
Motivation: MultiPolygon data can get quite large for mobile network traffic. Using mapbox polyline can reduce this size by ~90%. This is a lossy compression, but only unnecessary decimal info is lost. Precision has been set to 6 decimals.
How the code works: Add the extra polylineEncodedMultiPolygon field on Station , which is the same as the existing stationArea.coordinates, but where the innermost list of coordinates List<List> is replaced by an encoded String.

Unit tests
Added testStationsPolylineEncodedMultiPolygon

Documentation
Description in graphql schema added.

@testower testower requested a review from hbruch August 27, 2024 11:52
@testower testower added the enhancement New feature or request label Aug 27, 2024
@testower testower added this to the 1.1 (next release) milestone Aug 27, 2024
@testower
Copy link
Collaborator

Looks good to me, just wondering if polylineEncodedMultiPolygon should maybe be renamed to stationAreaPolylineEncodedMultiPolygon for clarity.

src/main/resources/graphql/schema.graphqls Outdated Show resolved Hide resolved
@testower testower self-requested a review August 28, 2024 12:37
Copy link
Collaborator

@testower testower left a comment

Choose a reason for hiding this comment

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

See comment about schema documentation of the new graphql field

Copy link

@testower testower merged commit 26af8c1 into master Aug 29, 2024
4 checks passed
@testower testower deleted the stations-station-area-zones-encode-with-polyline branch August 29, 2024 10:17
github-actions bot pushed a commit that referenced this pull request Aug 29, 2024
github-actions bot pushed a commit that referenced this pull request Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants