This lab uses Python and PyScripter to create a script that is able to find a hand full of raster in a file, project the rasters to an appropriate coordinate system so that it is possible to clip the rasters to the study area. This script also runs the Hillshade tool and calculates the slope of the rasters. Lastly the script ends by mosaicing the rasters together so that there is 3 DEMs, Elevation, Hillshade and Slope.
Methods
In order to run all of the process for the rasters lists were created. Lists allow for the storage of many files in one line of code. So in this case there were three lists clipList, hsList, and slopeList. After each raster goes through the process that each list describes it gets stored in that list. In order to get this script to run the various different rasters continuously through the three different functions a FOR IN loop was used. This loops allows for functions to be ran over and over so long as there is a new feature for the function to be used on. Once all the rasters went through the loop and were stored in the 3 different lists they were then mosaiced together to create the final product. Figures 1.1, 1.2 and 1.3 show the script that was used.
(Figure 1.1: Part 1 of the Script)
(Figure 1.2: Part 2 of the Script)
(Figure 1.3: Part 3 of the Script)
Conclusion
Figure 2.1, 2.2 and 2.3 show the final mosaiced rasters that were created by the script.
(Figure 2.1: Elevation)
(Figure 2.2: Hillshade)
(Figure 2.3: Slope)
No comments:
Post a Comment