[postgis-users] Midpoint function?

Rodrigo Martín LÓPEZ GREGORIO rodrigomartin at lopezgregorio.com.ar
Thu Jun 21 07:10:33 PDT 2007


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:

select line_interpolate_point(LineMerge(GeomFromText('MULTILINESTRING((
77.6177520751953 12.8762445449829,77.6180953979492 12.8769254684448,
77.6182174682617 12.8771991729736,77.6182708740234 12.877254486084,
77.6183853149414 12.877293586731,77.6186065673828 12.8773241043091 ,
77.6188049316406 12.8773641586304,77.6189193725586 12.8774423599243,
77.6190490722656 12.8775682449341,77.6192092895508 12.8777647018433,
77.6192932128906 12.8778190612793,77.6194458007812 12.8778419494629,
77.6196899414062 12.8778429031372,77.6200714111328 12.8777952194214,
77.6207504272461 12.8777093887329,77.6210403442383 12.8776388168335,
77.6211013793945 12.8775682449341,77.6212387084961 12.8774185180664,
77.6214828491211
12.87730884552   ,77.6220855712891 12.87717628479,   77.6224746704102
12.877121925354,77.6232223510742 12.8771133422852,77.6239013671875
12.8770341873169,77.6239318847656 12.8770303726196))')),0.5)

Rodrigo

On 6/21/07, Nicolas Ribot <nicky666 at gmail.com> wrote:
>
> > which is actually a continuous line. The only reason this got in as a
> > Multilinestring is because the  the original shapefile provided to
> > shp2pgsql  was having Multilinestrings as the default data type.
> >
>
> then you should reload your shapefile, using the -S switch to force
> creation of simple objects.
> Or else try using st_line_merge().
>
> Nicolas
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070621/0e2963ce/attachment.html>


More information about the postgis-users mailing list