Hello Thanks for the answer,
I knew about ST_touches(geometry, geometry) function. But I don't know how to use it in my aggregate query to group only the records that are touching each other SELECT name, code, geometry_sum(the_geom) FROM roads GROUP BY name, code, st_touches(???, the_geom) Or something like that (geometry_sum being my aggregate function). Any idea ? Nicolas -----Message d'origine----- De : [email protected] [mailto:[email protected]] De la part de Sean Envoyé : mardi 29 décembre 2009 15:34 À : [email protected] Objet : Re: [postgis-users] linestring aggregation Sounds like ST_Touches: http://postgis.refractions.net/docs/ST_Touches.html Sean On Dec 29, 5:39 am, "Nicolas Gillet - MARKET-IP" <[email protected]> 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 > [email protected]http://postgis.refractions.net/mailman/ listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
