Skip to main content

Hi.

I'm trying to find self-intersections using GeometryValidator but it just keeps passing all geometry. What am I doing wrong?

Above is a zipped shape file which I've tried running through a GeometryValidator in multiple versions of FME. 2015, 2017, 2018, 2020. Checking for self intersections in 2D. Always passes no matter what settings I use. Here's a screenshot.

It's originally a rectangle that I've twisted so that it self intersects in the middle. To me it should be obvious that there's a self intersection but as mentioned the GeometryValidator fails to detect it. Does anyone know what the problem is?

 

When having such issues I always recommend inspecting the geometry in detail using the FME Inspector. In this case we can see that this isn't one single polygon (as one would expect from the visual representation only), but it is in fact two non-intersecting triangles assembled into an aggreate:

So yes, the GeometryValidator is right, there are no self-intersects in this feature.


When having such issues I always recommend inspecting the geometry in detail using the FME Inspector. In this case we can see that this isn't one single polygon (as one would expect from the visual representation only), but it is in fact two non-intersecting triangles assembled into an aggreate:

So yes, the GeometryValidator is right, there are no self-intersects in this feature.

Thank you for your answer.

Ok, well that explains why GeometryValidator doesn't catch it then. But how would I detect that they touch in a single point then? As you can see the first coordinate (0) in the above triangle and the third coordinate (2) in the bottom triangle are exactly the same. This isn't allowed and causes errors in the application I'm using. Overlaps and touching polygons is fine but they can't touch in just one single point.

The polygons are usually many, large and complex so it's hard to find visually. I guess I could use an AreaOnAreaOverlayer but since there are usually many overlaps that would still make it hard to find.


Are you sure the issue is a separate parts of multipolygons touching at single points that is the issue, versus just being a multipolygon?


Are you sure the issue is a separate parts of multipolygons touching at single points that is the issue, versus just being a multipolygon?

Thanks for your answer.

It's a valid question but no, multipolygons don't produce errors. If I would just separate those two polygons then everything would work without any issue. My problem here is that I want a relatively easy way to identify where those issues are so I can fix them or point them out to others. I thought that GeometryValidator would help me to do that but as has been proven sadly not.


Thanks for your answer.

It's a valid question but no, multipolygons don't produce errors. If I would just separate those two polygons then everything would work without any issue. My problem here is that I want a relatively easy way to identify where those issues are so I can fix them or point them out to others. I thought that GeometryValidator would help me to do that but as has been proven sadly not.

You have a fairly specific business constraint, so you probably have to author a workspace for your specific needs in this case.


You have a fairly specific business constraint, so you probably have to author a workspace for your specific needs in this case.

If you mean for when the geometry is added then that's unfortunately not an option right now.

If you mean for detecting it, then yes that's what I'm trying to do right now but have reached a dead end. :)


If you mean for when the geometry is added then that's unfortunately not an option right now.

If you mean for detecting it, then yes that's what I'm trying to do right now but have reached a dead end. :)

Hi @magm You could start by checking for aggregates among those features that passed the GeometryValidator. After that, you'll have to deaggregate them and check for intersection between them with a SpatialFilter or SpatialRelator, then link those back to the original features. If you know that the original feature was a simple polygon then you could recreate it with a HullReplacer.

Find_intersection_between_elements.fmw


Hi @magm You could start by checking for aggregates among those features that passed the GeometryValidator. After that, you'll have to deaggregate them and check for intersection between them with a SpatialFilter or SpatialRelator, then link those back to the original features. If you know that the original feature was a simple polygon then you could recreate it with a HullReplacer.

Find_intersection_between_elements.fmw

Thank you. I will take a look at this.


Reply