Skip to content

Commit a51c486

Browse files
committed
Merge remote-tracking branch 'origin/0.25-neo4j-3.2' into 0.25-neo4j-3.3
2 parents 53be1f1 + 5d33469 commit a51c486

File tree

4 files changed

+35
-9
lines changed

4 files changed

+35
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ The Neo4j Spatial Plugin is available for inclusion in the server version of Neo
225225
* [v0.24.1 for Neo4j 3.2.5](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.24.1-neo4j-3.2.5/neo4j-spatial-0.24.1-neo4j-3.2.5-server-plugin.jar?raw=true)
226226
* [v0.25.1 for Neo4j 3.0.8](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.25.1-neo4j-3.0.8/neo4j-spatial-0.25.1-neo4j-3.0.8-server-plugin.jar?raw=true)
227227
* [v0.25.3 for Neo4j 3.1.4](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.25.3-neo4j-3.1.4/neo4j-spatial-0.25.3-neo4j-3.1.4-server-plugin.jar?raw=true)
228-
* [v0.25.3 for Neo4j 3.2.8](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.25.3-neo4j-3.2.8/neo4j-spatial-0.25.3-neo4j-3.2.8-server-plugin.jar?raw=true)
229-
* [v0.25.4 for Neo4j 3.3.5](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.25.4-neo4j-3.3.5/neo4j-spatial-0.25.4-neo4j-3.3.5-server-plugin.jar?raw=true)
228+
* [v0.25.4 for Neo4j 3.2.8](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.25.4-neo4j-3.2.8/neo4j-spatial-0.25.4-neo4j-3.2.8-server-plugin.jar?raw=true)
229+
* [v0.25.5 for Neo4j 3.3.5](https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.25.5-neo4j-3.3.5/neo4j-spatial-0.25.5-neo4j-3.3.5-server-plugin.jar?raw=true)
230230

231231
For versions up to 0.15-neo4j-2.3.4:
232232

@@ -342,7 +342,7 @@ Add the following repositories and dependency to your project's pom.xml:
342342
<dependency>
343343
<groupId>org.neo4j</groupId>
344344
<artifactId>neo4j-spatial</artifactId>
345-
<version>0.25.4-neo4j-3.3.5</version>
345+
<version>0.25.5-neo4j-3.3.5</version>
346346
</dependency>
347347
~~~
348348

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<modelVersion>4.0.0</modelVersion>
2222
<artifactId>neo4j-spatial</artifactId>
2323
<groupId>org.neo4j</groupId>
24-
<version>0.25.4-neo4j-3.3.5</version>
24+
<version>0.25.5-neo4j-3.3.5</version>
2525
<name>Neo4j - Spatial Components</name>
2626
<description>Spatial utilities and components for Neo4j</description>
2727
<url>http://components.neo4j.org/${project.artifactId}/${project.version}</url>

src/main/java/org/neo4j/gis/spatial/index/ExplicitIndexBackedPointIndex.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@
2727
import org.neo4j.gis.spatial.rtree.TreeMonitor;
2828
import org.neo4j.gis.spatial.rtree.filter.SearchFilter;
2929
import org.neo4j.gis.spatial.rtree.filter.SearchResults;
30-
import org.neo4j.graphdb.GraphDatabaseService;
31-
import org.neo4j.graphdb.Node;
32-
import org.neo4j.graphdb.NotFoundException;
33-
import org.neo4j.graphdb.Transaction;
30+
import org.neo4j.graphdb.*;
3431
import org.neo4j.graphdb.index.Index;
3532
import org.neo4j.graphdb.index.IndexHits;
36-
import org.neo4j.helpers.collection.Iterables;
3733

3834
import java.util.Iterator;
3935
import java.util.List;
@@ -92,6 +88,9 @@ public void remove(long geomNodeId, boolean deleteGeomNode, boolean throwExcepti
9288
if (geomNode != null) {
9389
index.remove(geomNode);
9490
if (deleteGeomNode) {
91+
for (Relationship rel : geomNode.getRelationships()) {
92+
rel.delete();
93+
}
9594
geomNode.delete();
9695
}
9796
}

src/test/java/org/neo4j/gis/spatial/procedures/SpatialProceduresTest.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,33 @@ public void add_a_node_to_the_spatial_hilbert_index() throws Exception {
536536
testCall(db, "MATCH (n:Node) WITH n CALL spatial.addNode('geom',n) YIELD node RETURN node", r -> Assert.assertEquals(node, r.get("node")));
537537
}
538538

539+
@Test
540+
public void add_a_node_to_multiple_different_indexes() throws Exception {
541+
String[] indexes = new String[]{"Geohash", "ZOrder", "Hilbert", "RTree"};
542+
for (String name : indexes) {
543+
String layerName = name.toLowerCase();
544+
execute("CALL spatial.addPointLayer" + (name.equals("RTree") ? "" : name) + "('" + layerName + "')");
545+
}
546+
testCallCount(db, "CALL spatial.layers()", null, indexes.length);
547+
ResourceIterator<Object> nodes = db.execute("CREATE (n:Node {latitude:60.1,longitude:15.2}) RETURN n").columnAs("n");
548+
Node node = (Node) nodes.next();
549+
nodes.close();
550+
for (String name : indexes) {
551+
String layerName = name.toLowerCase();
552+
testCall(db, "MATCH (n:Node) WITH n CALL spatial.addNode('" + layerName + "',n) YIELD node RETURN node", r -> Assert.assertEquals(node, r.get("node")));
553+
}
554+
for (String name : indexes) {
555+
String layerName = name.toLowerCase();
556+
testCall(db, "CALL spatial.withinDistance('" + layerName + "',{lon:15.0,lat:60.0},100)", r -> assertEquals(node, r.get("node")));
557+
}
558+
for (String name : indexes) {
559+
String layerName = name.toLowerCase();
560+
execute("CALL spatial.removeLayer('" + layerName + "')");
561+
}
562+
testCallCount(db, "CALL spatial.layers()", null, 0);
563+
}
564+
565+
539566
@Test
540567
public void testDistanceNode() throws Exception {
541568
execute("CALL spatial.addPointLayer('geom')");

0 commit comments

Comments
 (0)