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

Check epsg:4326 bounds in layer creation #317

Merged
merged 3 commits into from
Jan 12, 2024
Merged

Conversation

kylebarron
Copy link
Member

@kylebarron kylebarron commented Jan 12, 2024

This adds a check on layer creation that the computed centroid of the input data is within the bounds of wgs84. This doesn't check the computed bounding box because that could wrap over the international date line and have values less than -180.

This is improved over the previous approach because previously we checked the final average of the centroid against wgs84, whereas now we check each layer individually. This is safer in case most layers are wgs84 but one is not. Also, it errors at layer creation, which is a much better time to error.

In the future, we could allow web-mercator coordinates as well (see https://deck.gl/docs/developer-guide/coordinate-systems) and this would have to be refactored to allow the larger range of coordinates.

@kylebarron kylebarron enabled auto-merge (squash) January 12, 2024 21:21
@kylebarron kylebarron merged commit b1afa3e into main Jan 12, 2024
5 checks passed
@kylebarron kylebarron deleted the kyle/check-4326-bounds branch January 12, 2024 21:21
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.

None yet

1 participant