class documentation

class OGRGeometry(GDALBase):

Known subclasses: django.contrib.gis.gdal.geometries.GeometryCollection, django.contrib.gis.gdal.geometries.LineString, django.contrib.gis.gdal.geometries.Point, django.contrib.gis.gdal.geometries.Polygon

View In Hierarchy

Encapsulate an OGR geometry.
Class Method from​_bbox Construct a Polygon from a bounding box (4-tuple).
Class Method from​_gml Undocumented
Static Method from​_json Undocumented
Method clone Clone this OGR Geometry.
Method close​_rings If there are any rings within this geometry that have not been closed, this routine will do so by adding the starting point at the end.
Method contains Return True if this geometry contains the other.
Method crosses Return True if this geometry crosses the other.
Method difference Return a new geometry consisting of the region which is the difference of this geometry and the other.
Method disjoint Return True if this geometry and the other are spatially disjoint.
Method equals Return True if this geometry is equivalent to the other.
Method intersection Return a new geometry consisting of the region of intersection of this geometry and the other.
Method intersects Return True if this geometry intersects with the other.
Method overlaps Return True if this geometry overlaps the other.
Method sym​_difference Return a new geometry which is the symmetric difference of this geometry and the other.
Method touches Return True if this geometry touches the other.
Method transform No summary
Method union Return a new geometry consisting of the region which is the union of this geometry and the other.
Method within Return True if this geometry is within the other.
Class Variable coord​_dim Undocumented
Class Variable srid Undocumented
Instance Variable srs Undocumented
Class Method ​_from​_wkb Undocumented
Static Method ​_from​_json Undocumented
Method __and__ Return the intersection of this Geometry and the other.
Method __eq__ Is this Geometry equal to the other?
Method __getstate__ Undocumented
Method __init__ Initialize Geometry on either WKT or an OGR pointer as input.
Method __or__ Return the union of the two geometries.
Method __setstate__ Undocumented
Method __str__ WKT is used for the string representation.
Method __sub__ Return the difference this Geometry and the other.
Method __xor__ Return the symmetric difference of this Geometry and the other.
Method ​_geomgen A helper routine for the OGR routines that generate geometries.
Method ​_geos​_ptr Undocumented
Method ​_get​_coord​_dim Return the coordinate dimension of the Geometry.
Method ​_get​_srid Undocumented
Method ​_get​_srs Return the Spatial Reference for this Geometry.
Method ​_set​_coord​_dim Set the coordinate dimension of this Geometry.
Method ​_set​_srid Undocumented
Method ​_set​_srs Set the SpatialReference for this geometry.
Method ​_topology A generalized function for topology operations, takes a GDAL function and the other geometry to perform the operation on.
Instance Variable __class__ Undocumented
Instance Variable ptr Undocumented
Property area Return the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise.
Property boundary Return the boundary of this geometry.
Property convex​_hull Return the smallest convex Polygon that contains all the points in this Geometry.
Property dimension Return 0 for points, 1 for lines, and 2 for surfaces.
Property empty Undocumented
Property envelope Return the envelope for this Geometry.
Property ewkt Return the EWKT representation of the Geometry.
Property extent Return the envelope as a 4-tuple, instead of as an Envelope object.
Property geom​_count Return the number of elements in this Geometry.
Property geom​_name Return the Name of this Geometry.
Property geom​_type Return the Type for this Geometry.
Property geos Return a GEOSGeometry object from this OGRGeometry.
Property gml Return the GML representation of the Geometry.
Property hex Return the hexadecimal representation of the WKB (a string).
Property json Return the GeoJSON representation of this Geometry.
Property kml Return the KML representation of the Geometry.
Property num​_coords Alias for point_count.
Property num​_points Alias for point_count (same name method in GEOS API.)
Property point​_count Return the number of Points in this Geometry.
Property wkb Return the WKB representation of the Geometry.
Property wkb​_size Return the size of the WKB buffer.
Property wkt Return the WKT representation of the Geometry.

Inherited from CPointerBase (via GDALBase):

Method __del__ Free the memory used by the C++ object.
Method ptr.setter Undocumented
Class Variable destructor Undocumented
Instance Variable ​_ptr Undocumented
@classmethod
def from_bbox(cls, bbox):
Construct a Polygon from a bounding box (4-tuple).
@classmethod
def from_gml(cls, gml_string):

Undocumented

@staticmethod
def from_json(geom_input):

Undocumented

def clone(self):
Clone this OGR Geometry.
def close_rings(self):
If there are any rings within this geometry that have not been closed, this routine will do so by adding the starting point at the end.
def contains(self, other):
Return True if this geometry contains the other.
def crosses(self, other):
Return True if this geometry crosses the other.
def difference(self, other):
Return a new geometry consisting of the region which is the difference of this geometry and the other.
def disjoint(self, other):
Return True if this geometry and the other are spatially disjoint.
def equals(self, other):
Return True if this geometry is equivalent to the other.
def intersection(self, other):
Return a new geometry consisting of the region of intersection of this geometry and the other.
def intersects(self, other):
Return True if this geometry intersects with the other.
def overlaps(self, other):
Return True if this geometry overlaps the other.
def sym_difference(self, other):
Return a new geometry which is the symmetric difference of this geometry and the other.
def touches(self, other):
Return True if this geometry touches the other.
def transform(self, coord_trans, clone=False):
Transform this geometry to a different spatial reference system. May take a CoordTransform object, a SpatialReference object, string WKT or PROJ, and/or an integer SRID. By default, return nothing and transform the geometry in-place. However, if the clone keyword is set, return a transformed clone of this geometry.
def union(self, other):
Return a new geometry consisting of the region which is the union of this geometry and the other.
def within(self, other):
Return True if this geometry is within the other.
coord_dim =

Undocumented

srid =

Undocumented

srs =

Undocumented

@classmethod
def _from_wkb(cls, geom_input):

Undocumented

@staticmethod
def _from_json(geom_input):

Undocumented

def __and__(self, other):
Return the intersection of this Geometry and the other.
def __eq__(self, other):
Is this Geometry equal to the other?
def __getstate__(self):

Undocumented

def __init__(self, geom_input, srs=None):
Initialize Geometry on either WKT or an OGR pointer as input.
def __or__(self, other):
Return the union of the two geometries.
def __setstate__(self, state):

Undocumented

def __str__(self):
WKT is used for the string representation.
def __sub__(self, other):
Return the difference this Geometry and the other.
def __xor__(self, other):
Return the symmetric difference of this Geometry and the other.
def _geomgen(self, gen_func, other=None):
A helper routine for the OGR routines that generate geometries.
def _geos_ptr(self):

Undocumented

def _get_coord_dim(self):
Return the coordinate dimension of the Geometry.
def _get_srid(self):

Undocumented

def _get_srs(self):
Return the Spatial Reference for this Geometry.
def _set_coord_dim(self, dim):
Set the coordinate dimension of this Geometry.
def _set_srid(self, srid):

Undocumented

def _set_srs(self, srs):
Set the SpatialReference for this geometry.
def _topology(self, func, other):
A generalized function for topology operations, takes a GDAL function and the other geometry to perform the operation on.
__class__ =

Undocumented

ptr =
@property
area =
Return the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise.
@property
boundary =
Return the boundary of this geometry.
@property
convex_hull =
Return the smallest convex Polygon that contains all the points in this Geometry.
@property
dimension =
Return 0 for points, 1 for lines, and 2 for surfaces.
@property
empty =

Undocumented

@property
envelope =
Return the envelope for this Geometry.
@property
ewkt =
Return the EWKT representation of the Geometry.
@property
extent =
Return the envelope as a 4-tuple, instead of as an Envelope object.
@property
geom_count =
Return the number of elements in this Geometry.
@property
geom_name =
Return the Name of this Geometry.
@property
geom_type =
Return the Type for this Geometry.
@property
geos =
Return a GEOSGeometry object from this OGRGeometry.
@property
gml =
Return the GML representation of the Geometry.
@property
hex =
Return the hexadecimal representation of the WKB (a string).
@property
json =
Return the GeoJSON representation of this Geometry.
@property
kml =
Return the KML representation of the Geometry.
@property
num_coords =
Alias for point_count.
@property
num_points =
Alias for point_count (same name method in GEOS API.)
@property
point_count =
Return the number of Points in this Geometry.
@property
wkb =
Return the WKB representation of the Geometry.
@property
wkb_size =
Return the size of the WKB buffer.
@property
wkt =
Return the WKT representation of the Geometry.