class OGRGeomType(type_input)
This class allows for the representation of an OGR geometry type in any of several ways:
1 2 3 4 5 6 | >>> 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 |
-
name
Returns a short-hand string form of the OGR Geometry type:
1 2 | >>> gt1.name 'Polygon' |
-
num
Returns the number corresponding to the OGR geometry type:
1 2 | >>> gt1.num 3 |
-
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:
1 2 | >>> gt1.django 'PolygonField' |
Please login to continue.