I’ve been wrangling a large number of Shapefiles recently (almost half a billion!), converting them to a PostGIS database. A small command file calling FME (with return code checking) was just the trick and, after several days of processing, the job was done. The problem is… my record count on one of the output tables is larger than expected.
After some research and experimentation, I’ve discovered that if you pass a polygon with bad geometry (in my case touching rings, which is fine in a Shapefile), it causes multiple records to be written to a PostGIS table! So, if a record has a polygon with 3 rings, not overlapping but touching, it would be expanded to 3 rows in the output table. FME does not report this in its output summary, which makes be suspect it’s a PostGIS behaviour in trying to deal with the bad geometry.
Fortunately, in my case, any additional rings are always artefacts in nature and can be discarded, so my main question is how can I set a polygon to be its first ring only. I’ve tried GeometryValidator and the promising-named PolygonSelfTouchRemover, but with no joy. I was not sure about donut transformers since my extra rings are external, and not holes. I can’t find anything else which seems to cover ring extraction.
Thanks,
Warren