Opened 8 years ago
Closed 7 years ago
#3564 closed enhancement (fixed)
Interpolate points along a line: add a fixed distance version
Reported by: | pcav | Owned by: | dbaston |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.5.0 |
Component: | postgis | Version: | 2.2.x |
Keywords: | Cc: |
Description
Currently, ST_LineInterpolatePoint accepts a proportion as a parameter. Often users want them at fixed intervals (e.g. every km). It would be useful to have then a different version of this command, accepting a fixed distance and create a variable number of points according to it.
Change History (10)
comment:1 by , 8 years ago
comment:3 by , 8 years ago
Daniel: it returns points interpolated along a line at fixed consecutive distance. As a multipoint (I guess), and won't necessarely include the original line vertices.
comment:5 by , 8 years ago
Milestone: | PostGIS 2.2.3 → PostGIS 2.4.0 |
---|
comment:6 by , 7 years ago
are we still planning to have this for 2.4, if not it should be done within the next week. If not push to future.
comment:7 by , 7 years ago
Milestone: | PostGIS 2.4.0 → PostGIS 2.5.0 |
---|
comment:8 by , 7 years ago
What about a function ST_LineInterpolatePoints
that is the same as ST_LineInterpolatePoint
, except that it repeats the proportion as many times as possible and returns a MultiPoint.
So, where ST_LineInterpolatePoint(geom, 0.2)
would return a single point, ST_LineInterpolatePoints(geom, 0.2)
would return points at and 0.2, 0.4, 0.6, 0.8, 1.0. ST_LineInterpolatePoints(geom, 0.3)
would return points at 0.3, 0.6, 0.9.
If a user wants to specify a distance rather than a proportion, it would be trivial to do ST_LineInterpolatePoints(geom, dist / ST_Length(geom))
comment:9 by , 7 years ago
Owner: | changed from | to
---|
It would need a good name, how about ST_InterpolatePointsAtDistance ?