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 strk, 8 years ago

It would need a good name, how about ST_InterpolatePointsAtDistance ?

comment:2 by dbaston, 8 years ago

Is this different from ST_Segmentize?

comment:3 by strk, 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:4 by strk, 8 years ago

ST_InterpolatedPoints would seem a good name to me.

comment:5 by robe, 8 years ago

Milestone: PostGIS 2.2.3PostGIS 2.4.0

comment:6 by robe, 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 robe, 7 years ago

Milestone: PostGIS 2.4.0PostGIS 2.5.0

comment:8 by dbaston, 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 dbaston, 7 years ago

Owner: changed from pramsey to dbaston

comment:10 by dbaston, 7 years ago

Resolution: fixed
Status: newclosed

In 15913:

Add ST_LineInterpolatePoints

Closes #3564

Note: See TracTickets for help on using tickets.