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

Module 5 - Unsupervised and Supervised Image Classification

  This weeks module focused on classifying images using multispectral signatures. Above you can see the completed classified land cover of Germantown, Maryland. To create this image above signatures were collected that correlated to each required feature. Then bands were chosen (R:4 G:6 B:5) that contained the largest separation amongst features to minimize spectral confusion. In the above image roads and urban areas were often confused leading to a much larger area of roads than actually exist. The inset map contains a classification distance map which displays the distance each cell is (spectrally) from the sample points with brighter pixels being further than darker pixels. This indicates that brighter areas have a higher chance of error.

Lab 3: M 1.3 Assessment

 

Lab 2: M1.2 Standards

  The task for this module was to perform an accuracy assessment on two versions of the same road network in Albuquerque. One was mapped by the city of Albuquerque (yellow) and one by Street Map USA (red). In order to perform the accuracy assessment twenty points per network needed created at matching intersections on each network. Then a reference point was digitized based on satellite imagery to represent the "actual" location for each intersection. XY coordinates were assigned to all sixty of the created points and the values were exported to an excel spreadsheet. From there the RMSE for each of the networks were calculated using the reference points. With this the accuracy assessment was completed resulting in the following: ABQ_Streets Positional Accuracy: Tested 14.84 feet horizontal accuracy at 95% confidence level. StreetMapUSA Positional Accuracy: Tested 158.56 feet horizontal accuracy at 95% confidence level.