Skip to main content

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

1) Can't entirely rule out failure situations due to precision issues, but they should be very rare.

2) I can't think of a dramatically better way.  A slight variation would improve performance and robustness: Use an interior point and a Point-in-Polygon test instead of contains. 

A spatial index can be used to make the performance O(m log n). 

On Thu, Jun 23, 2016 at 7:10 AM, Tom Moore <moortom@xxxxxxxxx> wrote:
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



_______________________________________________
jts-dev mailing list
jts-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.locationtech.org/mailman/listinfo/jts-dev



Back to the top