pgRouting Manual (2.3)

pgr_pointsToVids - Proposed

«  pgr_pointToEdgeNode - Proposed   ::   Contents   ::   pgr_labelGraph - Proposed  »

pgr_pointsToVids - Proposed


pgr_pointsToVids - Converts an array of point geometries into vertex ids.


These are proposed functions

  • They are not officially of the current release.
  • They likely will not be officially be part of the next release:
    • The functions might not make use of ANY-INTEGER and ANY-NUMERICAL
    • Name might change.
    • Signature might change.
    • Functionality might change.
    • pgTap tests might be missing.
    • Might need c/c++ coding.
    • May lack documentation.
    • Documentation if any might need to be rewritten.
    • Documentation examples might need to be automatically generated.
    • Might need a lot of feedback from the comunity.
    • Might depend on a proposed function of pgRouting
    • Might depend on a deprecated function of pgRouting


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))



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.


You need to check the results for any vids=-1 which indicates if failed to locate an edge.


  • Proposed in version 2.1.0


SELECT * FROM pgr_pointstovids(
    pgr_texttopoints('2,0;2,1;3,1;2,2', 0),
NOTICE:  Deperecated function: pgr_textToPoints
(1 row)

This example uses the Sample Data network.

See Also

Indices and tables

«  pgr_pointToEdgeNode - Proposed   ::   Contents   ::   pgr_labelGraph - Proposed  »