Skip to main content
Solved

Find polygons that overlap more than just a bit


tim_wood
Contributor
Forum|alt.badge.img+8

I have data for various sites and some sites have been digitised more than once and have overlapping polygons. However, these are not virtually identical polygons. They only partially overlap. I want to find the sites that have overlapping polygons. I tried using SpatialRelator with "Intersect", using the same data as both Requestor and Supplier but it picked up instances where one polygon was actually adjacent to another but probably just overlaps a tiny bit. This resulted in 3700 out of 3900 having more than 1 related candidate which doesn't really shortcut the process. "Contains" wouldn't work because not all overlapping polygons are completely contained.

Best answer by daveatsafe

Hi @tim_wood,

I have run into this problem before, and my solution was to use the AreaOnAreaOverlayer on the polygons. Use an AreaCalculator on the output, then a Tester to test for _overlaps > 1 and _area greater that your desired minimum area.

If the polygons have shapes that may result in an overlap being split into several pieces by the overlay, you can refine the process. Use a Counter on the input polygons to give them all a unique id, then create a list of the ids in the overlayer, using the Generate List setting. Between the overlayer and the AreaCalculator, sort the list by the id number with a ListSorter, then use a ListConcatenator to create a single attribute from the list. You now have a consistent id for each part of the polygon overlap. Aggregate these, grouping by the id, into a single multi-area before measuring the area and testing the overlaps.

View original
Did this help you find an answer to your question?

16 replies

Forum|alt.badge.img

Hi @tim_wood

you might want to try Matcher. In Matching Options please set Lenient Geometry Matching to Yes and low enough vertex tolerances.


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • January 3, 2018

Hi @tim_wood,

I have run into this problem before, and my solution was to use the AreaOnAreaOverlayer on the polygons. Use an AreaCalculator on the output, then a Tester to test for _overlaps > 1 and _area greater that your desired minimum area.

If the polygons have shapes that may result in an overlap being split into several pieces by the overlay, you can refine the process. Use a Counter on the input polygons to give them all a unique id, then create a list of the ids in the overlayer, using the Generate List setting. Between the overlayer and the AreaCalculator, sort the list by the id number with a ListSorter, then use a ListConcatenator to create a single attribute from the list. You now have a consistent id for each part of the polygon overlap. Aggregate these, grouping by the id, into a single multi-area before measuring the area and testing the overlaps.


david_r
Celebrity
  • January 4, 2018

Depending on your requirements, another possibility could be to use a Bufferer (or GeographicBufferer) with a tiny negative buffer size so as to shrink the polygons slightly before using the SpatialFilter. If the polygons still intersect, you know that they intersect over at least buffer size * 2 units, distance-wise (as opposed to overlapping a certain area, as in the solution suggested by @DaveAtSafe).


tim_wood
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 4, 2018
david_r wrote:

Depending on your requirements, another possibility could be to use a Bufferer (or GeographicBufferer) with a tiny negative buffer size so as to shrink the polygons slightly before using the SpatialFilter. If the polygons still intersect, you know that they intersect over at least buffer size * 2 units, distance-wise (as opposed to overlapping a certain area, as in the solution suggested by @DaveAtSafe).

Thanks for this suggestion. I tried it, but some polygons are so small, I have to set a buffer of -0.001 to avoid rejected features and that means I still end up with too many results.

 

 


tim_wood
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 4, 2018
daveatsafe wrote:

Hi @tim_wood,

I have run into this problem before, and my solution was to use the AreaOnAreaOverlayer on the polygons. Use an AreaCalculator on the output, then a Tester to test for _overlaps > 1 and _area greater that your desired minimum area.

If the polygons have shapes that may result in an overlap being split into several pieces by the overlay, you can refine the process. Use a Counter on the input polygons to give them all a unique id, then create a list of the ids in the overlayer, using the Generate List setting. Between the overlayer and the AreaCalculator, sort the list by the id number with a ListSorter, then use a ListConcatenator to create a single attribute from the list. You now have a consistent id for each part of the polygon overlap. Aggregate these, grouping by the id, into a single multi-area before measuring the area and testing the overlaps.

Thanks. I haven't tried this yet as it's more convoluted than the other suggestions and I need to move on to another part of the work I'm doing. I'll come back to the overlaps issue later.

 

 


david_r
Celebrity
  • January 4, 2018
tim_wood wrote:
Thanks for this suggestion. I tried it, but some polygons are so small, I have to set a buffer of -0.001 to avoid rejected features and that means I still end up with too many results.

 

 

Just remember that the regular Bufferer uses ground units, so if your polygons are in LongLat, then the buffer size is also in degrees.

 

Use the GeographicBufferer to specify the units for the buffer size, if needed.

tim_wood
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 4, 2018
lenaatsafe wrote:

Hi @tim_wood

you might want to try Matcher. In Matching Options please set Lenient Geometry Matching to Yes and low enough vertex tolerances.

Thanks. I've looked at your sample FMW and tried this but I don't get some of the overlapping polygons I know exist.

 


