[postgis-users] Merge lines

Martin Fafard martin.fafard at geoprojection.com
Wed Oct 7 03:52:52 PDT 2009


Stanley

Thank you
But your query merge two contiguous lines but not 3 or more contiguous 
lines...

Martin

Sufficool, Stanley a écrit :
> Does this look correct?
>
> select st_linemerge(st_collect(cs1.the_geom))
> from (
> 	select the_geom, st_startpoint(cs_s.the_geom) as linepoint
> 	from mylinetable cs_s
> 	UNION ALL 
> 	select the_geom, st_endpoint(cs_e.the_geom) as linepoint
> 	from mylinetable cs_e
>
> ) as cs1
> group by linepoint
> having count(*) = 2
>
>
>   
>> -----Original Message-----
>> From: postgis-users-bounces at postgis.refractions.net 
>> [mailto:postgis-users-bounces at postgis.refractions.net] On 
>> Behalf Of Martin Fafard
>> Sent: Tuesday, October 06, 2009 11:21 AM
>> To: PostGIS Users Discussion
>> Subject: [postgis-users] Merge lines
>>
>>
>> Hi
>>
>> Is there a way to merge lines that are contiguous but stop 
>> merging at an 
>> intersection?
>> I have join an image.
>> Thank you
>>
>> Martin F
>>
>>     
>> ------------------------------------------------------------------------
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com 
>> Version: 8.5.420 / Virus Database: 270.14.4/2417 - Release Date: 10/06/09 06:50:00
>>
>>     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20091007/6cf941de/attachment.html>


More information about the postgis-users mailing list