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

some h3index values create distorted long horizontal line on map #158

Closed
neerajTiwari-truminds opened this issue Sep 12, 2022 · 1 comment

Comments

@neerajTiwari-truminds
Copy link

h3 values examples -859b436ffffffff ,859b5dd7fffffff ,859b5dc7fffffff
I created hex boundary by using h3ToGeoBoundary(perh3index['key'],true) and when i map them on map they create long horizontal distorted hex(as shown in image).
image

Can I know how to resolve this incorrect hex boundary conversion issue?

@nrabinowitz
Copy link
Collaborator

This is a rendering issue, not an issue with library output. The library guarantees output within standard lat/lng bounds (-180 to 180 longitude, -90 to 90 latitude), but many renders have poor results for polygons that cross the antimeridian.

To fix in Javascript, see this function: https://observablehq.com/@nrabinowitz/mapbox-utils#fixTransmeridian - it takes the coordinates on the east (negative) side of the antimeridian and turns them into non-standard values > 180 degrees, which generally renders correctly.

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

No branches or pull requests

2 participants