Wednesday, June 24, 2020

Module 7: Rasters



     This week's lab required us to create a raster through geoprocessing and map algebra. We were tasked with writing code that would reclassify the values of a landcover raster dataset. We also used the Slope and Aspect functions to find the slope and aspect values from an elevation raster. These slope and aspect values were then used to create four temporary rasters using map algebra. These four temporary rasters were meant to select for specific ranges in both slope and aspect. The four slope and aspect rasters were combined with the reclassified landcover raster using ampersands (&). The lab culminated with us saving this final raster, pictured above (top). The flowchart for my script is shown above (bottom) as well.
     The most difficult part of this lab was saving the final raster. I received an error stating that the raster had no tif attribute. I placed the file extension before the .save function (finalrast.tif.save(S:\GIS_Programming\...)). This returned an invalid pointer error. I then began searching online to look for similar issues and found a thread on stack overflow. Following the advice I found on the thread, I moved the file extension to the end of the file path (...\Results.tif). This allowed me to save the raster; however, it saved in the wrong location. I solved the issue by adding the file name to the file path before the extension (..\Results\FinalRaster.tif).

No comments:

Post a Comment