pgr_pointsToVids¶
Name¶
pgr_pointsToVids - Converts an array of point geometries into vertex ids.
Warning
This is a proposed function
- Is not officially in the release.
- Name could change.
- Signature could change.
- Needs testing.
- Functionality could change.
Synopsis¶
Given an array of point geometries and an edge table and a max search tol distance the function converts points into vertex ids using pgr_pointtoedgenode().
The function returns:
- integer[] - An array of vertex_id.
integer[] pgr_pointsToVids(pnts geometry[], edges text, tol float8 DEFAULT(0.01))
Description¶
Paramters
pnts: | geometry[] - An array of point geometries. |
---|---|
edges: | text - The edge table to be used for the conversion. |
tol: | float8 - The maximum search distance for locating the closest edge. |
Warning
You need to check the results for any vids=-1 which indicates if failed to locate an edge.
History
- Proposed in version 2.1.0
Examples¶
SELECT * FROM pgr_pointstovids(
pgr_texttopoints('2,0;2,1;3,1;2,2', 0),
'edge_table'
);
pgr_pointstovids
------------------
{1,2,3,5}
(1 row)
This example uses the Sample Data network.
See Also¶
- pgr_pointToEdgeNode - convert a point geometry to the closest vertex_id of an edge..
Indices and tables