spatial.updateWKT
Procedure
Updates a node with the geometry defined by the given WKT, returns the node
Signature
spatial.updateWKT(layerName :: STRING, node :: NODE, geometry :: STRING) :: (node :: NODE)
Input parameters
Name | Type | Default | Description |
---|---|---|---|
layerName |
STRING |
null |
The name of the layer |
node |
NODE |
null |
The indexed node to update |
geometry |
STRING |
null |
The WKT to set on the given node |
Examples
Update a node’s WKT geometry
CALL spatial.addWKTLayer('update_layer', 'wkt') YIELD node
node |
---|
|
Create and add a node with initial WKT
CREATE (n:Node {wkt: 'POINT(15.2 60.1)', name: 'updatable_point'})
WITH n
CALL spatial.addNode('update_layer', n) YIELD node as added_node
RETURN n, added_node
Update the node’s WKT geometry
MATCH (n:Node {name: 'updatable_point'})
CALL spatial.updateWKT('update_layer', n, 'POINT(25.5 65.5)') YIELD node
RETURN node.wkt as wkt
wkt |
---|
POINT (25.5 65.5) |
Verify the updated geometry is indexed correctly
CALL spatial.withinDistance('update_layer', {longitude: 25.5, latitude: 65.5}, 1) YIELD node
RETURN node.name as name
name |
---|
updatable_point |