April 23, 2012

Raster dataset footprint in ArcPy

Raster dataset footprint in ArcPy

My current workflow in preparing maps from GIS data involves setting up the all the data in ArcMap then exporting to Adobe Illustrator (more about that workflow another time).

That works fine - for all the vector data.

For Raster data, I prefer to have them properly aligned and possibly export them rendered from ArcMap (data > export to a png/tif file) or using them as they are - but not in the full export of the map view in ArcMap.

To get the properly aligned in Illustrator it is handy to have the footprint of the raster dataset as a vector layer.

Previously I have manually prepared that executing a few commands, like vectorizing the raster dataset and creating a constant raster. Now I thought I would create a little python script to do this instead...

Here is this script for quick download: [1 KB zip-file]

I will package this script more nicely and post it in the resources section of the Nordpil website in time... !


  • I still would like to have the script so that it adds a layer to the existing map view if run from the ArcMap console (in an imported toolbox). I tried to add a little thingie at the end of the script, but it doesn't seem to work... any tips?
  • I learned how to import a toolbox to be able to use it from the ArcMap/ArcCatalog python console pane - use ImportToolbox!


  • 2012-04-24 Fixed an issue with parsing the parameters