4 ms·
I believe indexing with S2 can be made absolute if a polygon's boundary coverage cells contain a slice of the original shape. It's a bit more expensive on memor
by tidwall 9y ago
I believe indexing with S2 can be made absolute if a polygon's boundary coverage cells contain a slice of the original shape. It's a bit more expensive on memory and insert times. But very fast and accurate queries. I've been experimenting with this method.
- gfrangakis 9y agoS2 can also output interior coverings, which will return only the cells in a covering that are fully contained in a polygon. So if you encounter a point (or any cell) whose parent is in an interior covering, you don't have to do any additional checks to produce an exact result (whereas on the boundary, you may want to do a point-in-polygon test to be exact).
- tidwall 9y agoRight! I forgot to mention that. You can totally skip the entire point-in-polygon for interior cells. So good.