Skip to main content
10 votes
Accepted

Writing out PointM shapefiles from QGIS

You can use "Processing Toolbox > Vector Geometry > Drop M/Z Values" tool.
Kadir Şahbaz's user avatar
9 votes
Accepted

How to access shapefile m-values with pyqgis?

Assuming you have a QgsGeometry object (eg the geometry returned when calling QgsFeature.geometry()), you can access it's raw geometry info by calling QgsGeometry.geometry() in QGIS 2.x or QgsGeometry....
ndawson's user avatar
  • 27.8k
9 votes
Accepted

Randomly offset duplicate points along linestring X meters using PostGIS

Update duplicates with a randomly interpolated point on the nearest line, e.g.: UPDATE <points> AS pt SET geom = ( SELECT ST_LineInterpolatePoint( ln.geom, -- ...
geozelot's user avatar
  • 30.6k
9 votes

Randomly offset duplicate points along linestring X meters using PostGIS

Group by geometry to find the duplicates, join the line to the points, interpolate the duplicates at a random distance along the line, union with the non duplicates: --Find the duplicates by grouping ...
Bera's user avatar
  • 76.3k
8 votes

Find order of points along polyline

If your route (polyline) layer's name is Route1 which has an id field (fid), and the point layer is Bears like below example. Open the attribute table of the Bears (point) layer and start the Field ...
Kazuhito's user avatar
  • 31.1k
7 votes

Extracting nodes with M-values for Linear referencing in QGIS

With QGIS 3.0 or newer this task is trivial. In the "Processing Toolbox" (Open with ctrl+alt+t or Processing -> Toolbox) search for "Extract vertices" and run that algorithm. ...
TJR's user avatar
  • 1,612
7 votes
Accepted

Plotting points along line at specific distance value using PyQGIS

It's kind of easy to do with a Python script that you can run from the editor of the QGIS's Python Console. First, you need to get your line layer and get the feature inside. Then, you need to loop on ...
YoLecomte's user avatar
  • 3,340
7 votes

Writing out PointM shapefiles from QGIS

As workaround, you could use a virtual layer, specifying a query similar to the following: SELECT id, MakePointM(x, y, attribute) AS geometry FROM PointZM_layer; And then export the virtual layer as ...
RafDouglas C. Tommasi's user avatar
6 votes
Accepted

Extracting nodes with M-values for Linear referencing in QGIS

From what I can find there doesn't appear to be an existing solution for this exact situation, but I still wanted to be able to do this in QGIS, so I took the plunge into python scripting. A guide ...
TJR's user avatar
  • 1,612
6 votes
Accepted

Are there any working examples of ogrlineref?

You can find sample data for ogrlineref at gdal test data: https://github.com/OSGeo/gdal/tree/master/autotest/utilities/data - path.shp and mstones.shp An example of ogrlineref using is in test case: ...
Dmitry Baryshnikov's user avatar
5 votes

What is M-aware polyline in ArcGIS Desktop?

An m-aware polyline has the ability to store m-values (in addition to x and y values). M-values are 'measurement' values, for example the distance along a given line. They are often used in linear ...
Matt Goodman's user avatar
5 votes
Accepted

PostGIS ST_LocateAlong returns incorrect interpolated Points

If you look at the WKT in a text editor, and you reformat it to have one vertex per line, it becomes pretty obvious where the interpolated values are calculated: SELECT ST_AsText(ST_LocateAlong( '...
Vince's user avatar
  • 20.2k
4 votes

What is M-aware polyline in ArcGIS Desktop?

The M in M-aware stand for Measure and is another coordinate value like an X, Y or Z coordinate on each node. Measures are typically the relative linear distance of each vertex measured from the ...
Richard Fairhurst's user avatar
4 votes

Linear referencing using QGIS only

This is Python solution for the QGIS Python console. Just paste the code (after renaming "lines" to your line layer name) in the console. It creates points every 100m along every single line feature ...
Stefan's user avatar
  • 4,454
4 votes

Linear referencing to calculate maximum distance between points by group along line (river system) using ArcGIS Pro

LR will calculate distances along separate river segments. To apply it you need "long" rivers starting at multiple upstream points, ending at outlet(s). If you are capable of producing geometric ...
FelixIP's user avatar
  • 23.3k
4 votes
Accepted

AttributeError: DescribeData: Method shapeType does not exist

You are almost there. As I mentioned in my comment, shapeType is a Describe property disclosed if the Describe.dataType is FeatureClass. Since you are working with a map and enumerating map layers, ...
fatih_dur's user avatar
  • 5,003
4 votes

PostGIS ST_LocateAlong returns incorrect interpolated Points

Here's a simpler example of the behaviour: SELECT ST_AsText( ST_LocateAlong( 'MULTILINESTRINGM( ( 0 0 0, 2 2 2) ,(-1 0 -1, 1 0 1) ,( 8 8 8, 9 ...
Zegarek's user avatar
  • 722
3 votes

Find Point Along Line at Certain Distance

In QGIS 2.18 was introduced a new feature that does the job you seek. The function is line_interpolate_point (geometry, distance), to be used in calcolatatore QGIS fields. STEP 1: Create a new field '...
pigreco's user avatar
  • 4,510
3 votes
Accepted

Working around MeasureOnLine function not being in ArcPy at earlier version?

I suspect that you are trying to use the MeasureOnLine function to perform some sort of linear referencing. Without access to that function due to your version (ArcGIS 10.1) being earlier than its ...
PolyGeo's user avatar
  • 65.3k
3 votes

How to place labels at regular intervals orthogonally to a line feature?

I got something close using QGIS 2.16. It needs some additional work / experimentation, but hopefully give you a starting point. I'm not sure how best to add an offset, but you might be able to hack ...
Steven Kay's user avatar
  • 20.5k
3 votes
Accepted

How to use the linear referencing plugin from QGIS with postGIS data?

TESTED USING THE LRS PLUGIN VER 0.3.6 Your problem may be that you need to update your plugin/QGIS version This is from the changelog of the LRS plugin: changelog: 0.3.6 - Fixed issue #6 (PostGIS ...
jbalk's user avatar
  • 7,582
3 votes
Accepted

Splitting line into segments of different length with ArcGIS Desktop?

I would say you are almost there with one difference. Don't think of them as cut points think of them as reaches. So add a FROM and TO distance field to your dBase table so it contains data as below: ...
Hornbydd's user avatar
  • 44.2k
3 votes

Trying to understand QGIS LRS plugin - How to implement?

The first question you have to ask yourself is "Is linear referencing the solution I need to solve my downstream problems?" Road networks are notorious for being difficult linear networks to ...
nr_aus's user avatar
  • 3,596
3 votes

How to create a line feature which contains the overlying polygon attributes?

Assuming you have a proper line network dataset, particularly direction of traverse is correct: Copy your lines as M values are enabled (if the SHAPE is not Polyline M, see https://desktop.arcgis....
fatih_dur's user avatar
  • 5,003
3 votes

ST_3DIntersection with LINESTRING M and POLYGON M

PostGIS has a small but powerful set of Linear Referencing functions to work with trajectories, utilizing the full potential of M values: interpolating an isolated event (a MULTIPOINT M, or ...
geozelot's user avatar
  • 30.6k
3 votes

Ordering points along polyline using line_locate_point function in QGIS

You may try using the "Add autoincremental field" geoalgorithm. Let's assume there are two layers: a point 'points' and a polyline 'poly_test' respectively, see image below. Open the "...
Taras's user avatar
  • 33.7k
3 votes
Accepted

How to request GeoJSON standard be enhanced to support M-values

Enhancements to geospatial JSON format will likely happen through the "OGC Features and Geometries JSON" https://github.com/opengeospatial/ogc-feat-geo-json. The new standard is in a draft ...
user30184's user avatar
  • 68k
3 votes
Accepted

QGIS - Find point position on line (lengthwise)

You can use the field calculator on the POINT_Layer. I don't think there is a one-click tool. line_locate_point(aggregate('YOUR_LINE_LAYER_NAME','collect',$geometry),$geometry) EDIT - Based on ...
Xeppit's user avatar
  • 1,365
2 votes
Accepted

Counting points (accidents) per segment of roads layer?

Since your accidents are snapped to your lines, if your lines are already segmented the way you want and you don't mind the accidents being counted on two or more segments when they fall exactly on an ...
Richard Fairhurst's user avatar
2 votes
Accepted

ST_LocateAlong interpolation: difference between PostGIS and Spatialite

Ran across the same issue and was delighted to find spatialite has bridged this gap with ST_TrajectoryInterpolatePoint (currently misspelled as ST_TrajectoryInterpolarePoint in the doc at gaia). ...
Phil Penn's user avatar
  • 260

Only top scored, non community-wiki answers of a minimum length are eligible