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

It would be best to add this capability to the CascadedUnion class.  That should be relatively easy to do.

On Thu, Jun 23, 2016 at 12:32 PM, Tom Moore <moortom@xxxxxxxxx> wrote:
I had a thought here, not sure what it is worth. 

Is there somewhere in the internals of the buffer or union operations that it has the details of the association between input and result polygons?  If so, would if be possible to modify the process so that it would make an array of arrays of the UserData objects that comprised each part, and then set this as the UserData object of the resulting MultiPolygon?

If this is the case, I would expect it to be the most efficient and robust method.

I would be willing to attempt to code up this approach if it is feasible and deemed desirable, and if someone could point me to the right place in the code base to start looking around.

On Thu, Jun 23, 2016 at 12:07 PM, Martin Davis <mtnclimb@xxxxxxxxx> wrote:
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



_______________________________________________
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



_______________________________________________
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