x Returns the X coordinate of this point: >>> OGRGeometry('POINT (1 2)').x 1.0
num Returns the number corresponding to the OGR geometry type: >>> gt1.num 3
__len__() Returns the number of points in a LineString, the number of rings in a Polygon, or the number of geometries in a GeometryCollection. Not applicable to other geometry types.
name Returns a short-hand string form of the OGR Geometry type: >>> gt1.name 'Polygon'
class OGRGeomType(type_input) This class allows for the representation of an OGR geometry type in any of several ways: >>> from django.contrib.gis.gdal import OGRGeomType >>> gt1 = OGRGeomType(3) # Using an integer for the type >>> gt2 = OGRGeomType('Polygon') # Using a string >>> gt3 = OGRGeomType('POLYGON') # It's case-insensitive >>> print(gt1 == 3, gt1 == 'Polygon') # Equivalence works w/non-OGRGeomType objects True True
django Returns the Django field type (a subclass of GeometryField) to use for storing this OGR type, or None if there is no appropriate Django type: >>> gt1.django 'PolygonField'
wkb_size Returns the size of the WKB buffer needed to hold a WKB representation of this geometry: >>> OGRGeometry('POINT(1 2)').wkb_size 21
wkb Returns a buffer containing a WKB representation of this geometry.
wkt Returns a string representation of this geometry in WKT format.
__getitem__() Returns the point at the specified index for a LineString, the interior ring at the specified index for a Polygon, or the geometry at the specified index in a GeometryCollection. Not applicable to other geometry types.
Page 98 of 226