spatial.cql

Procedure

Finds all geometry nodes in the given layer that matches the given CQL

Signature

spatial.cql(layerName :: STRING, ecql :: STRING) :: (node :: NODE)

Input parameters

Name Type Default Description

layerName

STRING

null

The name of the layer

ecql

STRING

null

The [ECQL](https://docs.geoserver.org/latest/en/user/filter/ecql_reference.html) to find / filter nodes of the layer

Output parameters

Name Type Description

node

NODE

Examples

Find geometries using CQL

CALL spatial.addWKTLayer('geom','wkt') YIELD node
Table 1. Result
node
(:SpatialLayer {
    geomencoder: "org.neo4j.gis.spatial.WKTGeometryEncoder",
    geomencoder_config: "wkt",
    index_class: "org.neo4j.gis.spatial.index.LayerRTreeIndex",
    layer: "geom",
    layer_class: "org.neo4j.gis.spatial.EditableLayerImpl"
})

Create and add nodes with different coordinates

CREATE (n1:Node {wkt: 'POINT(15.2 60.1)', name: 'point1'})
CREATE (n2:Node {wkt: 'POINT(25.2 30.1)', name: 'point2'})
WITH n1, n2
CALL spatial.addNode('geom', n1) YIELD node as added1
WITH n2, added1
CALL spatial.addNode('geom', n2) YIELD node as added2
RETURN added1, added2
CALL spatial.cql('geom', 'name = \'point1\'') YIELD node RETURN node.name as name
Table 2. Result
name

point1