Question

AreaOnAreaOverlayer to get only polygons that overlap polygons from certain group


Badge

Hello,

I have one feature reader where I read filter polygons from table A. As a result I get few of them.

Then I have separate reader where I read polygons from different table B. I have like 2000 of them.

Then I would like to get as a result only those polygons from table B which are inside any of the polygons from tabel A or % of the area inside one of the polygons from table B is let's say 90%.

What would be the best way of doing that?


11 replies

Badge +2

Hi @witos

I would look into the SpatialFilter transformer.

For example set table A as your Candidate and table B as your Filter then for Spatial Predicates to Test include 'Filter Intersects Candidate' and 'Filter Contains Candidate'. Then on the candidates that pass through by intersection rather than full containment you can do further testing to see if that intersection is >90% area.

Badge +2

Hi @witos

I would look into the SpatialFilter transformer.

For example set table A as your Candidate and table B as your Filter then for Spatial Predicates to Test include 'Filter Intersects Candidate' and 'Filter Contains Candidate'. Then on the candidates that pass through by intersection rather than full containment you can do further testing to see if that intersection is >90% area.

@witos, You could even perform the spatial filter on table B as it is read in by using a feature reader - with table A as the initiator. This will likely improve the overall performance of the workspace as well.

 

Badge

Hi @witos

I would look into the SpatialFilter transformer.

For example set table A as your Candidate and table B as your Filter then for Spatial Predicates to Test include 'Filter Intersects Candidate' and 'Filter Contains Candidate'. Then on the candidates that pass through by intersection rather than full containment you can do further testing to see if that intersection is >90% area.

@hollyatsafe

 

Ok thanks but this is the most difficult part: "do further testing". All I will have at that point will be the intersecting polygons. I don't know how to then calculate overlaping area of them.

 

 

AreaOnAreaOverlayer may be quite good but if in my candidate group I have some overlaping polygons it will be passed to the result as well which of course I dont want.

 

Badge +2
@hollyatsafe

 

Ok thanks but this is the most difficult part: "do further testing". All I will have at that point will be the intersecting polygons. I don't know how to then calculate overlaping area of them.

 

 

AreaOnAreaOverlayer may be quite good but if in my candidate group I have some overlaping polygons it will be passed to the result as well which of course I dont want.

 

Ah my apologies @witos, I think something like this would work. See picture attached and a further explaination below.

 

First use the Spatial filter to find any candidates (table B) that are either contained or intersect with the filter (table A).

 

From there add a Tester or TestFilter to get only those that intersect as this is what we will do further testing on.

 

My thought process was to find the total area of each polygon and then determine whether the area that intersected was greater than 90%. So first we will use an area calculator.

 

Then use an areaonareaoverlay transformer and input both the Intersect candidates and table A - this transformer will divide the candiates into multiple parts where the intersection lies and we can therefore use the parts to calculate whether the overlap area is greater than 90%.

 

Add another tester to outport. This time we will calculate the area within the Tester so set the Left Value to @area the operator to >= and in the Right Value open up the arithmetic editor and add in the _attribute feature *0.9 to calcuate 90% of the total area.

 

The areaonareaoverlay will output every area including those from table B so change the tester pass criteria to AND and add a second test where _predicates has a value.

 

Now you can take the features from the Contained port of the testfilter combined with the passed port of the test filter to get polygons that match the criteria. The only problem is the INTERSECTS polygons will have been sliced up during the areaonareaoverlay - so if all polygons have a unique attribute you can then return to the initial reader to pull these through as whole.

 

 

Hopefully this is more helpful to you.
Badge
Ah my apologies @witos, I think something like this would work. See picture attached and a further explaination below.

 

First use the Spatial filter to find any candidates (table B) that are either contained or intersect with the filter (table A).

 

From there add a Tester or TestFilter to get only those that intersect as this is what we will do further testing on.

 

My thought process was to find the total area of each polygon and then determine whether the area that intersected was greater than 90%. So first we will use an area calculator.

 

Then use an areaonareaoverlay transformer and input both the Intersect candidates and table A - this transformer will divide the candiates into multiple parts where the intersection lies and we can therefore use the parts to calculate whether the overlap area is greater than 90%.

 

