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

Paul Ramsey pramsey at refractions.net
Fri Aug 13 07:05:22 PDT 2004


You have too many (()) in your LINESTRING. Try.

> select  
> line_interpolate_point(GeometryFromText('LINESTRING(-51.4933730667105  
> -29.1662071724963,-51.4933280072013 -29.1666495955688)'),0.5);


On Friday, August 13, 2004, at 06:36 AM, 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
>
> How can I solve this?
>
> Regards,
> Alex
>
>> -----Mensagem original-----
>> De: postgis-users-bounces at postgis.refractions.net
>> [mailto:postgis-users-bounces at postgis.refractions.net]Em nome de Paul
>> Ramsey
>> Enviada em: quinta-feira, 12 de agosto de 2004 19:22
>> Para: PostGIS Users Discussion
>> Assunto: Re: [postgis-users] Point (x%) on a linestring
>>
>>
>> One of the many under documented jewels...
>>
>>    line_interpolate_point(geometry,float8)
>>
>> Alex Martins Daher wrote:
>>
>>> Hi all!
>>>
>>> I have a multilinestring like this one:
>>> MULTILINESTRING((-51.4933730667105
>> -29.1662071724963,-51.4933280072013 -29.1666495955688))
>>>
>>> And I want to know what is the point on the linestring that
>> is x% from the start.
>>> For instance, the centroid of that geometry is 50% from the start.
>>>
>>> Is there any function that can do that: I pass the geometry
>> anda the percentage and returns
>>> the point (geometry) that is x% from the start.
>>>
>>> I took a look at that docs but couldn't find anything.
>>>
>>> Regards,
>>> Alex
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
      Paul Ramsey
      Refractions Research
      Email: pramsey at refractions.net
      Phone: (250) 885-0632




More information about the postgis-users mailing list