Giter VIP home page Giter VIP logo

Comments (2)

nrabinowitz avatar nrabinowitz commented on May 23, 2024

There are two issues here, both (unfortunately) expected and somewhat documented:

  • The current H3 polyfill algorithm can't deal with polygon segments of greater than 180 degrees longitude. Otherwise, we interpret the bounding box of the polygon as crossing the antimeridian. The alternative was to require incoming polygons to follow the Right Hand Rule, and while we obey this in output we didn't want to enforce it in input. So what you're seeing in the first image is the set of hexagons in the bounding box between the western edge of your real bounding box (interpreted as east) and the eastern edge of your bounding box (interpreted as west).

  • Mapbox doesn't deal well with drawing polygons that cross the antimeridian. So the cross-globe lines you see in the first image are a rendering artifact, not actual H3 output. The fix is to adjust the geometry to go outside the +-180 degree longitude range (i.e. a segment from longitude -179 to longitude 179 would need to be rewritten as going from -179 to -181).

So unfortunately this is "working as expected". You can polyfill the area by using multiple bounding boxes, and you can draw it correctly by adjusting the output geometry to what Mapbox expects.

from h3-js.

 avatar commented on May 23, 2024

Many thanks for a fast, clear & consise reply! Can probably close this issue.

from h3-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.