Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site maintenance this Wednesday, February 1. Disruptions expected as we migrate the forums.

Fastest spatial point to polygon merge

Hi everyone - I'm trying to figure out the fastest way to join spatial points to polygons. My current cypher is taking 2hrs to join 60k latitude/longitudes (geocodes) to 107k polygons (parcels), seems like I'm doing something inefficiently. I have Point 1.0 indexes set on both the points and polygons, my cypher query is below, based on @craig1 Taverner’s excellent tutorials.

`MATCH (p:Parcel)
WITH p, spatial.boundingBox(p.polygon) as bbox
MATCH (g:Geocode
WHERE bbox.min < g.Point < bbox.max
AND spatial.algo.withinPolygon(g.Point,p.polygon))