Friday, July 18, 2014

GIS 5103 Module 8: Working with Rasters

This week saw us experiment with manipulating raster data using Python script.  As we did previously with vector data, we learned how to return information on raster files, such as spatial reference and cell size.  Because rasters are often large files, Python script will reference a raster object and create temporary rasters rather than create multiple raster files.  This is efficient, but it does require one to remember to save the final raster, otherwise nothing will remain after the script is complete.  

As in previous modules, our assignment required us to utilize many of the tools learned about in the exercise and expand them a bit further.  After creating a for loop to ensure the Spatial Analyst extension was available, our script needed to go through several steps.  First, it needed to use the RemapValue and Reclassify functions to collapse three separate classification of the landcover raster to one.  It then needed to create temporary rasters that would be used to create a final output between specific ranges of slope and aspect.  To do this, we needed to create four temporary rasters.  Two of the rasters were to define the slope range, with one including slope less than the maximum value while the other included slope above the minimum value.  The other two rasters would do the same for aspect.  These four rasters were to be combined, along with the reclassified landcover raster, using the "&" operator.  This would create a final raster with slope and elevation between the specified ranges along with the reclassified landcover data.  This final raster then needed to be saved in order to be permanent.  A screenshot of this raster can be seen above.  We were also required to insert print statements in our script to show in the interactive window the process of the script as it was run (see screenshot below).






No comments:

Post a Comment