cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

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))
MERGE (g)-[r:SPATIALLY_WITHIN]->(p)`

0 REPLIES 0