Skip to content

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

Open
@kvegter

Description

@kvegter

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions