Skip to content

Commit

Permalink
Remove commented out code in withinBBoxTest()
Browse files Browse the repository at this point in the history
  • Loading branch information
murermader committed Oct 22, 2024
1 parent f26e8b2 commit 8263515
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public void withinBBoxTest() {
(b:Dot {x: 1.5, y: 1.5, name: 'inside'}),
(c:Dot {x: 3, y: 3, name: 'outside'});
""" );

GraphResult res = execute( """
MATCH (d:Dot {name: 'inside'})
WITH point({x: d.x, y: d.y}) AS dPoint, d
Expand All @@ -176,12 +175,10 @@ WITH point({x: d.x, y: d.y}) AS dPoint, d
assert res.data[0][0].contains( "\"value\":true" );

// 2D, spherical geometry

execute( """
CREATE (paris:Coordinate {longitude: 2.346956837011285, latitude: 48.85505503368006, name: 'Paris'}),
(brussels:Coordinate {longitude: 4.352467876598982, latitude: 50.846742342693915, name: 'Brussels'});
""" );

res = execute( """
MATCH (c:Coordinate {name: 'Paris'})
WITH point({longitude: c.longitude, latitude: c.latitude}) AS cPoint, c
Expand All @@ -204,19 +201,6 @@ WITH point({longitude: c.longitude, latitude: c.latitude}) AS cPoint, c
""" );
assert res.data[0][0].contains( "\"value\":false" );

// TODO: Fix this? (returns false in Neo4j)
// lowerLeft and upperRight swapped (should result in empty results)
// res = execute( """
// MATCH (c:Coordinate {name: 'Paris'})
// WITH point({longitude: c.longitude, latitude: c.latitude}) AS cPoint, c
// RETURN point.withinBBox(
// cPoint,
// point({longitude: 4.6322913692799705, latitude: 50.68567402837961}),
// point({longitude: 1.9987169362536548, latitude: 48.567460188915405}))
// AS result, c.name
// """ );
// assert res.data[0][0].contains( "\"value\":false" );

// 3D, planar geometry
// TODO

Expand All @@ -230,6 +214,7 @@ WITH point({x: d.x, y: d.y}) AS dPoint, d
RETURN point.withinBBox(dPoint, point({x: 1, y: 1}), point({x: 2, y: 2, z: 1})) AS result, d.name
""" );
assert res.data[0][0] == null;

res = execute( """
MATCH (c:Coordinate {name: 'Paris'})
WITH point({longitude: c.longitude, latitude: c.latitude, height: 100}) AS cPoint, c
Expand Down

0 comments on commit 8263515

Please sign in to comment.