2
votes

I've compiled the latest Neo4j Spatial (neo4j-spatial-0.16-neo4j-3.0.0-server-plugin.jar) from source and dropped it into my Neo4j 3.0.0 plugins folder.

The extension is listed in the browser, and I can do POST calls for spatial functionality.

However, I believe I should also be able to use the nifty new CALL feature in Neo4j 3.0.0 to make Cypher calls, like this:

CALL spatial.addPointLayer('cities');

As alluded to by Stefan's update here:

How do I create a spacial index in neo4j using only cypher?

And shown here:

http://jexp.github.io/graphgist/idx?dropbox-14493611%2Fcypher_spatial.adoc

However, I get a "There is no procedure with the name spatial.addPointLayer registered for this database instance." error, and can see the same calls failing in the jexp example as well... I'm not sure if I'm just too early to the party or missing something?

2
Did you find a solution to this question? I am able to get the list of procedures using "CALL spatial.procedures()", or a list of layers when using "CALL spatial.laterTypes()" but when trying to call any of the returned procedures, or the documented procedures, I receive "Failed to invoke procedure spatial.layers: Caused by: java.lang.NoClassDefFoundError: org/geotools/filter/text/cql2/CQLException"Blake

2 Answers

0
votes

The plugin needs to be in the database-specific Plugin folder and not in the "Neo4j CE 3.0.x/Plugins" folder.

0
votes

In Neo4j 3.0, for basic operations you don't need the spatial plugin.

There is default support for point and distance. This support assumes you will set lat/lon property keys as latitude and longitude.

You can the use them for calculating distance between two nodes, for example :

MATCH (a:City {name:'London'}), (b:City {name:'Barcelona'})
RETURN distance(point(a), point(b))/1000 as dist

You can find a detailed example in this graphgist :

http://gist.asciidoctor.org/?dropbox-14493611%2Fcypher_spatial.adoc#_spatial_procedures

Secondly, in Neo4j 3.0 appears stored procedures, an official set of procedures is supported by neo4j here :

https://github.com/neo4j-contrib/neo4j-apoc-procedures

Which provides some more spatial features.