[postgis-devel] Re: New version for LRS functions
strk at refractions.net
strk at refractions.net
Wed Nov 16 02:30:40 PST 2005
On Fri, Nov 04, 2005 at 04:51:19PM -0500, Christoph Spoerri wrote:
> 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.
Ok. So interpolation happens.
In this case the equivalent lenght-based functions are:
line_locate_point(line, point)
return fraction of total line length where
the interior of line is closest to the given
point is located.
line_interpolate_point(line, measure)
return a point given fractino of total line length
in the range 0..1
line_substring(line, startmeasure, endmeasure)
return a SUBlineSTRING with start and end
points interpolated using given measures
(fractions of total length, range 0..1)
I dislike the line_interpolate_point() name as well, but it is
there since release 0.8.2.
Beside this, I think it would be nice to conform as the only
difference with your function is using M values rather then
fractions of total lenght.
BTW, one of your LRS creator function actually use the fraction
of length for setting the M value.
--strk;
>
> 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
> functions?
>
> Christoph
>
>
> 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
--
/"\ ASCII Ribbon Campaign
\ / Respect for open standards
X No HTML/RTF in email
/ \ No M$ Word docs in email
More information about the postgis-devel
mailing list