neo4j/spatial — pull request #105 by lookfwd (2013-07-25 19:22:31+00:00)
Title: Updated to use the latest BatchInserter and newEmbeddedDatabase()

It passes all the tests. That said it would be good if someone more experienced with neo4j spatial reviews it.

The example project from https://github.com/neo4j-india/neo4j-spatial-starters becomes:

import org.neo4j.gis.spatial.osm.OSMImporter;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.unsafe.batchinsert.BatchInserter;
import org.neo4j.unsafe.batchinsert.BatchInserters;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;

class SpatialOsmImport {
public static void main(String[] args)
{
try{
OSMImporter importer = new OSMImporter("India");
BatchInserter batchinserter = BatchInserters.inserter(args[1]);
importer.importFile(batchinserter, args[0], false);
batchinserter.shutdown();
GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(args[1]);
importer.reIndex(db, 10000);
db.shutdown();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}