Tuesday, July 19, 2016

Working with Rasters

In this week's lab, we worked with rasters and the arcpy.sa module. We were asked to write a code that would reassign values to an assigned raster, as well as reclassify those values to the raster. We created temporary rasters for Slope and Aspect, performed calculation statements from them, and combined the results of those calculations with the reclassified raster to create the raster output below. We created this code all within an if/else statement for checking the Spatial Analyst Extension, as these wont compile unless you have a license for it.

Here is a screenshot of my output raster below:

Here is a flowchart for my script below:

This is the step I had the most difficulty with:
1.       I had the most difficulty with the Slope and Aspects statements in part f of step 3.
2.       I kept getting only 0 (in other words, one solid color on my raster) as a result in my output raster, as it would only recognize the landcover raster.
3.       I realized I was missing my Aspect variable before the four temporary statements (I had the Slope variable already made, I guess I overlooked Aspect somehow), also I had to capitalize Slope and Aspect in the variable assignment and the four statements.

No comments:

Post a Comment