Thursday, July 28, 2016

Exercise 8: Raster Processing with Booleans and Loops

Goals and Objectives

The purpose of this exercise was to use a suite of loops to clip and project a directory of scanned USGS topographic sheets into a seamless raster using Python.  The study area was Kettle Moraine. 


Methods

In this exercise, four scanned USGS topographic sheets were manipulated using Python to create a raster.  While developing this script, comments were used to annotate each section of code.  The following steps were taken: 


  • importing system modules
  • importing Python modules: os, time, datetime, shutil, ArcGIS extensions
  • creating variables
  • creating spatial reference object using coordinate system of a tile index
  • using IF statement to set up loop
  • adding all files of specified criteria to raster list
  • setting up processing loop for each raster
  • formatting raster names
  • projecting all rasters
  • creating polygon of raster's topographic footprint
  • merging tiles
  • creating IF statement to set up a FOR IN loop
  • creating search cursor
  • clipping rasters
  • merging rasters together
  • debugging and running script
  • creating map in ArcMap


Results

The final map and script are shown below.  

Figure 1: map displaying four merged USGS topo quads








No comments:

Post a Comment