-
|
I'm working with all of the polygons assembled by the timezonefinder team, and I've found some instances where timezones appear to overlap. For example, Asia/Thimphu and Asia/Shanghai have two polygons that are shared between the two timezone polygons: one on the western side of Bhutan and one in north-north-east Bhutan. (Another area shared by two timezone polygons is between Asia/Shanghai and Asia/Urumqi, where basically the entirety of Asia/Urumqi is within Asia/Shanghai.) When I query timezonefinder for the timezone on a point that is within one of these shared polygons (e.g., lng=90.946322933095, lat=27.956793099786655), the returned timezone is Asia/Thimphu. How is the conflict between these two timezone boundaries being resolved? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
The overlap is not resolved as “both” or by a timezone rule. The docs explicitly note that the upstream boundary data can contain overlapping polygons and that In the current implementation, the result comes from the precomputed H3 shortcut plus the ordered candidate polygon list. If you need to reason about overlaps, use the geometry data directly and collect all polygons containing the point. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @CopyOfA for bringing this up. I want add to that:
|
Beta Was this translation helpful? Give feedback.
-
|
You may need choose your own preferences for use caces. Asia/Urumqi works fine with normal life but need to use Asia/Shanghai for public services like airport/train to keep data consistence. And for the "Asia/Thimphu and Asia/Shanghai" case, the background is Bhutan–China border. To be honest, it's not easy to make "best" choice in the timezone look up libraries for the overlap timezones, since potential political reasons also exist. |
Beta Was this translation helpful? Give feedback.

The overlap is not resolved as “both” or by a timezone rule. The docs explicitly note that the upstream boundary data can contain overlapping polygons and that
timezonefinderdoes not support returning multiple matches; it returns one match.In the current implementation, the result comes from the precomputed H3 shortcut plus the ordered candidate polygon list.
timezone_at()checks candidate polygons and returns the first matching zone it reaches, with a shortcut fast path for cells that are precomputed as unique. SoAsia/Thimphufor that coordinate is an artifact of the packaged data/order/index, not a statement that the other overlapping polygon is invalid.If you need to reason about o…