|
From: Jody G. <jod...@gm...> - 2011-08-09 05:27:45
|
Hi Levi: Here is the email I was referring to with respect to "dissolve"... Andrea 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. The unsupported gt-process-feature model is the correct home for this if you want to work on it; although I have not created a JIRA issue or anything. Jody |