[postgis-users] Midpoint function?

Pradeep B V pradeepbv at gmail.com
Thu Jun 21 07:34:37 PDT 2007


On 6/21/07, Rodrigo Martín LÓPEZ GREGORIO <
rodrigomartin at lopezgregorio.com.ar> wrote:
>
> As Nicolas says you should use:
>
> select line_interpolate_point(LineMerge(the_geom),0.5).
>
> you can try this and see if the point is the one you want:


It works fine.

and here is the proof.

select distance(startpoint(the_geom),
line_interpolate_point(LineMerge(the_geom),0.5)) as stdist,
distance(endpoint(the_geom), line_interpolate_point(LineMerge(the_geom),0.5))
as endist from testdataset limit 1;

                    stdist         |       enddist
              ----------------------+----------------------
 0.000737003466840363 | 0.000737003466840363

Thanks Rodrigo/Nicolas.

 - Pradeep B V
www.btis.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070621/63a9b7ee/attachment.html>


More information about the postgis-users mailing list