FromWKB (arcpy)

Zusammenfassung

Create a new Geometry object from a well-known binary (WKB) string stored in a Python bytearray.

Syntax

FromWKB (byte_array)
ParameterErläuterungDatentyp
byte_array

A WKB string stored in a Python bytearray.

Bytearray
Rückgabewert
DatentypErläuterung
Geometry

FromWKB returns a geometry object (PointGeometry, Multipoint, Polyline, or Polygon) based on the input bytearray.

Codebeispiel

FromWKB example

This example illustrates the use of converting a WKB to a geometry object.

import arcpy

fc = "c:/base/gdb.gdb/counties"

rows = arcpy.da.SearchCursor(fc, ['SHAPE@'])
studyarea = rows.next()[0]

# Create geometry to WKB
#
polyWKB = studyarea.WKB

# Convert WKB back to a geometry
#
polyGeom = arcpy.FromWKB(polyWKB)

Verwandte Themen

9/11/2013