Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spatial.algo.intersection does not work as expected #6

Open
kvegter opened this issue Feb 19, 2021 · 0 comments
Open

spatial.algo.intersection does not work as expected #6

kvegter opened this issue Feb 19, 2021 · 0 comments

Comments

@kvegter
Copy link

kvegter commented Feb 19, 2021

In this query below I try to see if polygon 1 intersects polygon 2
match (geoc:GeoCollection {id: "1234"})-[:HAS_ELEMENT]->(s:Shell) match (geoc)-[:HAS_ELEMENT]->()-[:HAS_ELEMENT]->(h:Hole) where not ((s)-[:HAS_ELEMENT]->(h)) WITH s.polygon as shell, h.polygon as hole return shell , hole , spatial.algo.intersection(hole,shell) as intersects , spatial.algo.intersection.sweepline(hole,shell) as intersectsSweep , spatial.algo.area(shell) as shellArea , spatial.algo.area(hole) as holeArea

In this example (just plain 2d) the shell is within the hole. the result of this call is empty:

this is the input:
shell polygon:
[point({srid:7203, x:6, y:5})
,point({srid:7203, x:9, y:5})
,point({srid:7203, x:8, y:10})
,point({srid:7203, x:6, y:5})
]

hole polygon:
[point({srid:7203, x:4, y:3})
,point({srid:7203, x:11, y:3})
,point({srid:7203, x:11, y:12})
,point({srid:7203, x:5, y:12})
,point({srid:7203, x:4, y:3})
]

background I want to find shell's which fit in a hole of another polygon...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant