[postgis-users] Finding the center of a street

Nelson Correia nelsonwc7 at hotmail.com
Sun Jul 19 10:41:02 PDT 2009


Hi Luigi,


The problem is that when I have T junctions, I have more than one segment (i.e. linestring) and even if I use ST_LineMerge, I get a set of linestrings (instead of only one), which I can't pass to ST_line_interpolate_point (the function I'm using to calculate the middle point).


For the use case I have, the calculated middle point must be part of the street (i.e. part of the multilinestring that I have initially).






From: luigi.cardeles at gmail.com
Date: Sat, 18 Jul 2009 01:51:58 -0300
To: postgis-users at postgis.refractions.net
Subject: Re: [postgis-users] Finding the center of a street

Hi Nelson,

i don't understand the problem with the T junctions but with the non-contiguous sections you could create a contiguous linestring and use that to find the middle point but you may get middle points that don't intersects with then. Is this a problem?

[]'sLuigi Castro Cardeles

2009/7/16 Nelson Correia <nelsonwc7 at hotmail.com>

Hi all,
I have a database of streets, wich is composed by multilinestring segments. I want to find the centre of the street (i.e. the point that is in the middle and contained in the street geometry) and not the centroid (which may not be in the street).
I can do this with linemerge (to obtain a linestring instead of a multilinestring) and then use the st_line_interpolate_point to calculate the middle point.
The problem is with streets that have T junctions in the middle or that are composed by non-contiguous sections, for what I can't find a way to obtain a linestring to calculate the middle point.
Anyone had a similar problem or know a solution to this problem?
Thanks in advance!

check out the rest of the Windows Live™. More than mail–Windows Live™ goes way beyond your inbox. More than messages
postgis-users mailing list
postgis-users at postgis.refractions.net

More than messages–check out the rest of the Windows Live™.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090719/7b6aa984/attachment.html>

More information about the postgis-users mailing list