3d Visualization of Bogota

Captura de pantalla 2017-07-07 a las 20.23.03.png


Killing Godzillas using Arcpy


According to Esri , Godzillas are those geometries with too many vertices that cause errors like out-of-memory, system crashes or the “famous”  999999 : Error executing function.

To avoid that problem you will have to use the Dice tool. That tool “Subdivides a feature into smaller features based on a specified vertex limit*. (Only available to  “Arcinfo” , “ArcGIS for Desktop Advanced”  or “Arcgis for Server Advanced” users).

For example, if you have some geometries like these:

despues (1)

and apply them the Dice tool, you will get results like these:

despues_dice (1)

The only problem is that the Dice tool could generate some invalid geometries (and the docs don’t tell you about it).  Alternatives?  Python / Arcpy to the rescue.

The following script does the following:

  • Convert you features from multipart to singlepart.
  • Dice your geometries
  • Teplace the old data with the new generated features
  • Check and  repair the new  invalid features

Easy, isn’t it?. You can tame those ugly godzillas with a little bit of python / arcpy.


If you need to do something similar using open source software, probably the best option is the function “ST_SubDivide” from postgis. The following post from Paul Ramsey gives you more details about it: “Subdivide All the Things“.