class documentation

Undocumented

Class Method from_gml Undocumented
Static Method from_ewkt Undocumented
Method __and__ Return the intersection of this Geometry and the other.
Method __copy__ Return a clone because the copy of a GEOSGeometry may contain an invalid pointer location if the original is garbage collected.
Method __deepcopy__ The `deepcopy` routine is used by the `Node` class of django.utils.tree; thus, the protocol routine needs to be implemented to return correct copies (clones) of these GEOS objects, which use C pointers.
Method __eq__ Equivalence testing, a Geometry may be compared with another Geometry or an EWKT representation.
Method __getstate__ Undocumented
Method __hash__ Undocumented
Method __init__ Undocumented
Method __or__ Return the union of this Geometry and the other.
Method __repr__ Short-hand representation because WKT may be very large.
Method __setstate__ Undocumented
Method __str__ EWKT 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 buffer Return a geometry that represents all points whose distance from this Geometry is less than or equal to distance. Calculations are in the Spatial Reference System of this Geometry. The optional third parameter sets the number of segment used to approximate a quarter circle (defaults to 8)...
Method buffer_with_style Same as buffer() but allows customizing the style of the buffer.
Method clone Clone this Geometry.
Method contains Return true if other.within(this) returns true.
Method covers Return True if the DE-9IM Intersection Matrix for the two geometries is T*****FF*, *T****FF*, ***T**FF*, or ****T*FF*. If either geometry is empty, return False.
Method crosses Return true if the DE-9IM intersection matrix for the two Geometries is T*T****** (for a point and a curve,a point and an area or a line and an area) 0******** (for two curves).
Method difference Return a Geometry representing the points making up this Geometry that do not make up other.
Method disjoint Return true if the DE-9IM intersection matrix for the two Geometries is FF*FF****.
Method distance Return the distance between the closest points on this Geometry and the other. Units will be in those of the coordinate system of the Geometry.
Method equals Return true if the DE-9IM intersection matrix for the two Geometries is T*F**FFF*.
Method equals_exact Return true if the two Geometries are exactly equal, up to a specified tolerance.
Method intersection Return a Geometry representing the points shared by this Geometry and other.
Method intersects Return true if disjoint return false.
Method make_valid Attempt to create a valid representation of a given invalid geometry without losing any of the input vertices.
Method normalize Convert this Geometry to normal form (or canonical form). If the `clone` keyword is set, then the geometry is not modified and a normalized clone of the geometry is returned instead.
Method overlaps Return true if the DE-9IM intersection matrix for the two Geometries is T*T***T** (for two points or two surfaces) 1*T***T** (for two curves).
Method relate Return the DE-9IM intersection matrix for this Geometry and the other.
Method relate_pattern Return true if the elements in the DE-9IM intersection matrix for the two Geometries match the elements in pattern.
Method simplify Return the Geometry, simplified using the Douglas-Peucker algorithm to the specified tolerance (higher tolerance => less points). If no tolerance provided, defaults to 0.
Method srid.setter Set the SRID for the geometry.
Method sym_difference Return a set combining the points in this Geometry not in other, and the points in other not in this Geometry.
Method touches Return true if the DE-9IM intersection matrix for the two Geometries is FT*******, F**T***** or F***T****.
Method transform Requires GDAL. Transform the geometry according to the given transformation object, which may be an integer SRID, and WKT or PROJ string. By default, transform the geometry in-place and return nothing. ...
Method union Return a Geometry representing all the points in this Geometry and other.
Method within Return true if the DE-9IM intersection matrix for the two Geometries is T*F**F***.
Class Variable has_cs Undocumented
Instance Variable __class__ Undocumented
Instance Variable ptr Undocumented
Instance Variable srid Get the SRID for the geometry. Return None if no SRID is set.
Property area Return the area of the Geometry.
Property boundary Return the boundary as a newly allocated Geometry object.
Property centroid The centroid is equal to the centroid of the set of component Geometries of highest dimension (since the lower-dimension geometries contribute zero "weight" to the centroid).
Property convex_hull Return the smallest convex Polygon that contains all the points in the Geometry.
Property coord_seq Return a clone of the coordinate sequence for this Geometry.
Property crs Alias for `srs` property.
Property dims Return the dimension of this Geometry (0=point, 1=line, 2=surface).
Property empty Return a boolean indicating whether the set of points in this Geometry are empty.
Property envelope Return the envelope for this geometry (a polygon).
Property ewkb Return the EWKB representation of this Geometry as a Python buffer. This is an extension of the WKB specification that includes any SRID value that are a part of this geometry.
Property ewkt Return the EWKT (SRID + WKT) of the Geometry.
Property extent Return the extent of this geometry as a 4-tuple, consisting of (xmin, ymin, xmax, ymax).
Property geom_type Return a string representing the Geometry type, e.g. 'Polygon'
Property geom_typeid Return an integer representing the Geometry type.
Property hasz Return whether the geometry has a 3D dimension.
Property hex Return the WKB of this Geometry in hexadecimal form. Please note that the SRID is not included in this representation because it is not a part of the OGC specification (use the `hexewkb` property instead).
Property hexewkb Return the EWKB of this Geometry in hexadecimal form. This is an extension of the WKB specification that includes SRID value that are a part of this geometry.
Property json Return GeoJSON representation of this Geometry.
Property kml Return the KML representation of this Geometry.
Property length Return the length of this Geometry (e.g., 0 for point, or the circumference of a Polygon).
Property num_coords Return the number of coordinates in the Geometry.
Property num_geom Return the number of geometries in the Geometry.
Property num_points Return the number points, or coordinates, in the Geometry.
Property ogr Return the OGR Geometry for this Geometry.
Property point_on_surface Compute an interior point of this Geometry.
Property prepared Return a PreparedGeometry corresponding to this geometry -- it is optimized for the contains, intersects, and covers operations.
Property ring Return whether or not the geometry is a ring.
Property simple Return false if the Geometry isn't simple.
Property srs Return the OSR SpatialReference for SRID of this Geometry.
Property unary_union Return the union of all the elements of this geometry.
Property valid Test the validity of this Geometry.
Property valid_reason Return a string containing the reason for any invalidity.
Property wkb Return the WKB (Well-Known Binary) representation of this Geometry as a Python buffer. SRID and Z values are not included, use the `ewkb` property instead.
Property wkt Return the WKT (Well-Known Text) representation of this Geometry.
Class Method _from_wkb Undocumented
Static Method _from_wkt Undocumented
Method _from_pickle_wkb Undocumented
Method _ogr_ptr Undocumented
Method _post_init Perform post-initialization setup.
Method _to_pickle_wkb Undocumented
Method _topology Return Geometry from the given pointer.
Constant _GEOS_CLASSES Undocumented
Instance Variable _cs Undocumented
Instance Variable _ptr Undocumented

Inherited from CPointerBase (via GEOSBase):

Method __del__ Free the memory used by the C++ object.
Method ptr.setter Undocumented
Class Variable destructor Undocumented
@classmethod
def from_gml(cls, gml_string): (source)

Undocumented

@staticmethod
def from_ewkt(ewkt): (source)

Undocumented

def __and__(self, other): (source)

Return the intersection of this Geometry and the other.

def __copy__(self): (source)

Return a clone because the copy of a GEOSGeometry may contain an invalid pointer location if the original is garbage collected.

def __deepcopy__(self, memodict): (source)

The `deepcopy` routine is used by the `Node` class of django.utils.tree; thus, the protocol routine needs to be implemented to return correct copies (clones) of these GEOS objects, which use C pointers.

def __eq__(self, other): (source)

Equivalence testing, a Geometry may be compared with another Geometry or an EWKT representation.

def __getstate__(self): (source)

Undocumented

def __hash__(self): (source)

Undocumented

def __init__(self, ptr, cls): (source)
def __or__(self, other): (source)

Return the union of this Geometry and the other.

def __repr__(self): (source)

Short-hand representation because WKT may be very large.

def __setstate__(self, state): (source)

Undocumented

def __str__(self): (source)

EWKT 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 buffer(self, width, quadsegs=8): (source)

Return a geometry that represents all points whose distance from this Geometry is less than or equal to distance. Calculations are in the Spatial Reference System of this Geometry. The optional third parameter sets the number of segment used to approximate a quarter circle (defaults to 8). (Text from PostGIS documentation at ch. 6.1.3)

def buffer_with_style(self, width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0): (source)

Same as buffer() but allows customizing the style of the buffer. End cap style can be round (1), flat (2), or square (3). Join style can be round (1), mitre (2), or bevel (3). Mitre ratio limit only affects mitered join style.

def clone(self): (source)

Clone this Geometry.

def contains(self, other): (source)

Return true if other.within(this) returns true.

def covers(self, other): (source)

Return True if the DE-9IM Intersection Matrix for the two geometries is T*****FF*, *T****FF*, ***T**FF*, or ****T*FF*. If either geometry is empty, return False.

def crosses(self, other): (source)

Return true if the DE-9IM intersection matrix for the two Geometries is T*T****** (for a point and a curve,a point and an area or a line and an area) 0******** (for two curves).

def difference(self, other): (source)

Return a Geometry representing the points making up this Geometry that do not make up other.

def disjoint(self, other): (source)

Return true if the DE-9IM intersection matrix for the two Geometries is FF*FF****.

def distance(self, other): (source)

Return the distance between the closest points on this Geometry and the other. Units will be in those of the coordinate system of the Geometry.

def equals(self, other): (source)

Return true if the DE-9IM intersection matrix for the two Geometries is T*F**FFF*.

def equals_exact(self, other, tolerance=0): (source)

Return true if the two Geometries are exactly equal, up to a specified tolerance.

def intersection(self, other): (source)

Return a Geometry representing the points shared by this Geometry and other.

def intersects(self, other): (source)

Return true if disjoint return false.

def make_valid(self): (source)

Attempt to create a valid representation of a given invalid geometry without losing any of the input vertices.

def normalize(self, clone=False): (source)

Convert this Geometry to normal form (or canonical form). If the `clone` keyword is set, then the geometry is not modified and a normalized clone of the geometry is returned instead.

def overlaps(self, other): (source)

Return true if the DE-9IM intersection matrix for the two Geometries is T*T***T** (for two points or two surfaces) 1*T***T** (for two curves).

def relate(self, other): (source)

Return the DE-9IM intersection matrix for this Geometry and the other.

def relate_pattern(self, other, pattern): (source)

Return true if the elements in the DE-9IM intersection matrix for the two Geometries match the elements in pattern.

def simplify(self, tolerance=0.0, preserve_topology=False): (source)

Return the Geometry, simplified using the Douglas-Peucker algorithm to the specified tolerance (higher tolerance => less points). If no tolerance provided, defaults to 0. By default, don't preserve topology - e.g. polygons can be split, collapse to lines or disappear holes can be created or disappear, and lines can cross. By specifying preserve_topology=True, the result will have the same dimension and number of components as the input. This is significantly slower.

@srid.setter
def srid(self, srid): (source)

Set the SRID for the geometry.

def sym_difference(self, other): (source)

Return a set combining the points in this Geometry not in other, and the points in other not in this Geometry.

def touches(self, other): (source)

Return true if the DE-9IM intersection matrix for the two Geometries is FT*******, F**T***** or F***T****.

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

Requires GDAL. Transform the geometry according to the given transformation object, which may be an integer SRID, and WKT or PROJ string. By default, transform the geometry in-place and return nothing. However if the `clone` keyword is set, don't modify the geometry and return a transformed clone instead.

def union(self, other): (source)

Return a Geometry representing all the points in this Geometry and other.

def within(self, other): (source)

Return true if the DE-9IM intersection matrix for the two Geometries is T*F**F***.

__class__ = (source)

Undocumented

Get the SRID for the geometry. Return None if no SRID is set.

Return the area of the Geometry.

Return the boundary as a newly allocated Geometry object.

The centroid is equal to the centroid of the set of component Geometries of highest dimension (since the lower-dimension geometries contribute zero "weight" to the centroid).

@property
convex_hull = (source)

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

Return a clone of the coordinate sequence for this Geometry.

Alias for `srs` property.

Return the dimension of this Geometry (0=point, 1=line, 2=surface).

Return a boolean indicating whether the set of points in this Geometry are empty.

Return the envelope for this geometry (a polygon).

Return the EWKB representation of this Geometry as a Python buffer. This is an extension of the WKB specification that includes any SRID value that are a part of this geometry.

Return the EWKT (SRID + WKT) of the Geometry.

Return the extent of this geometry as a 4-tuple, consisting of (xmin, ymin, xmax, ymax).

Return a string representing the Geometry type, e.g. 'Polygon'

@property
geom_typeid = (source)

Return an integer representing the Geometry type.

Return whether the geometry has a 3D dimension.

Return the WKB of this Geometry in hexadecimal form. Please note that the SRID is not included in this representation because it is not a part of the OGC specification (use the `hexewkb` property instead).

Return the EWKB of this Geometry in hexadecimal form. This is an extension of the WKB specification that includes SRID value that are a part of this geometry.

Return GeoJSON representation of this Geometry.

Return the length of this Geometry (e.g., 0 for point, or the circumference of a Polygon).

Return the number of coordinates in the Geometry.

Return the number of geometries in the Geometry.

Return the number points, or coordinates, in the Geometry.

Return the OGR Geometry for this Geometry.

@property
point_on_surface = (source)

Compute an interior point of this Geometry.

Return a PreparedGeometry corresponding to this geometry -- it is optimized for the contains, intersects, and covers operations.

Return whether or not the geometry is a ring.

Return false if the Geometry isn't simple.

Return the OSR SpatialReference for SRID of this Geometry.

@property
unary_union = (source)

Return the union of all the elements of this geometry.

Test the validity of this Geometry.

@property
valid_reason = (source)

Return a string containing the reason for any invalidity.

Return the WKB (Well-Known Binary) representation of this Geometry as a Python buffer. SRID and Z values are not included, use the `ewkb` property instead.

Return the WKT (Well-Known Text) representation of this Geometry.

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

Undocumented

@staticmethod
def _from_wkt(wkt): (source)

Undocumented

def _from_pickle_wkb(self, wkb): (source)

Undocumented

def _ogr_ptr(self): (source)

Undocumented

def _post_init(self): (source)

Perform post-initialization setup.

def _to_pickle_wkb(self): (source)

Undocumented

def _topology(self, gptr): (source)

Return Geometry from the given pointer.

_GEOS_CLASSES = (source)

Undocumented

Value
None

Undocumented