Final Flashcards
(26 cards)
Which items below do not provide symbology information for a layer?
A layer file (.lyr) A shapefile in disk. A feature class in a geodatabase. A layer object obtained with the ListLayers function from the mapping function. A layer object obtained from a lyr file.
A shapefile in disk, a feature class in a GDB
What function from ArcPy do you use in a script to collect information passed as a parameter from a script tool?
GetParameterAsText
When converting a standalone script to a script that is part of a tool in ArcGIS Pro, what could you replace the print statements with?
AddMessage, AddWarning, AddError
For each of the following scenarios below, where you must write a Python script, specify if you absolutely need an ArcGIS Project file to perform the operation:
A script that uses a SelectLayerByLocation function.
No
For each of the following scenarios below, where you must write a Python script, specify if you absolutely need an ArcGIS Project file to perform the operation:
A script that merges two feature classes.
No
For each of the following scenarios below, where you must write a Python script, specify if you absolutely need an ArcGIS Project file to perform the operation:
A script that uses a SelectLayerByLocation function, and that exports a map showing the selected features.
Yes
For each of the following scenarios below, where you must write a Python script, specify if you absolutely need an ArcGIS Project file to perform the operation:
A script that uses the Walk method to send to the printer already created maps in PDF format in a specific folder.
No
What is the correct sequence of functions to access the text elements of a layout in an ArcGIS Project?
listProjects, listLayers, listElements. listMaps, listLayouts, listElements. ArcGIS Project, listMaps, listLayers, listElements. ArcGIS Project, listLayouts, listElements
project -> layouts -> elements
What arcpy module do you have to use to access the map elements of an ArcGIS Project?
mp
What data type for a yes/no answer?
boolean
What data type for a number without decimals?
long
What data type for a number with decimals?
float
What data type for a path?
folder/workspace
What datatype for the name of a shapefile?
string
To restrict the input from the user on a script tool parameter, what property is needed?
filter
In the update cursor for loop above, what would you type if you wanted to set the value of the field par_no equal to the value from the field parcel_no?
s_cursor = arcpy.da.SearchCursor(fc, [“parcel_no”, “owner”, “type”], q)
for s_row in s_cursor:
u_cursor = arcpy.da.UpdateCursor(table, [“block”, “tract”, “par_no”])
for u_row in u_cursor:
YOUR ANSWER
u_cursor.updateRow(u_row)
del u_row
del u_cursor
u_row[2] = s_row [0]
declare the variable alist as an empty list.
alist = []
add a string “point” to teh variable alist
alist.append(“Point”)
declare the variable D as a dictionary
D = {}
add the value pair “MUSYM” : 123 to the dictionary D
D[“MUSYM”] = 123
From the dictionary below, save the value of the “Cleveland” key in variable X.
statelookup = {“Austin”:”Texas”, “Baltimore”:”Maryland”, “Cleveland”:”Ohio”, “Denver”:”Colorado”}
x = statelookup[“Cleveland”]
Based on the code lines below,
aSeq = range(5) for anItem in aSeq: print (f"Starting process with element {anItem}...") ....... ....... How many times will the loop iterate? What will be the value of anitem in the third iteration?
5 times,
anItem = 2
Based on the code lines below,
aSeq = range(5) for anItem in aSeq: print (f"Starting process with element {anItem}...") ....... ....... Will the value of aSeq change as the loop is processing?
No
Based on the code lines below,
aList = [134, 8, 'X', 'B', 9, aLayer] for x in aList: print (f"Starting process with element {x}...") ....... ....... How many times will the loop iterate? What will be the value of the variable x in the third iteration?
6 times,
x = ‘X’