[postgis-devel] Re: New version for LRS functions

Christoph Spoerri cspoerri at cavtel.net
Fri Nov 4 13:51:19 PST 2005

Thanks for the feedback.

with closet 'point' actually means it returns the measure of a point that is 
on the line. With 'closest' point, I mean the point (on the line = geom1) 
that is closest to the given point (geom2).

the lrs_getgeom() computes interpolation points (for start and end point) 
along the line and returns them as the end/start points of the new line.

See attachment for a graphical explanation.

Regarding the naming: I (obviously) prefer the current naming, but I see the 
reasons for renaming them. The reason I don't like the 'substring' is that 
the function returns a geometry and not a string. Which may be a bit 
confusing to users. What does the rest of you think about the naming of the 


On Friday 04 November 2005 11:33, strk at refractions.net wrote:
> A few comments on your functions, with integration in mind.
> > lrsgetmeasure(geom1, geom2):
> > 	returns the measure of the closet 'point' on geom1 from geom2
> >         geom1 must have a M value
> What do you mean by 'closest point' ? Would it be close in terms
> of measure or planar distance ?
> For planar distance I think this could be generalized with
> something like:
> 	M(closest_linevertex(line, point))
> or:
> 	M(closest_point(geom, point))
> > lrs_getgeom(geom, double):
> > 	returns a point along the LRS
> >       geom must be a LINESTRING or MULTILINESTRING with M values
> >       double is the measure along the geom for which you would like
> > 	a point returned, should be within the measure range of geom
> >
> > lrs_getgeom(geom, double1, double2):
> > 	return a new linestring along the LRS
> >         geom must be a LINESTRING or MULTILINESTRING with M values
> >         double1 is the start measure/point of the new linestring,
> > 	should be within the measure range of geom
> >         double2 is the end measure/point of the new linestring,
> > 	should be within the measure range of geom
> >         Note: if double1 or double2 are out of range, the LRS end
> > 	points are assumed and used instead
> Does these only check vertexes or compute interpolation between
> them ?
> Note that for the function returning linestring we already have
> in HEAD branch a line_substring(geometry, float8, float8) function.
> The floats are intended as fractions of length, but you might want
> to use a name similar to that for measure, like in:
> 	lrs_line_substring(geometry, float8, float8);
> 	lrs_line_point_at(geomtetry, float8);
> The line_point_at(geometry, float8) is currently missing, but
> we might add it.
> --strk;
> On Mon, Oct 31, 2005 at 10:46:23AM -0500, Christoph Spoerri wrote:
> > Good morning,
> >
> > i'm send you the new version of the LRS functions.
> >
> > Please note that I change the function names since the last version. It
> > was pointed out to me that the naming convention was a bit of and and
> > could be simplified (e.g. only a single function to get a new shape,
> > lrs_getgeom). Also, I used lrs_getgeom instaed of lrs_getshape since all
> > other functions refere to geometries and not shapes.
> >
> > I still didn't fix all the compile warnings, but that should hopefully
> > come soon.
> >
> > Please let me know if you find any bugs or other errors.
> >
> > thanks,
> > Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.png
Type: image/png
Size: 38708 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20051104/4dab306d/attachment.png>

More information about the postgis-devel mailing list