On Tue, Aug 2, 2011 at 1:43 PM, Emmanuel Blondel
<[email protected]> wrote:
> Dear all,
>
> I created a feature collection adding features from different layers
> (~append). By the way, I would like now to process a geometry UNION
> according to one attribute which actually can be duplicated after creating
> the feature collection. Do you know if it is possible? using JTS? a Process?
>
> I thank you in advance for your advice/ giving to me orientations,

We don't have such process, in the past I've seen this being called "dissolve".
Should not be too hard to code if your data source can do ordering:
sort by the attribute you want to dissolve on, collect the geometries until
the attribute changes, union using JTS, generate the output feature
with the resulting geometry and the disolving attribute as the sole
other attribute.

In case no sorting is supported, well, you have to choose between
loading everything in memory and doing the sorting there,
or load a feature and make a separate query for all the ones that
might touch it, hopefully few, merge, query again for nearby features
(unions might result in a long chain) until you cannot find anymore
anything else to disolve.
And then keep the feature ids of everything that has already been
unioned to avoid processing it twice.

Hope this helps

Cheers
Andrea

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to