pgRouting Manual (2.2)

pgr_textToPoints

«  pgr_flipEdges   ::   Contents   ::   pgr_pointsToVids  »

pgr_textToPoints

Name

pgr_textToPoints - Converts a text string of the format “x,y;x,y;x,y;...” into and array of point geometries.

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 a text string of the format “x,y;x,y;x,y;...” and the srid to use, split the string and create and array point geometries.

The function returns:

integer pgr_textToPoints(pnts text, srid integer DEFAULT(4326))

Description

Paramters

pnts:text A text string of the format “x,y;x,y;x,y;...” where x is longitude and y is latitude if use values in lat-lon.
srid:integer The SRID to use when constructing the point geometry. If the paratmeter is absent it defaults to SRID:4326.

History

  • Proposed in version 2.1.0

Examples

SELECT ST_AsText(g) FROM 
    (SELECT unnest(pgr_texttopoints('2,0;2,1;3,1;2,2', 0)) AS g) AS foo;
 st_astext  
------------
 POINT(2 0)
 POINT(2 1)
 POINT(3 1)
 POINT(2 2)
(4 rows)

See Also

Indices and tables

«  pgr_flipEdges   ::   Contents   ::   pgr_pointsToVids  »