tim_wood
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 4, 2018
david_r wrote:
Just remember that the regular Bufferer uses ground units, so if your polygons are in LongLat, then the buffer size is also in degrees.

 

Use the GeographicBufferer to specify the units for the buffer size, if needed.
Yup. Mine are Ordnance Survey British National Grid so I believe Bufferer is the correct one to use.

 

 


tim_wood
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 4, 2018
@david_r, @LenaAtSafe, @DaveAtSafe

 

I've attached an example of the data I'm working with. These are different types of ground at the site such as grass, hard surface, etc. The issue is that some sites have been digitised twice, but not in the same way. I've removed all the attributes so I can upload the data, but they are not really relevant to this requirement anyway because the main thing is to identify the sites that need to be manually checked and edited by my client. There are some instances where an overlap is permitted, for example if there is a planter on a hard surface there might be a polygon for the planter on top of the hard surface.

 

example-overlaps.zip

ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • January 4, 2018
daveatsafe wrote:

Hi @tim_wood,

I have run into this problem before, and my solution was to use the AreaOnAreaOverlayer on the polygons. Use an AreaCalculator on the output, then a Tester to test for _overlaps > 1 and _area greater that your desired minimum area.

If the polygons have shapes that may result in an overlap being split into several pieces by the overlay, you can refine the process. Use a Counter on the input polygons to give them all a unique id, then create a list of the ids in the overlayer, using the Generate List setting. Between the overlayer and the AreaCalculator, sort the list by the id number with a ListSorter, then use a ListConcatenator to create a single attribute from the list. You now have a consistent id for each part of the polygon overlap. Aggregate these, grouping by the id, into a single multi-area before measuring the area and testing the overlaps.

This is the method I've used in the past for identifying overlaps above a certain area across 2.4 million polygons

 

 

e.g. you could do something like this if you only wanted to identify features that overlap by more than 80% of their area

 

 

calculate-overlap-example.fmwt

 


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • January 4, 2018
tim_wood wrote:
Thanks. I haven't tried this yet as it's more convoluted than the other suggestions and I need to move on to another part of the work I'm doing. I'll come back to the overlaps issue later.

 

 

Hi @tim_wood,

 

I am attaching an example workspace for you, with both methods implemented. The more complex method could be extended to test for permitted overlaps. If you add the polygon category to the list created by the overlayer, you could test for allowed combinations like planter/hard surface, and remove these form the output.

 

findoverlaps.fmw

 


tim_wood
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 11, 2018
daveatsafe wrote:

Hi @tim_wood,

I have run into this problem before, and my solution was to use the AreaOnAreaOverlayer on the polygons. Use an AreaCalculator on the output, then a Tester to test for _overlaps > 1 and _area greater that your desired minimum area.

If the polygons have shapes that may result in an overlap being split into several pieces by the overlay, you can refine the process. Use a Counter on the input polygons to give them all a unique id, then create a list of the ids in the overlayer, using the Generate List setting. Between the overlayer and the AreaCalculator, sort the list by the id number with a ListSorter, then use a ListConcatenator to create a single attribute from the list. You now have a consistent id for each part of the polygon overlap. Aggregate these, grouping by the id, into a single multi-area before measuring the area and testing the overlaps.

Both @egomm and @DaveAtSafe 's FMWs give me the sort of answer I'm looking for: a short list of 300-600 records for manual inspection. I'm not sure which is better, both are pretty similar. I'll likely go with Dave's one just because it produces 600 results which I can aggregate by site to give a workable list of 126 sites to inspect. I'm sure the percentage in egomm's could be tweaked to produce a similar result. Thanks all for your help :-)

Forum|alt.badge.img
  • June 5, 2019
david_r wrote:

Depending on your requirements, another possibility could be to use a Bufferer (or GeographicBufferer) with a tiny negative buffer size so as to shrink the polygons slightly before using the SpatialFilter. If the polygons still intersect, you know that they intersect over at least buffer size * 2 units, distance-wise (as opposed to overlapping a certain area, as in the solution suggested by @DaveAtSafe).

This was exactly what I needed. Thankyou.


Forum|alt.badge.img
tim_wood wrote:
Thanks. I haven't tried this yet as it's more convoluted than the other suggestions and I need to move on to another part of the work I'm doing. I'll come back to the overlaps issue later.

 

 

Hello there, is there any way that I may be able to dowload your file: findoverlaps.fmw? It is because I have the same issue right now. I just got so many tiny polygons by using the spatial relator transformer. Thank you.


kailinatsafe
Safer
Forum|alt.badge.img+21
tim_wood wrote:
Thanks. I haven't tried this yet as it's more convoluted than the other suggestions and I need to move on to another part of the work I'm doing. I'll come back to the overlaps issue later.

 

 

Hello @zacharylee1204​ , I have re-attached Dave's workspace! You should be able to download findoverlaps.fmw now! Kailin.


Forum|alt.badge.img
tim_wood wrote:
Thanks. I haven't tried this yet as it's more convoluted than the other suggestions and I need to move on to another part of the work I'm doing. I'll come back to the overlaps issue later.

 

 

thank you so much kallinatsafe! :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings