Cargar un archivo .shp a Neo4j

Alguien me puede orientar como puedo cargar un archivo .shp a una base de datos de Neo4j.

Respuesta
1

El mismo manual de Neo4j especifica como importar archivos shape:

https://neo4j-contrib.github.io/spatial/#spatial-import-shapefile 

No he usado mucho este sistema, pero podría hacer unas pruebas para var que tal va; solo dime si te es de ayuda.

Importing a shapefile

Neo4j-Spatial includes a utility for importing ESRI Shapefile data. The ShapefileImporter will create a new Layer for each Shapefile imported, and will store each Geometry as WKB in a single property of a single node. All attributes of the Feature will be stored as additional properties of that node. For more information on how this is implemented, you can refer to the classes WKBGeometryEncoder. However, you do not need to know any of that to use this feature. Consider the simple code below.

GraphDatabaseService database = new EmbeddedGraphDatabase(databasePath);
try {
    ShapefileImporter importer = new ShapefileImporter(database);
    importer.importFile("shp/highway.shp", "highway", Charset.forName("UTF-8"));
} finally {
    database.shutdown();
}

This code will import the layer highway from the file shp/highway.shp which is included in the source distribution. This layer will be indexed using an RTree and can therefore be queried using any of the supported spatial operations. See the example on querying layers below.

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas