class documentation

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 __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 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 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...
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 __class__ Undocumented
Instance Variable ptr Undocumented
Instance Variable srs 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.
Class Method _from_wkb Undocumented
Static Method _from_json Undocumented
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.

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): (source)

Construct a Polygon from a bounding box (4-tuple).

@classmethod
def from_gml(cls, gml_string): (source)

Undocumented

@staticmethod
def from_json(geom_input): (source)

Undocumented

def __and__(self, other): (source)

Return the intersection of this Geometry and the other.

def __eq__(self, other): (source)

Is this Geometry equal to the other?

def __getstate__(self): (source)

Undocumented

def __init__(self, geom_input, srs=None): (source)

Initialize Geometry on either WKT or an OGR pointer as input.

def __or__(self, other): (source)

Return the union of the two geometries.

def __setstate__(self, state): (source)

Undocumented

def __str__(self): (source)

WKT is used for the string representation.

def __sub__(self, other): (source)

Return the difference this Geometry and the other.

def __xor__(self, other): (source)

Return the symmetric difference of this Geometry and the other.

def clone(self): (source)

Clone this OGR Geometry.

def close_rings(self): (source)

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): (source)

Return True if this geometry contains the other.

def crosses(self, other): (source)

Return True if this geometry crosses the other.

def difference(self, other): (source)

Return a new geometry consisting of the region which is the difference of this geometry and the other.

def disjoint(self, other): (source)

Return True if this geometry and the other are spatially disjoint.

def equals(self, other): (source)

Return True if this geometry is equivalent to the other.

def intersection(self, other): (source)

Return a new geometry consisting of the region of intersection of this geometry and the other.

def intersects(self, other): (source)

Return True if this geometry intersects with the other.

def overlaps(self, other): (source)

Return True if this geometry overlaps the other.

def sym_difference(self, other): (source)

Return a new geometry which is the symmetric difference of this geometry and the other.

def touches(self, other): (source)

Return True if this geometry touches the other.

def transform(self, coord_trans, clone=False): (source)

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): (source)

Return a new geometry consisting of the region which is the union of this geometry and the other.

def within(self, other): (source)

Return True if this geometry is within the other.

coord_dim = (source)

Undocumented

Undocumented

__class__ = (source)

Undocumented

Undocumented

Return the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise.

Return the boundary of this geometry.

@property
convex_hull = (source)

Return the smallest convex Polygon that contains all the points in this Geometry.

Return 0 for points, 1 for lines, and 2 for surfaces.

Undocumented

Return the envelope for this Geometry.

Return the EWKT representation of the Geometry.

Return the envelope as a 4-tuple, instead of as an Envelope object.

Return the number of elements in this Geometry.

Return the Name of this Geometry.

Return the Type for this Geometry.

Return a GEOSGeometry object from this OGRGeometry.

Return the GML representation of the Geometry.

Return the hexadecimal representation of the WKB (a string).

Return the GeoJSON representation of this Geometry.

Return the KML representation of the Geometry.

Alias for `point_count`.

Alias for `point_count` (same name method in GEOS API.)

Return the WKB representation of the Geometry.

Return the size of the WKB buffer.

Return the WKT representation of the Geometry.

@classmethod
def _from_wkb(cls, geom_input): (source)

Undocumented

@staticmethod
def _from_json(geom_input): (source)

Undocumented

def _geomgen(self, gen_func, other=None): (source)

A helper routine for the OGR routines that generate geometries.

def _geos_ptr(self): (source)

Undocumented

def _get_coord_dim(self): (source)

Return the coordinate dimension of the Geometry.

def _get_srid(self): (source)

Undocumented

def _get_srs(self): (source)

Return the Spatial Reference for this Geometry.

def _set_coord_dim(self, dim): (source)

Set the coordinate dimension of this Geometry.

def _set_srid(self, srid): (source)

Undocumented

def _set_srs(self, srs): (source)

Set the SpatialReference for this geometry.

def _topology(self, func, other): (source)

A generalized function for topology operations, takes a GDAL function and the other geometry to perform the operation on.