Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-20-2022 07:30 PM
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)`
All the sessions of the conference are now available online