Two additional options, if you want to expand beyond QGIS:
In Spatialite there are the functions ST_StartPoint() and ST_EndPoint(). (Same in PostGIS). So you could do a query such as:

SELECT line_id, ST_StartPoint(geometry) AS StartPoint, ST_EndPoint(geometry) AS EndPoint

FROM lines;

THis returns just the geometry (POINTS), so if you want them in a separate point table, you might do something like:

CREATE TABLE end_points (pkuid primary key  autoincrement, line_id integer);
SELECT AddGeometryColumn('end_points','geometry',<EPSG code of your CRS>, 'POINT,2);
INSERT INTO end_points (line_id, geometry) SELECT line_id, ST_StartPoint(geometry) FROM lines;
INSERT INTO end_points (line_id, geometry) SELECT line_id, ST_EndPoint(geometry) FROM lines;

Alternately, if you need the coordinates of the endpoints:

SELECT line_id, AsWKT(ST_StartPoint(geometry)), AsWKT(ST_EndPoint(geometry))
FROM lines;

And in addition you can also go to GRASS and use the v.to.points module with the "use=node" in order to create a point vector of nodes only from a GRASS line vector.

So there are several ways to choose...

On 07/01/2015 06:01 PM, CONTI Tonino wrote:
THANKS RICHARD.
DO I HAVE TO SELECT THE MAXIMUM AND MINIMUM VALUE FOR EACH ELEMENT AND DELETE THE OTHERS.
YOU KNOW IF THERE IS A FUNCTION SELECTING THE FIRST AND LAST POINT OF EACH ITEM?
TANKS
TONINO

Tonino Conti
Comune di Jesi
Sistema Informativo Territoriale
 Tel 0731538312 - fax 0731538513
[email protected]
www.comune.jesi.an.it/sit
________________________________________
Da: Richard McDonnell [[email protected]]
Inviato: martedì 30 giugno 2015 16.43
A: CONTI Tonino
Cc: [email protected]
Oggetto: Re: [Qgis-user] extracting the starting point and end point from a linear geometry

Tonino,
 From the toolbar...Vector, Geometry Tools, Extract Nodes.
This I think should help!

Regards,

Richard McDonnell

OPW - Ag féachaint don am atá le teacht - Ag caomhnú ón am atá thart
OPW - Looking to the future - Caring for the past

**********************************************************************
Email Disclaimer: http://www.opw.ie/en/disclaimer/
**********************************************************************
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

This mail was received via Mail-SeCure System.



_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to