O GoConqr está de visual novo! Conte para nós o que você achou.

Quiz

GEOM 73 - Python Quiz 3

Maggie Samson 10 perguntas 5,0 (2 avaliações)

Fazer o quiz

Perguntas do quiz (10)

  1. 1Which cursors of the arcpy.da module can be used to work with geometry objects using SHAPE@?
    1. ASearchCursor, UpdateCursor, and InsertCursor
    2. BInsertCursor only
    3. CSearchCursor only
    4. DUpdateCursor only
    5. EUpdateCursor and InsertCursor
  2. 2Which of the following is not a geometry token in ArcPy?
    1. ASHAPE@
    2. BSHAPE@CENTROID
    3. CSHAPE@XY
    4. DSHAPE@LENGTH
  3. 3What is the main reason to use geometry tokens instead of SHAPE@?
    1. AWorking with the full geometry objects of large datasets can be very slow
    2. BYou only need SHAPE@ to create new features, not to read properties of existing ones
    3. CGeometry tokens give you access to the individual vertices of geometry objects, while SHAPE@ only gives you the entire geometry object
    4. DSome feature classes do not have a SHAPE field and using geometry tokens is the only option
  4. 4When using geometry tokens in a search cursor for single part polylines and polygons, what does the search cursor return for each row in the feature attribute table?
    1. Aan array of point objects
    2. Ban array containing an array of point objects
    3. Ca list of point objects
    4. Da list containing a list of point objects
  5. 5Consider the following script, in particular line 8 that uses getPart (0):

    import arcpy
    from arcpy import env
    env.workspace = "C:/Data"
    fc = "roads.shp"
    cursor = arcpy.da.SearchCursor (fc, ["OID@", "SHAPE@"])
    for row in cursor:
    print ("Feature {0}: ".format (row[0]))
    for point in row[1].getPart (0):
    print ("{0}, {1}".format (point.X, point.Y))

    Why is getPart (0) needed here, even if the features are all single part?
    1. AFor polylines and polygons, the cursor returns the parts of a geometry object as an array, so for single part features you need to get the first (and only) part
    2. BIf you don't use getPart, all vertices for the entire feature class would print together and you would not be able to tell which vertices belong to which feature.
    3. CThe use of getPart makes it possible to use the same script for point, polyline and polygon features.
    4. DAll geometry objects consist of arrays of points, so get at the individual points you need to examine the parts.
  6. 6Which property(ies) of a geometry objects is (are) used to determine whether a specific feature is multipart or single part?
    1. ApartCount
    2. Btype
    3. CisMultipart
    4. DpointCount
    5. EshapeType
  7. 7Some polygon features contain 'holes'. When you work with geometry objects for such polygons, how can you determine whether these holes are present?Imagem da pergunta 7
    1. Athe geometry property ringCount is greater than 1 for polygons with holes
    2. Byou can use the geometry property isExterior to determine whether an array of point objects is an exterior or interior ring
    3. Cthe shapeType property of the geometry object is MultiPatch instead of Polygon
    4. Dthe array of point objects for a feature contains 'null point objects' which seperate the exterior and interior rings
  8. 8Consider a scenario where you write a script to create a new polyline out of a text file with coordinates for the vertices. You will need to use a cursor object to create new geometry objects. Which of the following is the correct line of code to set up your cursor object?
    1. Acursor = arcpy.da.UpdateCursor(fc, ["SHAPE@"])
    2. Bcursor = arcpy.da.InsertCursor(fc, "SHAPE@XY")
    3. Ccursor = arcpy.da.InsertCursor(fc, "SHAPE@")
    4. Dcursor = arcpy.da.UpdateCursor(fc, ["SHAPE@XY"])
    5. Ecursor = arcpy.da.InsertCursor (fc, ["SHAPE@XY"])
    6. Fcursor = arcpy.da.UpdateCursors(fc, ["SHAPE@XY"])
  9. 9Consider the following script to print the coordinates of the vertices of the features of a feature class.

    import arcpy

    from arcpy import env

    env.workspace = "C:/Data"

    fc = "features.shp"

    cursor = arcpy.da.SearchCursor(fc, ["OID@", "SHAPE@"])

    for row in cursor:

    print ("Feature {0}: ".format(row[0]))

    partnum = 0

    for part in row[1]:

    print ("Part {0}:".format(partnum))

    for point in part:

    print ("{0}, {1}".format(point.X, point.Y))

    partnum += 1

    For which types of datasets will this script work correctly? (check all that apply)
    1. ASingle-part point features
    2. BMulti-part point features
    3. CMulti-part polygon features with holes
    4. DMulti-part polyline and polygon features
    5. ESingle-part polyline and polygon features
    6. FSingle-part polygon features with holes
  10. 10Consider the following script to print the coordinates of the vertices of the features of a feature class.

    import arcpy

    from arcpy import env

    env.workspace = "C:/Data"

    fc = "features.shp"

    cursor = arcpy.da.SearchCursor(fc, ["OID@", "SHAPE@"])

    for row in cursor:

    print ("Feature {0}: ".format(row[0]))

    partnum = 0

    for part in row[1]:

    print ("Part {0}:".format(partnum))

    for point in part:

    print ("{0}, {1}".format(point.X, point.Y))

    partnum += 1

    Line 10 of the code reads 'for part in row[1]:'. Why does the code use row[1] instead of just row?
    1. Abecause you only want to obtain the first part of the geometry object
    2. Bbecause the search cursor returns a list and row[1] obtains the geometry object
    3. Cbecause the script is only designed to work for single part features
    4. Dbecause the search cursor returns a list and row[1] obtains the list of coordinates
    5. Ebecause you want to start numbering the parts of each features at 1

Informações

Descrição
Geography Quiz sobre GEOM 73 - Python Quiz 3, criado por Maggie Samson em 13-04-2019.
Idioma
English
Visualizações
172
Avaliação
5,0 de 5 · 2 avaliações
Avalie este quiz
Avalie este quiz

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?