Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jts-dev] Tracking which polygons got dissolved

I have a question about dissolving polygons. 

I am using the buffer(0) method to dissolve sets of polygons.  The polygons that I am dissolving may be discontiguous, and this may result in a multipolygon as output.  Obviously I know the complete set of polygons that were used as input to the dissolve.  What I am interested in is finding out which original polygons are associated with each of the parts of the resulting multipolygon.  The purpose of doing this is so that I can associate some of the attributes of the original polygons with the parts of the multipolygon. 

I suppose I could iterate through the original and resulting polygons use a 'contains' predicate to see which original parts fit within each result, but I worry that a) this m*n complexity is inefficient, and b) there may be some precision issue that may cause this to not work correctly in all cases.

My questions to the list are
- is there a reason that the brute force method might not work in all cases? 
- is there a better way?

Thanks,

Tom



Back to the top