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

GIS 6005 - Module 6

  Because the data provided for the above map contained positive and negative values which ArcMap does not support for proportional symbols, the data had to be modified. All states with positive values were exported to a new shapefile and the same was done with states with negative values. This was all that needed done with the positive valued states. However, for the negative valued states a new field needed added to the attribute table and it had to be populated with the absolute value of number of jobs lost to convert them to positive integers.  To prepare the data for bivariate visualization classes needed to be made. To do this, three class quantification was applied to each desired variable to divide each into three relatively equal groups. Then all values in the first group of the first variable were classified with an 'A', then the second group was given a 'B', and the third was given a 'C'. the same thing was done with the second variable however 1, 2 ,...

GIS 6005 - Module 1

  General: General features were given large black font with a small white halo to increase legibility and visual contrast. The font size is the largest of any font on the relevant feature. The text was placed in a central location without overlapping other labeled features or important data. Water Features: Water features were given dark blue italic serif font. The color chosen was dark enough to allow legibility and contrast with the light blue water background.   For the Golden Gate and San Francisco Bay labels they are placed in a central location within the water feature at a level angle with the page. The Lake Merced label was angled to line up and be contained within the lake. Park Names: Park labels were given a dark green color with a thin white halo to allow visibility and contrast while still keeping the labels intuitive. Font size was chosen to keep the labels within the boundaries of the park. However, due to the shape of Lincoln Park the label overhangs how...

M1 Lab: Map Critique

     This modules lesson topic was the history of cartography and appropriate map design principles. The lab for this module involved looking through many maps to find one well-designed map and one poorly-designed maps in an effort to develop our own individual cartographic design styles that align with the design principles. My two maps and evaluation are as follows. Map Evaluation Template   Well-designed map:   Synopsis: This map shows the six Wildlife Management Area Game Zones in South Carolina. It can be used Wildlife management professionals or hunters. I think the data to ink ratio has been nearly maximized. The zones being numbered outside the legend is redundant but makes the map easier to read at a glance. There is nothing misleading, the data is substantial, and clutter is minimized to the essentials. For these reasons I think this is a well-designed map.   Answer the following questions for the well-designed map: General ▪ ...