uber / h3

Hexagonal hierarchical geospatial indexing system

Home Page:https://h3geo.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

polygonToCells not returning all H3Cells for the bounding box containing both USA and Russia

himanshupareek opened this issue · comments

For the bounding Box near Chukchi Sea and Bering Sea, which covers are for both Russia and USA,
http://bboxfinder.com/#38.572707,99.825356,72.824938,242.558358

For this area with this bounding Box (99.82535619051589,38.572707192065195,242.5583578995022,72.82493824985826), we are not able to fetch all the H3Cells from both of the countries, either we are getting the h3Cells from left side or from right side on the map.

NOTE - I am testing it for resolution 3, it may be for other resolutions too.

image

Can anyone please help me on it, thanks.

The H3 library expects valid lat/lng input, within standard bounds (longitude between -180 and 180, lat between -90 and 90). While we will accept out-of-bounds data in some cases, in general output for out-of-bounds input is undefined. The issue here is the second longitude, 242.5583578995022, which is out of bounds. Updating this to an in-bounds value, -117.441642, yields the correct results.