[GIS] How to find start and end points from a road layer

postgis

I have a shapefile with geometries MultiLineString and Point. I have loaded the shapefile into PostGIS. From that table I cannot find any (lon,lat) except geometrical values with some SRID,…. columns.

How about knowing of nodes, edges, start point and end point for a particular layer that has above geometries; and to create a start point and end point from a shape file

I have tried few shapefiles, finally stopped with

Error:Start vertex was not found. 

Best Answer

for a linesttring you can use these funcs. more info here.

ST_EndPoint — Returns the last point of a LINESTRING geometry as a POINT.

ST_StartPoint — Returns the first point of a LINESTRING geometry as a POINT.

ST_DumpPoints — Returns a set of geometry_dump (geom,path) rows of all points that make up a geometry.

Example:

SELECT ST_AsEWKT(ST_EndPoint('LINESTRING(1 1 2, 1 2 3, 0 0 5)'));
  st_asewkt
--------------
 POINT(0 0 5)
(1 row)

i hope it helps you....