Beruflich Dokumente
Kultur Dokumente
PRINT "Welcome to Timothy Blanchard's Multiple Query Analysis of Lunar Craters Python Tool for GIS 540."
DEFINE geologyCorrect(gdb):
SET row correction dictionary with correct spelling as keys for incorrect values
SET workspace to gdb
SET overwrite to TRUE
SET geology list by calling arcpy List Feature Classes
FOR geology in geology list:
SET field list by calling arcpy List Fields
FOR field in field list:
IF field name is Epoch THEN:
FOR correct, incorrect in row correction dictionary:
1
FOR value incorrect list:
Where Epoch row values are incorrect
Initialize cursor at where for geology
FOR row in cursor:
SET correct row value
CALL update cursor for row
ENDFOR
ENDFOR
ENDFOR
ENDIF
ENDFOR
ENDFOR
DEFINE myEpoch():
SET myEpoch to call EpochSelect(root) to initiate callback of EpochSelect
SET epoch button to execute myEpoch command with text "Epoch Selection"
SET epoch button location anchored to center
SET frame for region radio button selection using label text "Select Lunar Region"
SET frame to fill and expand window
SET regionVar to IntVar()
2
SET first radio button in frame for regionVar with text "Near Side" and value 703
SET first radio button location anchored to center
SET first radio button to default selection
SET second radio button in frame for regionVar with text "Right Side" and value 948
SET second radio button location anchored to center
SET third radio button in frame for regionVar with text "Left Side" and value 1034
SET third radio button location anchored to center
SET fourth radio button in frame for regionVar with text "Far Side" and value 1047
SET fourth radio button location anchored to center
SET fifth radio button in frame for regionVar with text "South Pole" and value 1162
SET fifth radio button location anchored to center
SET sixth radio button in frame for regionVar with text "North Pole" and value 1062
SET sixth radio button location anchored to center
CALL SubmitButton(root)
CALL root.mainloop()
SET region dictionary with file name keys and region name values
Find matching region from widget selection
FOR r in matching region:
SET decoded region to r recoded from Unicode to ASCII
ENDFOR
SET epoch search expression to "Epoch = '{0}'".format(epoch)
SET region layer variable
SET region output variable
CALL arcpy Make Feature Layer management for decoded region and region layer
3
CALL arcpy Select Layer by Attribute: new selection from region layer with expression
CALL arcpy Copy Features for region layer to region output
CALL arcpy Get Count to set count integer for region layer selection
CALL split on decoded region for \\ and set as rDList
CALL join on rDList with / and set as decoded region
IF count is zero:
Warning: "Surface areas from the '{0}' epoch do not exist in the {1} region."
.format(epoch, regionDict[regionDecoded])
END
ELSIF:
PRINT str(count) + " surface areas were found in the {0}
region.".format(regionDict[regionDecoded])
ENDIF
PRINT "Search finished, preparing results..."
CALL arcpy Make Feature Layer for crater output to "Craters from selected range"
CALL arcpy Make Feature Layer for region output to "Selected Epochs in Region"
CALL arcpy Make Feature Layer for intersect output to "Craters Found"
CALL arcpy mapping Layer on "Selected Epochs in Region" to set region map add
CALL arcpy mapping Add Layer to add region to data frame
CALL arcpy mapping Layer on "Craters from selected range" to set craters map add
CALL arcpy mapping Add Layer to add craters to data frame
CALL arcpy mapping Layer on "Craters Found" to set found craters map add
SET found symbology from dataPath + "\\foundcraters_symbology.lyr"
CALL Apply Symbology From Layer management to set found crater symbology
CALL arcpy mapping Add Layer to add found craters to data frame
4
SET footer
SET html results file location
OPEN html file for writing
WRITE to html file the header, body, results table, column break, image tag, and footer
CLOSE html file