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

BoundingBox mixes up its corners #102

Closed
1ec5 opened this issue Jun 5, 2020 · 0 comments · Fixed by #104
Closed

BoundingBox mixes up its corners #102

1ec5 opened this issue Jun 5, 2020 · 0 comments · Fixed by #104

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jun 5, 2020

The BoundingBox struct encodes and decodes northwest and southeast coordinates, in that order, whereas the GeoJSON specification expects southwest and northeast coordinates:

try container.encode(northWest.codableCoordinates)
try container.encode(southEast.codableCoordinates)

If an application decodes GeoJSON, the in-memory representation is incorrect. If an application creates a BoundingBox programmatically and encodes it to GeoJSON, the GeoJSON is incorrect.

BoundingBox was probably copied from MapboxDirections’ CoordinateBounds type, which was fixed in mapbox/mapbox-directions-swift#348.

/cc @mapbox/navigation-ios @frederoni

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants