GithubHelp home page GithubHelp logo

Comments (1)

nrabinowitz avatar nrabinowitz commented on June 22, 2024

The shapes aren't weird, they're just being rendered poorly. When H3 (and h3-js) outputs shapes that cross the antimeridian, we keep all longitude values within the -180 - 180 range, so you may have some cells that have some western coordinates at longitude 179 and some eastern coordinates at -179. Many maps will render this badly, but from a geographic shape perspective this is correct.

Either PostGIS or ogr2ogr is taking the approach of cutting these cells into multipolygons, with one poly on one side of the antimeridian and one poly on the other. Normally I'd expect to see the dividing line rendered as well, but possibly your renderer expects this input and drops the dividing border. This is a perfectly good rendering solution, but I don't consider it a good generic solution because it gives you two shapes for some cells, instead of one.

Depending on your requirements, you can post-process the h3-js output to render better, either by running it through a tool that can cut it up, or by normalizing the coordinates to extend past -180 and 180. See this fixTransmeridian function for an example of the latter approach.

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.