Is it possible to multithread H3 methods in python? #810
-
I'm running some pretty hefty .polyfill operations on python on 1000s of polygons. Any way I can split the work across cores? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
This would be more appropriately asked on the h3-py repo. But some notes:
|
Beta Was this translation helpful? Give feedback.
-
If the main issue is splitting up the work for specific large polygons, the simplest option is to divide the polygon itself into pieces, e.g. vertical strips, and send those to different threads for processing. The default H3 polyfill mode, which only includes cells whose centers are within the polygon, will ensure that contiguous partial polygons processed in this way will yield the same set as the original polygon, without duplicates or gaps. |
Beta Was this translation helpful? Give feedback.
If the main issue is splitting up the work for specific large polygons, the simplest option is to divide the polygon itself into pieces, e.g. vertical strips, and send those to different threads for processing. The default H3 polyfill mode, which only includes cells whose centers are within the polygon, will ensure that contiguous partial polygons processed in this way will yield the same set as the original polygon, without duplicates or gaps.