Neo4j Spatial Procedures

Neo4j Spatial is also packaged as a ZIP file that can be unzipped into the Neo4j Server $NEO4J_HOME/plugins directory. After restarting the server, you should be able to use the following procedure calls from the Cypher query language.

Table 1. Available Spatial Procedures
name description signature

"spatial.addLayer"

"Adds a new layer with the given type (see spatial.getAllLayerTypes) and configuration, returns the layer root node"

"spatial.addLayer(name :: STRING?, type :: STRING?, encoderConfig :: STRING?) :: (node :: NODE?)"

"spatial.addLayerWithEncoder"

"Adds a new layer with the given encoder class and configuration, returns the layer root node"

"spatial.addLayerWithEncoder(name :: STRING?, encoder :: STRING?, encoderConfig :: STRING?) :: (node :: NODE?)"

"spatial.addNode"

"Adds the given node to the layer, returns the geometry-node"

"spatial.addNode(layerName :: STRING?, node :: NODE?) :: (node :: NODE?)"

"spatial.addNodes"

"Adds the given nodes list to the layer, returns the count"

"spatial.addNodes(layerName :: STRING?, nodes :: LIST? OF NODE?) :: (count :: INTEGER?)"

"spatial.addPointLayer"

"Adds a new simple point layer, returns the layer root node"

"spatial.addPointLayer(name :: STRING?) :: (node :: NODE?)"

"spatial.addPointLayerWithConfig"

"Adds a new simple point layer with the given configuration, returns the layer root node"

"spatial.addPointLayerWithConfig(name :: STRING?, encoderConfig :: STRING?) :: (node :: NODE?)"

"spatial.addPointLayerXY"

"Adds a new simple point layer with the given properties for x and y coordinates, returns the layer root node"

"spatial.addPointLayerXY(name :: STRING?, xProperty :: STRING?, yProperty :: STRING?) :: (node :: NODE?)"

"spatial.addWKT"

"Adds the given WKT string to the layer, returns the created geometry node"

"spatial.addWKT(layerName :: STRING?, geometry :: STRING?) :: (node :: NODE?)"

"spatial.addWKTLayer"

"Adds a new WKT layer with the given node property to hold the WKT string, returns the layer root node"

"spatial.addWKTLayer(name :: STRING?, nodePropertyName :: STRING?) :: (node :: NODE?)"

"spatial.addWKTs"

"Adds the given WKT string list to the layer, returns the created geometry nodes"

"spatial.addWKTs(layerName :: STRING?, geometry :: LIST? OF STRING?) :: (node :: NODE?)"

"spatial.asExternalGeometry"

"Returns a geometry object as an external geometry type to be returned to a client"

"spatial.asExternalGeometry(geometry :: ANY?) :: (geometry :: ANY?)"

"spatial.asGeometry"

"Returns a geometry object as an internal cypher geometry type, to be passed to other procedures but not returned to a client"

"spatial.asGeometry(geometry :: ANY?) :: (geometry :: ANY?)"

"spatial.bbox"

"Finds all geometry nodes in the given layer within the lower left and upper right coordinates of a box"

"spatial.bbox(layerName :: STRING?, min :: ANY?, max :: ANY?) :: (node :: NODE?)"

"spatial.closest"

"Finds all geometry nodes in the layer within the distance to the given coordinate"

"spatial.closest(layerName :: STRING?, coordinate :: ANY?, distanceInKm :: FLOAT?) :: (node :: NODE?)"

"spatial.decodeGeometry"

"Returns a geometry of a layer node as internal cypher geometry type, to be passed to other procedures but not returned to a client"

"spatial.decodeGeometry(layerName :: STRING?, node :: NODE?) :: (geometry :: ANY?)"

"spatial.getFeatureAttributes"

"Returns feature attributes of the given layer"

"spatial.getFeatureAttributes(name :: STRING?) :: (name :: STRING?)"

"spatial.importOSM"

"Imports the provided osm-file from URI to a layer of the same name, returns the count of data added"

"spatial.importOSM(uri :: STRING?) :: (count :: INTEGER?)"

"spatial.importOSMToLayer"

"Imports the provided osm-file from URI to a layer, returns the count of data added"

"spatial.importOSMToLayer(layerName :: STRING?, uri :: STRING?) :: (count :: INTEGER?)"

"spatial.importShapefile"

"Imports the provided shape-file from URI to a layer of the same name, returns the count of data added"

"spatial.importShapefile(uri :: STRING?) :: (count :: INTEGER?)"

"spatial.importShapefileToLayer"

"Imports the provided shape-file from URI to the given layer, returns the count of data added"

"spatial.importShapefileToLayer(layerName :: STRING?, uri :: STRING?) :: (count :: INTEGER?)"

"spatial.intersects"

"Returns all geometry nodes that intersect the given geometry (shape, polygon) in the layer"

"spatial.intersects(layerName :: STRING?, geometry :: ANY?) :: (node :: NODE?)"

"spatial.layer"

"Returns the layer root node for the given layer name"

"spatial.layer(name :: STRING?) :: (node :: NODE?)"

"spatial.layerTypes"

"Returns the different registered layer types"

"spatial.layerTypes() :: (name :: STRING?, signature :: STRING?)"

"spatial.layers"

"Returns name, and details for all layers"

"spatial.layers() :: (name :: STRING?, signature :: STRING?)"

"spatial.procedures"

"Lists all spatial procedures with name and signature"

"spatial.procedures() :: (name :: STRING?, signature :: STRING?)"

"spatial.removeLayer"

"Removes the given layer"

"spatial.removeLayer(name :: STRING?) :: VOID"

"spatial.setFeatureAttributes"

"Sets the feature attributes of the given layer"

"spatial.setFeatureAttributes(name :: STRING?, attributeNames :: LIST? OF STRING?) :: (node :: NODE?)"

"spatial.updateFromWKT"

"Internal procedure, updates the geometry node with the given id with a new WKT string"

"spatial.updateFromWKT(layerName :: STRING?, geometry :: STRING?, geometryNodeId :: INTEGER?) :: (node :: NODE?)"

"spatial.withinDistance"

"Returns all geometry nodes and their ordered distance in the layer within the distance to the given coordinate"

"spatial.withinDistance(layerName :: STRING?, coordinate :: ANY?, distanceInKm :: FLOAT?) :: (node :: NODE?, distance :: FLOAT?)"