I am new to neo4j and neo4j spatial. I want to import an OSM-File which i exported from https://www.openstreetmap.org/export. For this i use the following code. All examples i could found does not work for me or was incomplete. So i try to get a version which compiles:
try {
OSMImporter importer = new OSMImporter("osmGauKlein");
Map<String, String> config = new HashMap<String, String>();
config.put("neostore.nodestore.db.mapped_memory", "90M" );
config.put("dump_configuration", "true");
config.put("use_memory_mapped_buffers", "true");
BatchInserter batchInserter = BatchInserters.inserter(dbf, config);
importer.importFile(batchInserter, "osm/map.osm", false);
batchInserter.shutdown();
GraphDatabaseService dbs = dbFactory.newEmbeddedDatabase(dbf);
importer.reIndex(dbs, 10000);
dbs.shutdown();
} catch (IOException | XMLStreamException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
After doing this i can see the nodes in the neo4j browser. But after importing some of the spatial procedures doesn't work anymore. For example:
call spatial.layers
It just returns this error:
Failed to invoke procedure `spatial.layers`: Caused by: java.lang.NoClassDefFoundError: org/geotools/filter/text/cql2/CQLException
Some other procedures are still working like
call spatial.layerTypes
What is the problem here? When trying to import the OSM directly with cyper i used:
call spatial.importOSM("C:/Users/Steffen/workspaceEclipse/NDBS Neo4J/osm/map.osm")
But this leads to an other error
Failed to invoke procedure `spatial.importOSM`: Caused by: java.util.NoSuchElementException: More than one element in org.neo4j.kernel.impl.coreapi.LegacyIndexProxy$1@7ce40edf. First element is 'Node[50]' and the second element is 'Node[1206]'
Some infos: Windows 10 64 bit, neo4j 3.2.1, neo4j-spatial-0.24-neo4j-3.1.1-server-plugin