cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

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