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

Fix reversing of coordinates when there are more than 2 coordinates in the array #65

Merged
merged 1 commit into from
May 6, 2020
Merged

Fix reversing of coordinates when there are more than 2 coordinates in the array #65

merged 1 commit into from
May 6, 2020

Conversation

rowanwins
Copy link
Contributor

Currently the entire array of coords in reversed in order to swap the lat/lon, this happens regards of how long the coordinate array is. In the case of geometry with lat/lon/z, this is problematic because the z value gets shifted to the front resulting in incorrect encoding.

Have added a test to ensure the same result is generated between a set of coords with [x,y] and [x,y,z]

Resolves #64

cc @andrewharvey

Copy link
Collaborator

@andrewharvey andrewharvey left a comment

Choose a reason for hiding this comment

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

looks good to me thanks @rowanwins .

@tristen are you able to merge if okay?

@tristen
Copy link
Member

tristen commented May 6, 2020

Ooff. Thanks for the PR! LGTM

@tristen tristen merged commit 163f06b into mapbox:master May 6, 2020
@rowanwins rowanwins deleted the lat-lon-something branch May 6, 2020 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning - produces different result if coords are [x ,y, something]
3 participants