vasturiano / globe.gl

UI component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/globe.gl/example/world-population/
MIT License
2.06k stars 304 forks source link

Cover the whole globe with hexagonal tiles? #97

Open krisztianbkertesz opened 2 years ago

krisztianbkertesz commented 2 years ago

Hello, how would one go about covering the whole globa with hexa tiles?

I tried feeding it a polygon like this

[[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]]

but that doesn't seem to work.

Thanks in advance!

vasturiano commented 2 years ago

@krisztianbkertesz you won't be able to cover the whole world with a single polygon, because the framework will choose to fill the inside/outside part of the polygon that occupies less surface. If you use the whole globe, the filled part is essentially none. So, the largest you can go with a single polygon is exactly half the world, this should work:

[[0, -90], [0, 90], [180, 90], [180, -90], [0, -90]]

If you need to fill the whole globe just add another polygon with the remaining half.