Migrating GRIDS and Shapefiles to FGDB Using Python

Sunset 3
The Drawdown tool within RegGSS can be used to create a hydrologic drawdown models (grids) in a non-leaky aquifer for single or multiple well systems. The tool is also a library of over 2,500 grids that allows for storage and retrieval of the created drawdown grids and contours.


Drawdown creates a directory named the same as the permit application number, for example 080410-22. The individual grids are stored within this directory and are named “application number – version”, for example 080410-22-1. Each grid can also have contours and those are named “contour – version”, so the contours for 080410-22-1 is just contours-1.

We did extensive testing on our test environment and thought we had figured it all out. But how often does your test environment faithfully duplicate production? Especially, in a Windows XP to Windows 7, ArcGIS v9.3 to 10.1 migration?

Here are the problems as we migrate to ArcGIS v10.1:

  • ArcGIS v10.1 wants everything in a geodatabase (will use a file geodatabase)
  • Geodatabases do not like grids that begin with numbers (will prefix grids with a “g”)
  • Geodatabses do not like grids or contours that have dashes “-” in the name (will use underscore “_”)
  • Prior to ArcGIS v9.2 grids were stored with auxiliary files, for example 080410-22-1.aux which stored statistical information about the grid. At ArcGIS v9.2 in addition to aux files ESRI added aux.xml files, for example 080410-22-1.aux.xml. ArcGIS v10.1 does not recognize the older format with the aux file alone. (we will generate aux.xml files).

The image below is a look at the output of Drawdown for a single well system.
Drawdown Grid

You can take a look at the python code on GitHub.

Juan Tobar, Supervisor – Geographers, Regulation GIS, SFWMD

Feature Class Indexes Using Python and XML

The Regulatory GIS Support System (RegGSS) is an ArcMap extension written in C# and managed by SFWMD Regulation GIS.

RegGSS Toolbar

It  that has numerous functions to load data including a number of “Find” functions that work by indexing the names of features in a feature class and then makes this available through a listbox from which users can select individual features.

One of these Finds indexes the ArcHydro feature class HydroEdge containing canal centerlines. Unfortunately, with over 210,000 features creating an index on the fly can take well over a minute and this can try a user’s patience.

Find Canal (AHED)

A solution to this issue is to create a list of feature names ahead of time and then just load it into a listbox. In the example below, this is being done using Python and a XML file.

You can view CreateFindIndex.py code through Github.

And here is what the XML looks like:
XML File

Louis Artola has a good post on using Python to write XML on his blog louisartola|software.

Let us know if you have any comments,

By Juan Tobar, Supervisor – Geographers, Regulation GIS, SFWMD