4 ms·
Sorry, my previous answer was not very descriptive. The WITHIN call will be on average O(log(N)) because all objects are stored in an rtree. But it's usually v
by tidwall 10y ago
Sorry, my previous answer was not very descriptive.
The WITHIN call will be on average O(log(N)) because all objects are stored in an rtree. But it's usually very very fast to locate objects based on their outermost bounding area. The complexity of the object will add to the duration. Simple points are super fast, like sub microsecond fast in many cases. A MultiPolygon can be much slower.
Tile38 uses a modified raycasting algorithm, not raytracing for it's polygon detections.