Skip to main content

GIS Programming Module 2

 The focus of module 2 was to identify and fix errors in scripts using built in Spyder functions such as the debugger, and using try/except statements. The lab involved modifying three scripts with pre-existing errors so that they would fulfill run successfully according to the lab instructions. scripts 1 and 2 required all errors to be fixed so the program ran as intended. Script 3 had two parts. The error in Part A was not supposed to be fixed but rather a try except statement was supposed to be used to identify the exception thrown due to the built in error. Following the except statement a print statement was used to say that Part A had failed and give the description of the error. Part B needed to run successfully after the exception was caught in part A.

Script 1:


Flowchart 1:


Script 1 prints out all the field names found in the parks shapefile. For this to work properly the path file needed to be corrected, variable call syntax needed to be fixed to math the variable declaration, and the a for loop syntax had to be corrected.


Script 2:


Flowchart 2:


For Script 2 prints out the spatial reference and all the layers in the ArcProject. To function properly the file paths needed to be corrected, when calling the arcpy module it was spelled wrong, and extraneous code needed removed.  The debugger was needed to identify where the program ran into an OSError.


Script 3:


Flowchart 3:


Script 3 prints out that Part A failed to run and prints out the reason for the error followed by Part B that prints the name, data source, and spatial reference for each of the layers in the ArcProject. To do this Part A needed to be surrounded by a try except statement followed by a print function. The filepaths also had to be corrected.








Comments

Popular posts from this blog

Lab 5: M 2.2 Interpolation

  This weeks module focused on identifying the best interpolation method for modeling the air quality over Tampa Bay. Four methods were tested using the same set of sample points Thiessen, Inverse Weighted Distance (IDW), Tensioned Spline (seen above), Regularized Spline. Thiessen Interpolation assigns all cells in the raster with the value of the nearest sample point. IDW calculates the value of all cells by considered multiple sample points nearby and giving closer points a higher weight than further points. Both Spline methods create a smooth surface over the sample points but the regularized version creates a smooth curvature regardless of the range of values in the sample meaning cell values can end up both above and below the minimum and maximum values found in the sample. The tension model attempts to fix this by constricted the curvature of values to the ranges found in the sample points.

Module 2 Lab: Land Use / Land Cover Classification, Ground Truthing and Accuracy Assessment

  The above map shows digitized land use/land cover (LULC) classifications for Pascagoula, MS. A set of 30 random sampling points were created post creation of the LULC layer and they were verified in google street view to determine accuracy. Based on these points the LULC model was found to be 86.6% accurate.

Applications in GIS Module 2

 This weeks module focused on using LiDAR data to determine the height and density of a section of Shenandoah National Forest in Virginia. Mostly this involved converting the LiDAR data to a raster and running various tools to achieve the desired datasets. New tools included LAS Dataset To Raster, LAS to MultiPoint, Con, Plus, Float, and Divide. Additionally a histogram was created to display the heights of cells in the forest. Density and DSM: Height with Graph: LiDAR: