Skip to main content
Solved

SpatialFilter using one file (Trying to dissolve polygons without donuts etc.)


Hi,

I am needing help determining the best way to dissolve all polygons which are ENTIRELY WITHIN another polygon but which also MAY TOUCH THE OUTER BOUNDARY. However, I do not want all of the intersections, just ones entirely within. I am working with one file which seems to be an issue for SpatialFilter as the Candidates and the Filters are the same.

I cannot have donuts or multi-part objects. Some dissolving of inner features is acceptable but the idea is to dissolve as many polygons into larger one as possible without creating donuts or multi-parts.

Here is a sample of what I am working with:

 

Here is what I hope to achieve (or something similar to reduce the number of polygons already within):

The main thing is to help keep it clean while simplifying the geometry.

Best answer by gio

@bkingston

 

 

 

The predicates EQUAL,WITHIN AND CONTAIN are always met, as the requestor = supplier.

This is an issue for your query.

 

The help file pertaining this transformer sates:

Contains:

The interiors intersect and no part of the candidate's interior or boundary intersects the base's exterior. It is possible for the boundaries to intersect.

and

Within:

The interiors intersect and no part of the base's interior or boundary intersects the candidate's exterior. It is possible for the boundaries to intersect.

 

If you set calculate cardinality = yes and list concatenate relationships{}pass.

and select all predicates except EQUALS,CONTAINS, WITHIN, and INTERSECT.

And then use a stringsearcher to lok for TOUCHES, you will see none have this relationships.

None of them touch in your sample data.

 

You can also test this by using a LineOnAreaOverlayer.

Use a counter to ID the objects. Coerce to line a stream for the line input and have it make a list.

Remove duplicate ID' from the list (ListDuplicateRemover). Count the resulting element (Listelementcounter) And then test for elementcount>2.

You get al the touching line pieces, where it is not only their own boundary.

 

IT seems you have no adequate criterion to do what you want on the sample data. Maybe step back and start form the original data? The posted data is/seems already dissolved or buffered with a buffer size that is too large for this.

 

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

11 replies

  • Author
  • November 6, 2018

NeighborhoodAggregator does not seem to work as it creates multi-parts and fills in all of the donuts.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • November 6, 2018

Have a look at the custom transfomer the listcombiner. After you get a list determining relationships from a spatial relator you can assign a common id to shapes that are within or contained by each other. You can then dissolve by this group

A quick example

dissolve_shapes.fmwt

Which takes you from 7 shapes down to 4


  • Author
  • November 6, 2018
ebygomm wrote:

Have a look at the custom transfomer the listcombiner. After you get a list determining relationships from a spatial relator you can assign a common id to shapes that are within or contained by each other. You can then dissolve by this group

A quick example

dissolve_shapes.fmwt

Which takes you from 7 shapes down to 4

This is a good idea, but unfortunately fails as much of the geometry that is entirely within also touches the outer boundary. It was able to simplify 10 of the 192 objects.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • November 6, 2018
bkingston wrote:

This is a good idea, but unfortunately fails as much of the geometry that is entirely within also touches the outer boundary. It was able to simplify 10 of the 192 objects.

I think the problem is what you think entirely within is not in fact entirely within. It shouldn't matter if there is a point where shapes touch or have a coincident boundary. The smaller square would be dissolved into the larger square in this scenario

Unfortunately, if there are very tiny overlaps it makes your process more problematic, as you then have to evaluate if 99.9% of the area of the polygon is within another.

 

You could try applying a negative buffer to your suppliers before a spatial relator


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • November 6, 2018

Having looked more closely at your sample data and intended output I'm don't think you've accurately defined how you want things to be dissolved. On the right you have shown 3 polygons dissolved together but none of the original polygons would be described as entirely within?


  • Author
  • November 6, 2018
ebygomm wrote:

I think the problem is what you think entirely within is not in fact entirely within. It shouldn't matter if there is a point where shapes touch or have a coincident boundary. The smaller square would be dissolved into the larger square in this scenario

Unfortunately, if there are very tiny overlaps it makes your process more problematic, as you then have to evaluate if 99.9% of the area of the polygon is within another.

 

You could try applying a negative buffer to your suppliers before a spatial relator

That very well could be as it is possible that some of the objects do in fact slightly slip outside of the larger polygon. I will give your solution a go after running another possible solution. Thanks!


  • Author
  • November 6, 2018
bkingston wrote:

That very well could be as it is possible that some of the objects do in fact slightly slip outside of the larger polygon. I will give your solution a go after running another possible solution. Thanks!

Using the GeographicBufferer did indeed help a little more with a buffer at -5 for my dataset. Going beyond that caused issues with creating donuts. So down from 192 to 165. Can't help but think someone has run into a geometric issue like this before. Possibly dissolve all and just chop it, though I imagine the resources necessary to do that are substantial for the full dataset. I also think that could cause more validation issues but I am running it to see.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • November 7, 2018

to look for within and not touching, you need to query the cardinality or the d9im matrix.

First one is easiest.

Set calculate cardinality = yes.

Concatenate the _relationships list{}.card_line and card_area with no separator.

Then test card_area concatenation >0 && car_line = 0


  • Author
  • November 7, 2018
gio wrote:

to look for within and not touching, you need to query the cardinality or the d9im matrix.

First one is easiest.

Set calculate cardinality = yes.

Concatenate the _relationships list{}.card_line and card_area with no separator.

Then test card_area concatenation >0 && car_line = 0

Within & Not Touching is the easy one and SpatialRelator does that. However, I am needing ENTIRELY WITHIN & TOUCHING. As egomm stated, if it slightly goes over I can buffer it back slightly but it is still possible that it is touching.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • Best Answer
  • November 8, 2018

@bkingston

 

 

 

The predicates EQUAL,WITHIN AND CONTAIN are always met, as the requestor = supplier.

This is an issue for your query.

 

The help file pertaining this transformer sates:

Contains:

The interiors intersect and no part of the candidate's interior or boundary intersects the base's exterior. It is possible for the boundaries to intersect.

and

Within:

The interiors intersect and no part of the base's interior or boundary intersects the candidate's exterior. It is possible for the boundaries to intersect.

 

If you set calculate cardinality = yes and list concatenate relationships{}pass.

and select all predicates except EQUALS,CONTAINS, WITHIN, and INTERSECT.

And then use a stringsearcher to lok for TOUCHES, you will see none have this relationships.

None of them touch in your sample data.

 

You can also test this by using a LineOnAreaOverlayer.

Use a counter to ID the objects. Coerce to line a stream for the line input and have it make a list.

Remove duplicate ID' from the list (ListDuplicateRemover). Count the resulting element (Listelementcounter) And then test for elementcount>2.

You get al the touching line pieces, where it is not only their own boundary.

 

IT seems you have no adequate criterion to do what you want on the sample data. Maybe step back and start form the original data? The posted data is/seems already dissolved or buffered with a buffer size that is too large for this.

 


  • Author
  • November 8, 2018
gio wrote:

@bkingston

 

 

 

The predicates EQUAL,WITHIN AND CONTAIN are always met, as the requestor = supplier.

This is an issue for your query.

 

The help file pertaining this transformer sates:

Contains:

The interiors intersect and no part of the candidate's interior or boundary intersects the base's exterior. It is possible for the boundaries to intersect.

and

Within:

The interiors intersect and no part of the base's interior or boundary intersects the candidate's exterior. It is possible for the boundaries to intersect.

 

If you set calculate cardinality = yes and list concatenate relationships{}pass.

and select all predicates except EQUALS,CONTAINS, WITHIN, and INTERSECT.

And then use a stringsearcher to lok for TOUCHES, you will see none have this relationships.

None of them touch in your sample data.

 

You can also test this by using a LineOnAreaOverlayer.

Use a counter to ID the objects. Coerce to line a stream for the line input and have it make a list.

Remove duplicate ID' from the list (ListDuplicateRemover). Count the resulting element (Listelementcounter) And then test for elementcount>2.

You get al the touching line pieces, where it is not only their own boundary.

 

IT seems you have no adequate criterion to do what you want on the sample data. Maybe step back and start form the original data? The posted data is/seems already dissolved or buffered with a buffer size that is too large for this.

 

I think that is going to be necessary to revisit the original data which is a real mess! Thanks for the info. There is a good chance that all of the suggestions here will be used in one way or another in new workspaces. I appreciate all of the suggestions given!


Reply


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