Maggie Samson
Quiz by , created more than 1 year ago

Geography Quiz on GEOM 73 - Python Quiz 1, created by Maggie Samson on 13/04/2019.

106
2
0
Maggie Samson
Created by Maggie Samson over 5 years ago
Close

GEOM 73 - Python Quiz 1

Question 1 of 10

1

What is the difference between a site package (like ArcPy) and a module in Python?

Select one of the following:

  • A site package needs to be imported into a script

  • A site package is created by a 3rd party

  • A site package is installed by default as part of the regular Python installation

  • A site package contains multiple modules, as well as classes and functions

Explanation

Question 2 of 10

1

Which of the following represents older Python scripts written before ArcPy was introduced in version 10 of ArcGIS Desktop? (check all that apply)

Select one or more of the following:

  • import geoprocessing
    gp = geoprocessing.create()

  • import ArcGISscripting
    gp = ArcGISscripting.create()

  • import arcgispython
    gp = arcgispython.client(9.3)

  • import win32com.client
    gp = win32com.client.Dispach("...")

Explanation

Question 3 of 10

1

Consider the following code

import arcpy
arcpy.env.workspace = "C:/Data"

In the second line of code, workspace is a __ of the env __.

Select one of the following:

  • parameter, function

  • parameter, class

  • function, module

  • function, class

  • property, module

  • object, class

  • property, class

Explanation

Question 4 of 10

1

Which of the following are typical properties of geoprocessing tool parameters? (select all that apply)

Select one or more of the following:

  • Direction (input or output)

  • Environment settings (e.g. coordinate system, workspace)

  • Data type (e.g. feature class, raster, string)

  • Required or optional

  • Name

  • Unit (e.g. m, km, degrees)

Explanation

Question 5 of 10

1

Which of the following is not a way to skip optional parameters when running a geoprocessing tool in ArcPy?

Select one of the following:

  • Create a list of parameters and resorting the list in the geoprocessing tool.

  • Bypassing optional parameters by specifying the parameter of interest by name.

  • Setting optional parameters to an empty string ("").

  • Setting optional parameters to the number sign (#).

Explanation

Question 6 of 10

1

Which of the following is(are) correct to run the clip tool? (check all that apply)

Select one or more of the following:

  • import arcpy
    arcpy.env.workspace("C:/data")
    arcpy.analysis_Clip("roads.shp", "boundary.shp", "result.shp")

  • import arcpy
    arcpy.env.workspace("c:/data")
    arcpy.analysis.Clip("roads.shp", "boundary.shp", "result.shp")

  • import arcpy
    arcpy.env.workspace("c:/data")
    arcpy.Clip.analysis("roads.shp", "boundary.shp", "result.shp")

  • import arcpy
    arcpy.env.workspace("c:/data")
    arcpy.Clip_analysis("roads.shp", "boundary.shp", "result.shp")

Explanation

Question 7 of 10

1

All functions in ArcPy are tools in ArcToolbox

Select one of the following:

  • True
  • False

Explanation

Question 8 of 10

1

Which of the following correctly describes the general syntax for a function in ArcPy?

Select one of the following:

  • arcpy.<functionname>.<arguments>

  • arcpy_<functionname>_<arguments>

  • arcpy.<functionname>(<argumnets>)

  • arcpy.<functionname>_<arguments>

  • arcpy_<functionname>(<arguments>)

Explanation

Question 9 of 10

1

Consider the following code:

import arcpy
myprj = "c:/data/example.prj"
spatialref = arcpy.SpatialReference(myprj)

In the last line of code, myprj is a __ of the SpatialReference __.

Select one of the following:

  • function, module

  • function, class

  • property, class

  • property, module

  • parameter, class

  • parameter, function

Explanation

Question 10 of 10

1

Which of the following is used to retrieve all error messages from executing a geoprocessing tool?

Select one of the following:

  • print arcpy.GetMessages()

  • print arcpy.GetMessage(2)

  • print arcpy.GetMessage()

  • print arcpy.GetMessages(2)

  • print arcpy.GetMessages(1)

  • print arcpy.GetMessage(1)

Explanation