Skip to main content
Solved

Geometry Validator not repairing Self Intersection


joshuajames1979
Contributor
Forum|alt.badge.img+7

I have a routine that extracts property boundaries from a web service and outputs to shp to be imported into our Property and Rating system. I do have a Geometry Validation process to repair geometries where they may self intersect or are corrupted, however there are two polygons that are not repairing, even though they pass the test. Both are like the below. The polygon doesn’t actually cross over itself. Rather, this is two separate vertices where the bottom section meets the top section, and it’s all one polygon. Is there a way to automatically fix these with FME as we can’t edit the original. My workaround is to have the tiniest buffer and dissolve so the vertices don’t touch which passes the validation test in our P&R import, but ideally we should have clean geometries.

Any help appreciated.

 

Regards,

 

Josh

Best answer by takashi

I think it would be ideal if you could fix the succeeding system to process self-touching donut as valid geometry. If it's difficult, however, I think buffering would be an effective workaround, as you mentioned.

In order to limit side effects on neighbor polygons, a possible way I can think of is:

  1. GeometryValidator : Detect self-touching donuts but don't repair them. 
    • Issue to Detect: Self-Intersections in 2D
    • Check Self-Touching Polygon: Yes
    • Attempt Repair: No
  2. GeometryCoercer (Geometry Type: fme_line) : Convert the Failed geometry to its boundary line.
  3. Bufferer : Create tiny buffer of IssueLocations (i.e. touching point).
  4. Clipper (Group By: PropNum) : Clip the boundary line by the tiny buffer.
  5. HullReplacer : Create a hull surrounding clipped inside lines.
  6. Dissolver (Group By: PropNum) : Dissolve the hull and the Failed geometry.

Assumuing that “PropNum” is unique ID of the input features. 

The hull could also be used as clipper to clip the neighbor polygons in order to match the boundaries of neiboring polygons here.

See also the attached workspace example.

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

7 replies

hkingsbury
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • April 11, 2025

Can you share that geometry? When I recreate one it does fail the geometry validation
 

 

What are you wanting to do with it? Are you wanting it to be split into two seperate geometries? If so a tiny negative buffer, then deaggreate then anchored snapper (surround parcels are the anchors) should help achieve that


takashi
Supporter
  • April 12, 2025

Hi ​@joshuajames1979 ,

According to your explanation, I assume that the input geometry is so called "pinch" shape - a polygon with a single boundary having hole-like part formed by two vertices touching each other, like this screenshot. Numbers represent the order of vertices on the polygon boundary, vertex #4 and vertex #8 touch each other.

“Pinch” Polygon

However, I think GeometryValidater (Issue to Detect : Self-Intersections in 2D) should detect such a "pinch" shape as an invalid geometry and repair it to a donut - consisting of an exterior boundary (outershell) and an interior boundary (hole), by default. The outershell and the hole will touch at a point, but it's an OGC complient valid geometry.

Could you please explain some more detail about your situation including input geometry shape, GeometyValidator parameters setting, preferable repaired shape, etc.?


joshuajames1979
Contributor
Forum|alt.badge.img+7

Hi Takashi. I think that’s correct. I’ve attached the polygon. Currently I’m altering every polygon slightly with tiny buffers but if this section could be made valid without affecting other geometries that would be great. Even if FME added a vertex to shift the touching vertex a tiny bit so remove the self intersection.

Even if it did something like this just for this polygon, but at a minute scale.

 

Currently I have a tiny buffer of .0000001 and then I dissolve then aggregate and then do a validate to remove any introduced geometry errors, only because the above situation seemed to be detected but not repaired.

 


takashi
Supporter
  • April 12, 2025

Thank you for sharing the sample.

The geometry sample you shared is not a "pinch" shape, is a donut (polygon with holes) geometry self-touching.

Self-Touching Donut

Generally you can consider self-touching donut as a valid geometry, and it will be output via Passed port of GeometryValidater if you set "No" (default) to the Check Self-Touching Polygon parameter.

Do you have any inconvenient if there are self-touching donuts in the dataset?


joshuajames1979
Contributor
Forum|alt.badge.img+7

Thanks for the reply. The process that imports this dataset in our property and rating system is treating it as invalid so the process fails. We also had a geometry error in our CRM if that property was selected. Perhaps I can use another transformer to detect touching vertices that remain after geometry validation and where they touch shift one vertex by a very small amount.


takashi
Supporter
  • Best Answer
  • April 13, 2025

I think it would be ideal if you could fix the succeeding system to process self-touching donut as valid geometry. If it's difficult, however, I think buffering would be an effective workaround, as you mentioned.

In order to limit side effects on neighbor polygons, a possible way I can think of is:

  1. GeometryValidator : Detect self-touching donuts but don't repair them. 
    • Issue to Detect: Self-Intersections in 2D
    • Check Self-Touching Polygon: Yes
    • Attempt Repair: No
  2. GeometryCoercer (Geometry Type: fme_line) : Convert the Failed geometry to its boundary line.
  3. Bufferer : Create tiny buffer of IssueLocations (i.e. touching point).
  4. Clipper (Group By: PropNum) : Clip the boundary line by the tiny buffer.
  5. HullReplacer : Create a hull surrounding clipped inside lines.
  6. Dissolver (Group By: PropNum) : Dissolve the hull and the Failed geometry.

Assumuing that “PropNum” is unique ID of the input features. 

The hull could also be used as clipper to clip the neighbor polygons in order to match the boundaries of neiboring polygons here.

See also the attached workspace example.


joshuajames1979
Contributor
Forum|alt.badge.img+7

Thanks very much for that. I’ve taken your example and tweaked it to get it working. I was able to go from buffer of invalid locations straight to dissolve and aggregate them back, but I think this works nicely so thanks.

 


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