私はまた、GIS データベースとしてエクスポートしたい Neo4J 上の Grails アプリに取り組んでいます。
GeoServer/uDig で neo4j を使用する方法の例を見ると、空間統合は組み込みの neo4j データベースを介してのみ行われているようです。
私のNeo4JをREST経由で利用できるようにセットアップして、さまざまな場所からNeo4Jにインターフェースできるようにすることが可能かどうかを知っている人はいますか?
一見、それが可能であるように見えます:
// Works with this embedded database
//def graphDb = new GraphDatabaseFactory().newEmbeddedDatabase("/tmp/foo.db");
// Doesn't work with this REST database
graphDb = new RestGraphDatabase("http://localhost:7474/db/data");
Transaction tx = graphDb.beginTx()
SpatialDatabaseService spatialService = new SpatialDatabaseService(graphDb)
SimplePointLayer layer = spatialService.createSimplePointLayer("points")
組み込みデータベースを使用すると、空間インデックスが適切に作成されます。ただし、REST データベースでは、null ポインターを取得するだけです。
Caused by NullPointerException: null
->> 149 | createCompiler in org.neo4j.cypher.ExecutionEngine
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 48 | <init> in ''
| 59 | createInnerEngine in org.neo4j.cypher.javacompat.ExecutionEngine
| 43 | <init> in ''
| 41 | getReferenceNode in org.neo4j.gis.spatial.utilities.ReferenceNodes
| 78 | getSpatialRoot in org.neo4j.gis.spatial.SpatialDatabaseService
| 114 | getLayer in ''
| 259 | containsLayer in ''
| 303 | createLayer in ''
| 287 | createSimplePointLayer in ''
| 267 | createSimplePointLayer in ''
| 37 | <init> in net.foo.db.neo4j.Neo4JService
SpatialDatabaseService は GraphDatabaseService を使用するため、REST で動作しない理由について混乱しています。
これはバグですか、それとも機能ですか (それとも私の誤解ですか?)
もちろん、create index
API を使用して空間インデックスを作成することもできます。
graphDb.index().forNodes( "points", ["provider": "spatial", "geometry_type": "point", "lat": "lat", "lon":"lon"])
それは機能しますが、そのように新しいレイヤーを作成することはできません。