QGIS Python Plugins Repository

pgChainage Plugin icon

(5) votes 

plugin for chainage linestrings of a table directly in PostgreSQL/PostGIS

This plugin converts a layer of line strings into a chain of points. The main work takes place directly in the PostgreSQL-/PostGIS-database, i.e. big tables have not to be imported into QGIS before and during processing.
Usage: Fill in the parameters for establishing a connection to the database. The DBMS has to be PostgreSQL, and the extension PostGIS must created before starting the processing.
Press the "connect to database"-button. A Message Bar above the map window will appear and tells the user, whether a connection could established or not.
Choose the table (and schema), which should be used for the chainage. The table must have a geometry column of the type LINESTRING. Then fill in the other fields. The CRS can differ from the CRS of the choosed geometry. The PlugIn calls the PostGIS-function ST_Transform(...) to project the geometries into the specified CRS; to state the CRS of the geometry-column is not necessary. It is recommended to specify a metric CRS. If the checkbox "calculate last point/last substring of lines" is checked, the endpoint and/or the last substring of each line will be calculated by ignoring the specified equidistance (just for the end-geometries) and inserted into the database.
Their are three buttons to start the processing. The button "create points" just creates points along each line. The button "create substrings" just creates lines with the same specified distance from the input layer. The button "create points & substrings" starts both processings.
Important: The plugin has been developed and tested using PostgreSQL 10 and PostGIS 2.4. Maybe it will not work with older versions of the named products, e.g. the chainage is realized by using the PostGIS-function ST_LineInterpolatePoint, which has the name ST_line_interpolate_point e.g. in PostGIS 2.1.
Source of the icon: Webalys - Kameleon Icons (http://www.kameleon.pics)

Christoph Jung
Plugin home page
Browse and report bugs
Code repository
Latest stable version
Version Experimental Minimum QGIS version Downloads Uploaded by Date
2.0.0 no 3.0.0 4387 jagodki 2018-05-20T08:43:00.193150+00:00
1.1.0 no 2.0.0 1151 jagodki 2018-03-13T16:57:22.601559+00:00
1.0 no 2.0.0 650 jagodki 2018-02-20T04:32:00.630107+00:00

Sustaining Members