I'm using Neo4j 3.2 with the Neo4j Spatial plugin 0.24-neo4j-3.1.1 After adding layers, I tried to create node and add it to the index with spatial.addNode
CALL spatial.addPointLayer('geom');
CREATE (n:Node {latitude:60.1,longitude:15.2})
WITH n
CALL spatial.addNode('geom',n) YIELD node
RETURN node;
I also tried create a new one and add to the index later
CREATE (n:Node {latitude:60.1,longitude:55.2});
MATCH (n:Node {latitude:60.1,longitude:55.2})
WITH n
CALL spatial.addNode('geom',n) YIELD node
RETURN node;
Later on when I tried to call
CALL spatial.removeLayer("geom");
The procedure delete all nodes including those created by
CREATE (n:Node {latitude:60.1,longitude:55.2});
Is it a by-design behavior?
If it is, can you suggest any other way to update/delete the indexes without deleting the location node? There is a proposed solution here but it seems hacky and error-prone when it comes to updating the index information when the location node change the lat/long value neo4j-spatial: What is the official way to delete a node from a spatial index?