uber / h3

Hexagonal hierarchical geospatial indexing system
https://h3geo.org
Apache License 2.0
4.95k stars 471 forks source link

I built a H3 visualisation tool #593

Open matthiasfeist opened 2 years ago

matthiasfeist commented 2 years ago

Hi everyone!

I use H3 a lot and built a visualisation tool: https://github.com/matthiasfeist/what-the-h3index (live version here: https://what-the-h3index.vercel.app/). Mostly for my own needs.

Not sure if you find it useful but if you do, feel free to include it in the docs :)

/Matthias

nrabinowitz commented 2 years ago

Very cool! It might make sense to add a doc section like Debugging Resources that could also include @nrabinowitz/h3-index-inspector and @nrabinowitz/h3-index-bit-layout.

One note - you might want to borrow https://observablehq.com/@nrabinowitz/mapbox-utils#fixTransmeridian for dealing with cells that cross the anti-meridian, otherwise these render poorly.

nrabinowitz commented 2 years ago

I'd also consider padding the viewpoint - either expanding the viewport before polyfill, or buffering the results by one cell. But this is a really nice tool for exploring the grid!

matthiasfeist commented 2 years ago

@nrabinowitz I've added the padding and your functions to fix the anti-meridian but that issue still doesn't render properly and I'm a bit at a loss there 😅

nrabinowitz commented 2 years ago

The anti-meridian cells don't render properly?

nrabinowitz commented 2 years ago

Oh, I see - this fixed the transmeridian cells, but now you're rendering areas outside of the "main" map bounds instead of inside, is that the issue? I think in this case you might be best off splitting the viewport in two and rendering both halves - I suspect what's happening is that it's picking the smaller of the two possible bounding boxes to polyfill.