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“.



Palabras sabias de reflexión: Qué debo tener en cuenta para iniciar un proyecto SIG (Sistema de Información Geográfica) en el 2014

Embed from Getty Images


Tomado de Starting a GIS :

If you are starting a GIS please consider the following:

  • Decide what data you need. Does it exist already? Do you need to go out and collect it? Can you collect it or do you need to hire someone to do it.
  • Look at your software needs. How much do you want to spend. Look at open source. Look at the commercial stuff. Can you mix and stretch those dollars just a bit more than you think? BTW – you can mix and match. All you need is a process.
  • Budget – Budget for a year. Budget for two. Then Budget for five. Budget like this might be successful. Look at your software also. Are you going to spend enough on software you could hire someone else? It happens. That’s a huge argument (for me) for mixing in open source. Jobs. Hiring someone does more for your community than paying more money for software.

It’s 2014. Software doesn’t have to be from one vendor. Your entire GIS setup doesn’t have to be a mono-culture. Servers (think cloud (another word I hate)) are cheaper than they ever have been. Pick the right software and you don’t have to spend a fortune on a workstation. Worry about your data. If you spend more time worry about your software than letting your data work for you you are doing it wrong.

Tomado de Starting a GIS

Tutorial: Procesamiento de Imágenes Raster utilizando Postgis 2.0

Entre las nuevas características de Postgis 2.0 se encuentra la posibilidad de procesar información de tipo raster. El siguiente tutorial nos introduce en el tema utilizando Postgis 2.0 en ambiente Windows:

Tutorial: Manejo de Información Raster en PostGIS 2.0