Features with holes

Holes are often used in shapefiles, for example to mark an island in an water polygon or to mark a clearing in a forest polygon. Until now scenProc did not support holes, so they were ignored when importing shapefiles. As a result of this the autogen generated would not be correct.

The scenProc code that handles the splitting of features into the autogen grid does not know about holes and also the autogen polygons in the AGN file don’t know the concept of holes. So therefore I have added functionality to the SHP importer to remove them. Instead a cut is made in the polygon, so that the entire shape can still be represented as one polygon. After that they can be processed like any other shapefile.

Interestingly you can have island within holes again (and that island can have a hole of itself). scenProc should be able to handle such situations as well, as you can see in the picture below. Although I haven’t tested it to the extreme.

The new functionality will come at a small performance cost. When importing features with holes scenProc has to do additional work to correctly represent them. So for complex files this can increase the loading time a bit. But of course you get support for the holes in return.

If you still have a file with holes that doesn’t work correctly please let me know.

holes

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.