Final Flashcards

(26 cards)

1
Q

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

A shapefile in disk, a feature class in a GDB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What function from ArcPy do you use in a script to collect information passed as a parameter from a script tool?

A

GetParameterAsText

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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?

A

AddMessage, AddWarning, AddError

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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.
A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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.

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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.

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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.
A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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
A

project -> layouts -> elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What arcpy module do you have to use to access the map elements of an ArcGIS Project?

A

mp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What data type for a yes/no answer?

A

boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What data type for a number without decimals?

A

long

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What data type for a number with decimals?

A

float

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What data type for a path?

A

folder/workspace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What datatype for the name of a shapefile?

A

string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

To restrict the input from the user on a script tool parameter, what property is needed?

A

filter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

u_row[2] = s_row [0]

17
Q

declare the variable alist as an empty list.

18
Q

add a string “point” to teh variable alist

A

alist.append(“Point”)

19
Q

declare the variable D as a dictionary

20
Q

add the value pair “MUSYM” : 123 to the dictionary D

A

D[“MUSYM”] = 123

21
Q

From the dictionary below, save the value of the “Cleveland” key in variable X.
statelookup = {“Austin”:”Texas”, “Baltimore”:”Maryland”, “Cleveland”:”Ohio”, “Denver”:”Colorado”}

A

x = statelookup[“Cleveland”]

22
Q

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?
A

5 times,
anItem = 2

23
Q

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?
24
Q

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?
A

6 times,
x = ‘X’

25
If you want to extract the substring “2019” from the sp variable below using string slicing, which indexes would you use in the blanks? sp = "IL_2019_fall.shp" sub = sp[ x : y ]
3:7
26
You have the raster file c:\temp\multi_band.tif. This raster dataset has 6 bands with names Band_1, Band_2, all the way to Band_6. You want to create a new raster from Band_4. To achieve this, what value would you assign to the variable raster_dataset in the code below? raster_dataset = output_one_band = r’d:\temp\one_band.tif’ arcpy.CopyRaster_management(raster_dataset, output_one_band)
raster_dataset = r“c:\temp\multi_band.tif\Band_4”