RES: [postgis-users] Point (x%) on a linestring

Joe Sunday sunday at csh.rit.edu
Fri Aug 13 07:06:07 PDT 2004


On Fri, Aug 13, 2004 at 10:36:10AM -0300, Alex Martins Daher wrote:

> Hi!
> 
> Thanks for the tips, folks!
> 
> I tried to use the line_interpolate_point function, but:
> 
> geocoder=# select line_interpolate_point(GeometryFromText('MULTILINESTRING((-51.4933730667105 -29.1662071724963,-51.4933280072013 -29.1666495955688))'),0.5);
> ERROR:  line_interpolate_point: 1st arg isnt a line
> 
> My geometry is a multilinestring, but if a try to pick the same points as a linestring, I get this
> error:
> geocoder=# select line_interpolate_point(GeometryFromText('LINESTRING((-51.4933730667105 -29.1662071724963,-51.4933280072013 -29.1666495955688))'),0.5);
> ERROR:  couldnt parse object in GEOMETRY

jsunday=> select line_interpolate_point(GeometryFromText('LINESTRING(-51.4933730667105 -29.1662071724963,-51.4933280072013 -29.1666495955688)'),0.5);
              line_interpolate_point               
---------------------------------------------------
 SRID=0;POINT(-51.4933505369559 -29.1664283840325)
(1 row)

MULTILINESTRINGs contain multiple LINESTRINGs, so the notation
includes an extra set of parentheses.

--Joe
-- 
Joe Sunday <sunday at csh.rit.edu>  http://www.csh.rit.edu/~sunday/
Computer Science House, Rochester Inst. Of Technology



More information about the postgis-users mailing list