The larger brow object has bit weird geometry (the edge that breaks the donut), maybe rebuild it?
post the bit of geometry so we can check/try it.
Based on your screenshot above, it seems that your geometries might be corrupted. I would try the following things:
1) When you used the GeometryValidator, did you check for 'Duplicate consecutive points' and/or 'self-intersections in 2D'?
2) When the blue polygons do not overlap internally, you might want to experiment with the AreaonAreaOverlayer and see if the same problem exists there aswell.
3) Lastly, I would try to use the DonutHoleExtractor to extract the outershells of the blue polygons, prior to clipping them with the green polygons. This might simplify the clipping procedure and you can always re-clip the DonutHoles in a later phase.
Thanks for responding @kd and @gio, much appreciated.
Firstly, I'll note that the input polygons are large in size and are not clean (this is to be a repeated process so any manually editing is to be avoided - if possible).
1) GeomValidaor - ( for 'Duplicate consecutive points' and/or 'self-intersections in 2D') fixes a few issues, but the clipped output still has errors, in this case a few extra donut holes were created. (When using DonuteHoleExtractor here, the OuterShell output has errors i.e. missing/additional donuts),
2) AreaOverArea - fixes a few issues, but a few other polygons are now missing.
3) DonutHoleExtractor - by itself makes not differences as the inputs are read as polygons.
I've uploaded the macro to here:
https://www.dropbox.com/s/m2exavyych1s56d/FME_Clipper.zip?dl=0
If you have any other suggestions, please let me know.
Thanks again
Hi, @claudian
I managed to find a solution for repair.
Bit tricky but works nice. (can't upload as this is blocked at my work....)
Basically I break up the faulty objects by tiling them to sufficient resolution. Then turn them into polylines, then create area out of these. Then use a spike remover to remove the inner loops.
Dissolve the result, all spike remover output. Clip by original, to get some pieces back which have collapsed to lines. Dissolve again. And voila a correct geometry.
Basically the geometries are not degenerate, the just contain inner loops wich looks like donuts, but are not donuts.
My script turn them into true donuts.
( I did not check the other objects, but should work for them too)
Hi, @claudian
I managed to find a solution for repair.
Bit tricky but works nice. (can't upload as this is blocked at my work....)
Basically I break up the faulty objects by tiling them to sufficient resolution. Then turn them into polylines, then create area out of these. Then use a spike remover to remove the inner loops.
Dissolve the result, all spike remover output. Clip by original, to get some pieces back which have collapsed to lines. Dissolve again. And voila a correct geometry.
Basically the geometries are not degenerate, the just contain inner loops wich looks like donuts, but are not donuts.
My script turn them into true donuts.
( I did not check the other objects, but should work for them too)
Thanks for giving it a shot @gio.
Just a few questions:
1)
Which error coordinates did you extract from the log? (Did you run the geom validator on a few parameters - if so which, and looked at those that failed?)
2)
What is being tested at Tester_3? (I'm assuming that the input Polygons_NeedClipping has not changed, or did you create a new input with an attribute to flag those that have errors and the tester is used there?)
3)
When you explained that the polygons contain inner loops instead of donuts, is there a way to avoid this? The original polygons were created by snapping, dissolving, and aggregating a bunch of files via fme.
Hi @claudian -- if you are able to send the input data to us at support@safe.com , we'd love to get this into our development team's hands. They are soon to begin a clipping sprint. Thanks (and sorry for the trouble)
1 I ran the clipping bit on the not cleaned area's. Copied the coordinates from the log to a csv.
You are correct to assume that this was to id them (flag them).
Tester3 selects the flagged objects.
The inner loop as I called is is for instance created by a donutholebridger.
To possibly avoid it, I think you might want to create the areas first (including, snapping, dissolving). When done, clip the buildings out of the areas. (seems like you clipped the areas first by the buildings and then dissolved the area's)
,
@claudian
1. If your clip the 2 datasets without any other transformation, the transformation log shows where the duplicate segments are. I copied those lines of text to a csv. Then ran the script in the bookmark to get an id on them. These id's I used in ( 2:correct flaggin the objects) in tester
Because there is no need to drag all objects trough the process.
3. Could be a possibility to avoid it but depends on how they where created. For instance a donutholebridger creates such objects, but you didn't use that is assume.
Aggregation is doesn't matter, as they are not aggregates anyway.
By the looks of it you did clip the buildings first and then dissolved the surrounding area's etc?
I'd built the areas first, snap dissolve etc.. And after that clip the buildings out of them (taking into account where they might possibly share an edge with the area.)
Btw. they can also be rebuilt using Topologybuilder, matcher and counters.