Package org.neo4j.gis.spatial.osm

Examples of org.neo4j.gis.spatial.osm.OSMImporter.importFile()


  private void importMapOSM() throws Exception {
    // START SNIPPET: importOsm
    OSMImporter importer = new OSMImporter("map.osm");
    importer.setCharset(Charset.forName("UTF-8"));
    BatchInserter batchInserter = BatchInserters.inserter(databasePath);
    importer.importFile(batchInserter, "map.osm", false);
    batchInserter.shutdown();

    GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(databasePath);
    importer.reIndex(db);
    db.shutdown();
View Full Code Here


        String osmPath = "./" + layerName;
        System.out.println( "\n=== Loading layer " + layerName + " from "
                            + osmPath + " ===" );
        OSMImporter importer = new OSMImporter( layerName );
        importer.setCharset( Charset.forName( "UTF-8" ) );
        importer.importFile( db, osmPath );
        importer.reIndex( db, commitInterval );
    }

    @Before
    public void setUp()
View Full Code Here

        System.out.println("\n=== Loading layer " + layerName + " from " + osmPath + " ===");
        reActivateDatabase(false, useBatch, false);
        OSMImporter importer = new OSMImporter(layerName);
    importer.setCharset(Charset.forName("UTF-8"));
        if (useBatch) {
          importer.importFile(getBatchInserter(), osmPath);
          reActivateDatabase(false, false, false);
        } else {
            importer.importFile(graphDb(), osmPath);
            reActivateDatabase(false, false, false);
        }
View Full Code Here

    importer.setCharset(Charset.forName("UTF-8"));
        if (useBatch) {
          importer.importFile(getBatchInserter(), osmPath);
          reActivateDatabase(false, false, false);
        } else {
            importer.importFile(graphDb(), osmPath);
            reActivateDatabase(false, false, false);
        }
        importer.reIndex(graphDb(), commitInterval);
    }
View Full Code Here

    String osmPath = layerName;
    System.out.println("\n=== Loading layer " + layerName + " from " + osmPath + " ===");
    reActivateDatabase(false, true, false);
    OSMImporter importer = new OSMImporter(layerName);
    importer.setCharset(Charset.forName("UTF-8"));
    importer.importFile(getBatchInserter(), osmPath, false);
    reActivateDatabase(false, false, false);
    importer.reIndex(graphDb(), commitInterval);
  }

  private void loadTestShpData(String layerName, int commitInterval) throws ShapefileException, FileNotFoundException,
View Full Code Here

    String osmPath = layerName;
    System.out.println("\n=== Loading layer " + layerName + " from " + osmPath + " ===");
    reActivateDatabase(false, true, false);
    OSMImporter importer = new OSMImporter(layerName);
    importer.setCharset(Charset.forName("UTF-8"));
    importer.importFile(getBatchInserter(), osmPath);
    reActivateDatabase(false, false, false);
    importer.reIndex(graphDb(), commitInterval);
  }

}
View Full Code Here

    OSMImporter importer = new OSMImporter(layerName, new ConsoleListener(), makeFilterEnvelope());
    importer.setCharset(Charset.forName("UTF-8"));
        BatchInserter batchInserter = BatchInserters.inserter(dbPath, Neo4jTestCase.LARGE_CONFIG);
        //GraphDatabaseService graphDb = batchInserter.getGraphDbService();
    //importer.importFile(graphDb, osmPath, false, 10000, true);
    importer.importFile(batchInserter, osmPath, false);
    batchInserter.shutdown();
    //graphDb.shutdown();
    // Weird hack to force GC on large loads
    long start = System.currentTimeMillis();
    if (System.currentTimeMillis() - start > 300000) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.