[postgis-users] linestring aggregation

Sean seanasy at gmail.com
Tue Dec 29 06:33:53 PST 2009


Sounds like ST_Touches:
http://postgis.refractions.net/docs/ST_Touches.html


  Sean

On Dec 29, 5:39 am, "Nicolas Gillet - MARKET-IP"
<nicolas.gil... at market-ip.com> wrote:
> Hello
>
> I am trying to aggregate linestrings together based on their attributes and
> the fact that they are touching each other.
>
> Therefore I found out how to write a very basic aggregate function :
>
>    CREATE AGGREGATE geometry_sum (
>
>                 SFUNC = st_union,
>
>                 BASETYPE = geometry,
>
>                 STYPE = geometry);
>
> I can now aggregate my linestrings grouped by their names, importance, and
> so on but . I have trouble to group them by the fact that they are touching
> each other.
>
> e.g.
>
> linestring A, B and C have the same attributes but only A and B are touching
> each other.
>
> I would like as a result A+B in one record, and C in a second record.
>
> Does someone have any tips to share ?
>
> Thank you,
>
> Nicolas
>
> _______________________________________________
> postgis-users mailing list
> postgis-us... at postgis.refractions.nethttp://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list