[postgis-users] Finding the center of a street

Paragon Corporation lr at pcorp.us
Sun Jul 19 12:30:09 PDT 2009


Nelson,
 
I wonder if it would help to calculate the centroid of the multilinestring
and then project that centroid unto the multiline where the distance between
the centroid and the line is the shortest (using combination of ST_Dump,
st_line_locate_point and st_line_interpolate_point)
 
Haven't really thought much what the query would look like, but just a
thought.
 
So basically
1) For the line mergeable ones do what you are doing
2) For the non-mergeable ones do a 
   a) Take centroid
b) ST_Dump MULTILINESTRING
c) Choose the linestring with the min(ST_Distance(centroid,line)) for that
MULTILINESTRING
  d) ST_Line_Interpolate_Point(line, ST_Line_Locate_Point(line, centroid))
 
Leo

  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Nelson
Correia
Sent: Sunday, July 19, 2009 1:41 PM
To: postgis-users at postgis.refractions.net
Subject: Re: [postgis-users] Finding the center of a street


 
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).
 
Thanks,
 
Nelson

 

  _____  

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?

[]'s
Luigi 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!
 
Nelson



  _____  

check out the rest of the Windows LiveT. More than mail-Windows LiveT goes
way beyond your inbox. More than
<http://www.microsoft.com/windows/windowslive/> messages

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users





  _____  

check out the rest of the Windows LiveT. More than mail-Windows LiveT goes
way beyond your inbox. More than messages
<http://www.microsoft.com/windows/windowslive/>  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090719/6eb396cc/attachment.html>


More information about the postgis-users mailing list