Monday, July 20, 2015

GIS Programming: Working with Rasters

Hello and welcome to week 9 of my GIS Programming class. This week is dedicated to working with rasters via python. The overall objectives of this week were to be able to list and describe rasters, and use raster objects in geoprocessing. Also, map algebra operators and classes for defining raster parameters were discussed.  The raster work also involved much interaction with the spatial analyst extension through arcpy.  The exercise and assignment culminated in a script producing the below result.


Above you can see the end result of the script, as well as the message traffic describing each step of the process  in the PythonWin interactive window. The pictured raster shows you two different areas, the green areas match a set of criteria established by the script. The black areas represent those that do not meet the prescribed criteria. To get this finalized image 5 different rasters were created then merged with map algebra. the 5 individual rasters set up certain particular criteria. A landuse raster was used to isolate forested areas using the remap and reclassify tools. Also, an elevation raster layer was used to create 4 specific rasters using the Slope and Aspect functions. I needed to identify slope areas between 5 and 20 degrees, and aspect areas between 150-270 degrees. These combined with the forested areas using the & operator generated this raster. The 5 individual rasters were all created on a temporary basis through working with arcpy. The save function was used with the final raster to allow it to be a permanent raster dataset. This is a handy feature because it allows all of the intermediate data to not clog up your various save locations, and only keep that which you specifically desire.
This kind of work with rasters is particularly useful for suitability analysis, and thats exactly what the above script mirrored. Taking multiple criteria and combining them to show a suitable area for whatever you need. This was a great foundation for working with rasters in arcpy.

No comments:

Post a Comment