Add another tester to outport. This time we will calculate the area within the Tester so set the Left Value to @area the operator to >= and in the Right Value open up the arithmetic editor and add in the _attribute feature *0.9 to calcuate 90% of the total area.

 

The areaonareaoverlay will output every area including those from table B so change the tester pass criteria to AND and add a second test where _predicates has a value.

 

Now you can take the features from the Contained port of the testfilter combined with the passed port of the test filter to get polygons that match the criteria. The only problem is the INTERSECTS polygons will have been sliced up during the areaonareaoverlay - so if all polygons have a unique attribute you can then return to the initial reader to pull these through as whole.

 

 

Hopefully this is more helpful to you.
@hollyatsafe thank you very much for this detailed explenation. The ponly problem I can see here is that it probably won't work if in the group be there polygons that overlap each other. In some cases they would be included into results but I would like in the results only those which have common part with polygons from table A (filter) and pass the "common area ration" condition.

 

 

Userlevel 2
Badge +17

Hi @witos, solution could be different depending on the conditions on spatial relations among the polygons. Could you please choose Yes or No for these questions?

  • Two or more A-Polygons (polygons from table A) could overlap each other. Yes/No?
  • Two or more B-Polygons (polygons from table B) could overlap each other. Yes/No?
  • A single A-Polygon could overlap two or more B-Polygons. Yes/No?
  • A single B-Polygon could overlap two or more A-Polygons. Yes/No?
Badge

Hi @witos, solution could be different depending on the conditions on spatial relations among the polygons. Could you please choose Yes or No for these questions?

  • Two or more A-Polygons (polygons from table A) could overlap each other. Yes/No?
  • Two or more B-Polygons (polygons from table B) could overlap each other. Yes/No?
  • A single A-Polygon could overlap two or more B-Polygons. Yes/No?
  • A single B-Polygon could overlap two or more A-Polygons. Yes/No?
Hi @takashi

 

 

Two or more A-Polygons (polygons from table A) could overlap each other. Yes
  • Two or more B-Polygons (polygons from table B) could overlap each other. Yes
  • A single A-Polygon could overlap two or more B-Polygons. Yes
  • A single B-Polygon could overlap two or more A-Polygons. Yes
Userlevel 2
Badge +17

Hi @witos, solution could be different depending on the conditions on spatial relations among the polygons. Could you please choose Yes or No for these questions?

  • Two or more A-Polygons (polygons from table A) could overlap each other. Yes/No?
  • Two or more B-Polygons (polygons from table B) could overlap each other. Yes/No?
  • A single A-Polygon could overlap two or more B-Polygons. Yes/No?
  • A single B-Polygon could overlap two or more A-Polygons. Yes/No?
Well, if a B-Polygon overlaps two or more A-Polygons, how should the "common area ratio" be calculated?

 

 

Badge
Well, if a B-Polygon overlaps two or more A-Polygons, how should the "common area ratio" be calculated?

 

 

@takashi It should be checked for each of filter polygons from table A and if condition is met for at least one then it should be added to the result. Please take a look at the picture below:

Userlevel 2
Badge +17

Hi @witos, solution could be different depending on the conditions on spatial relations among the polygons. Could you please choose Yes or No for these questions?

  • Two or more A-Polygons (polygons from table A) could overlap each other. Yes/No?
  • Two or more B-Polygons (polygons from table B) could overlap each other. Yes/No?
  • A single A-Polygon could overlap two or more B-Polygons. Yes/No?
  • A single B-Polygon could overlap two or more A-Polygons. Yes/No?
If I understood the conditions correctly, this workflow might help you.

 

 

Badge +2
@hollyatsafe thank you very much for this detailed explenation. The ponly problem I can see here is that it probably won't work if in the group be there polygons that overlap each other. In some cases they would be included into results but I would like in the results only those which have common part with polygons from table A (filter) and pass the "common area ration" condition.

 

 

@witos, using the spatial filter first will compare every feature in table B with those in table A and only those that overlap with a polygon from feature A will be passed out - so it shouldn't matter whether features in table B overlap here -they will not be passed through if they have no relation with features in table A.

Reply