This class serves as the base for GEOS geometry objects, providing a comprehensive interface for spatial operations, topological analysis, and coordinate management. It supports various input and output formats including WKT, WKB, GeoJSON, and KML, while implementing Pythonic operator overloading for geometric set operations like union and intersection. The class manages underlying C pointers for GEOS geometries and facilitates integration with GDAL for spatial reference transformations.
Attributes
| Attribute | Type | Description |
|---|
| ptr_type | type = GEOM_PTR | The C pointer type used for the underlying GEOS geometry object. |
| destructor | callable = capi.destroy_geom | The C API function responsible for freeing the memory associated with the GEOS geometry pointer. |
| has_cs | boolean = false | A boolean flag indicating whether the geometry type supports coordinate sequences; only Point, LineString, and LinearRing have them. |
| geojson | string = null | Return GeoJSON representation of this Geometry. |
Constructor
Signature
def GEOSGeometryBase(
ptr: GEOM_PTR,
cls: class
) - > null
Parameters
| Name | Type | Description |
|---|
| ptr | GEOM_PTR | The pointer to the GEOS geometry object. |
| cls | class | The specific geometry class to assign to the instance. |
Methods
from_ewkt()
@classmethod
def from_ewkt(
ewkt: string
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Creates a GEOSGeometry instance from an Extended Well-Known Text string, extracting the SRID if present.
Parameters
| Name | Type | Description |
|---|
| ewkt | string | The Extended Well-Known Text string containing geometry and optional SRID. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A new geometry object initialized with the provided EWKT data. |
from_gml()
@classmethod
def from_gml(
gml_string: string
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Creates a GEOSGeometry instance from a GML string using GDAL's OGRGeometry conversion.
Parameters
| Name | Type | Description |
|---|
| gml_string | string | The Geography Markup Language string to parse. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A new geometry object derived from the GML input. |
coord_seq()
@classmethod
def coord_seq() - > [GEOSCoordSeq](../coordseq/geoscoordseq.md?sid=django_contrib_gis_geos_coordseq_geoscoordseq)
Return a clone of the coordinate sequence for this Geometry.
Returns
| Type | Description |
|---|
[GEOSCoordSeq](../coordseq/geoscoordseq.md?sid=django_contrib_gis_geos_coordseq_geoscoordseq) | A copy of the coordinate sequence, or None if the geometry does not support them. |
geom_type()
@classmethod
def geom_type() - > string
Return a string representing the Geometry type, e.g. 'Polygon'
Returns
| Type | Description |
|---|
string | The name of the geometry type. |
geom_typeid()
@classmethod
def geom_typeid() - > integer
Return an integer representing the Geometry type.
Returns
| Type | Description |
|---|
integer | The internal GEOS ID for the geometry type. |
num_geom()
@classmethod
def num_geom() - > integer
Return the number of geometries in the Geometry.
Returns
| Type | Description |
|---|
integer | The count of sub-geometries (e.g., in a GeometryCollection). |
num_coords()
@classmethod
def num_coords() - > integer
Return the number of coordinates in the Geometry.
Returns
| Type | Description |
|---|
integer | The total count of vertices in the geometry. |
num_points()
@classmethod
def num_points() - > integer
Return the number of points, or coordinates, in the Geometry.
Returns
| Type | Description |
|---|
integer | The total count of vertices in the geometry. |
dims()
@classmethod
def dims() - > integer
Return the dimension of this Geometry (0=point, 1=line, 2=surface).
Returns
| Type | Description |
|---|
integer | The topological dimension of the geometry. |
normalize()
@classmethod
def normalize(
clone: boolean
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
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.
Parameters
| Name | Type | Description |
|---|
| clone | boolean | If True, returns a normalized copy without modifying the original. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A normalized clone if clone=True, otherwise None. |
make_valid()
@classmethod
def make_valid() - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Attempt to create a valid representation of a given invalid geometry without losing any of the input vertices.
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A new valid GEOSGeometry instance. |
empty()
@classmethod
def empty() - > boolean
Return a boolean indicating whether the set of points in this Geometry are empty.
Returns
| Type | Description |
|---|
boolean | True if the geometry contains no points. |
hasz()
@classmethod
def hasz() - > boolean
Return whether the geometry has a Z dimension.
Returns
| Type | Description |
|---|
boolean | True if the geometry is 3D. |
hasm()
@classmethod
def hasm() - > boolean
Return whether the geometry has a M dimension.
Returns
| Type | Description |
|---|
boolean | True if the geometry contains measure values (requires GEOS >= 3.12.0). |
ring()
@classmethod
def ring() - > boolean
Return whether or not the geometry is a ring.
Returns
| Type | Description |
|---|
boolean | True if the geometry is a closed and simple LineString. |
simple()
@classmethod
def simple() - > boolean
Return false if the Geometry isn't simple.
Returns
| Type | Description |
|---|
boolean | True if the geometry has no anomalous geometric points, such as self-intersection. |
valid()
@classmethod
def valid() - > boolean
Test the validity of this Geometry.
Returns
| Type | Description |
|---|
boolean | True if the geometry is topologically valid. |
valid_reason()
@classmethod
def valid_reason() - > string
Return a string containing the reason for any invalidity.
Returns
| Type | Description |
|---|
string | A text description explaining why the geometry is invalid, or 'Valid Geometry'. |
contains()
@classmethod
def contains(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > boolean
Return true if other.within(this) returns true.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to test for containment. |
Returns
| Type | Description |
|---|
boolean | True if this geometry contains the other. |
covers()
@classmethod
def covers(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > boolean
Return True if the DE-9IM Intersection Matrix for the two geometries is T**FF*, TFF*, TFF, or **TFF. If either geometry is empty, return False.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to test for coverage. |
Returns
| Type | Description |
|---|
boolean | True if this geometry covers the other. |
crosses()
@classmethod
def crosses(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > boolean
Return true if the DE-9IM intersection matrix for the two Geometries is TT***** (for a point and a curve,a point and an area or a line and an area) 0******** (for two curves).
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to test for crossing. |
Returns
| Type | Description |
|---|
boolean | True if the geometries cross each other. |
disjoint()
@classmethod
def disjoint(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > boolean
Return true if the DE-9IM intersection matrix for the two Geometries is FFFF***.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to test for disjointness. |
Returns
| Type | Description |
|---|
boolean | True if the geometries have no points in common. |
equals()
@classmethod
def equals(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > boolean
Return true if the DE-9IM intersection matrix for the two Geometries is TF**FFF.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to compare. |
Returns
| Type | Description |
|---|
boolean | True if the geometries are spatially equal. |
equals_exact()
@classmethod
def equals_exact(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry),
tolerance: float
) - > boolean
Return true if the two Geometries are exactly equal, up to a specified tolerance.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to compare. |
| tolerance | float | The numeric threshold for coordinate comparison. |
Returns
| Type | Description |
|---|
boolean | True if the geometries are equal within the given numeric threshold. |
equals_identical()
@classmethod
def equals_identical(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > boolean
Return true if the two Geometries are point-wise equivalent.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to compare. |
Returns
| Type | Description |
|---|
boolean | True if the geometries are identical (requires GEOS >= 3.12.0). |
intersects()
@classmethod
def intersects(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > boolean
Return true if disjoint return false.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to test for intersection. |
Returns
| Type | Description |
|---|
boolean | True if the geometries share any points. |
overlaps()
@classmethod
def overlaps(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > boolean
Return true if the DE-9IM intersection matrix for the two Geometries is TTT (for two points or two surfaces) 1TT (for two curves).
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to test for overlap. |
Returns
| Type | Description |
|---|
boolean | True if the geometries overlap. |
relate_pattern()
@classmethod
def relate_pattern(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry),
pattern: string
) - > boolean
Return true if the elements in the DE-9IM intersection matrix for the two Geometries match the elements in pattern.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to relate to. |
| pattern | string | A 9-character DE-9IM intersection matrix pattern string. |
Returns
| Type | Description |
|---|
boolean | True if the spatial relationship matches the DE-9IM pattern. |
touches()
@classmethod
def touches(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > boolean
Return true if the DE-9IM intersection matrix for the two Geometries is FT*******, FT*** or F*T**.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to test for contact. |
Returns
| Type | Description |
|---|
boolean | True if the geometries touch but do not overlap their interiors. |
within()
@classmethod
def within(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > boolean
Return true if the DE-9IM intersection matrix for the two Geometries is TFF.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to test for containment. |
Returns
| Type | Description |
|---|
boolean | True if this geometry is entirely inside the other. |
srid()
@classmethod
def srid() - > integer
Get or set the Spatial Reference ID (SRID) for the geometry.
Returns
| Type | Description |
|---|
integer | The SRID integer, or None if not set. |
ewkt()
@classmethod
def ewkt() - > string
Return the EWKT (SRID + WKT) of the Geometry.
Returns
| Type | Description |
|---|
string | The Extended Well-Known Text string. |
wkt()
@classmethod
def wkt() - > string
Return the WKT (Well-Known Text) representation of this Geometry.
Returns
| Type | Description |
|---|
string | The Well-Known Text string. |
hex()
@classmethod
def hex() - > string
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).
Returns
| Type | Description |
|---|
string | The hexadecimal WKB string. |
hexewkb()
@classmethod
def hexewkb() - > string
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.
Returns
| Type | Description |
|---|
string | The hexadecimal EWKB string. |
json()
@classmethod
def json() - > string
Return GeoJSON representation of this Geometry.
Returns
| Type | Description |
|---|
string | A JSON string formatted according to the GeoJSON specification. |
wkb()
@classmethod
def wkb() - > memoryview
Return the WKB (Well-Known Binary) representation of this Geometry as a Python memoryview. SRID and Z values are not included, use the ewkb property instead.
Returns
| Type | Description |
|---|
memoryview | A memoryview containing the binary WKB data. |
ewkb()
@classmethod
def ewkb() - > memoryview
Return the EWKB representation of this Geometry as a Python memoryview. This is an extension of the WKB specification that includes any SRID value that are a part of this geometry.
Returns
| Type | Description |
|---|
memoryview | A memoryview containing the binary EWKB data. |
kml()
@classmethod
def kml() - > string
Return the KML representation of this Geometry.
Returns
| Type | Description |
|---|
string | An XML string formatted for Keyhole Markup Language. |
prepared()
@classmethod
def prepared() - > [PreparedGeometry](../prepared/preparedgeometry.md?sid=django_contrib_gis_geos_prepared_preparedgeometry)
Return a PreparedGeometry corresponding to this geometry -- it is optimized for the contains, intersects, and covers operations.
Returns
| Type | Description |
|---|
[PreparedGeometry](../prepared/preparedgeometry.md?sid=django_contrib_gis_geos_prepared_preparedgeometry) | An optimized version of the geometry for spatial queries. |
ogr()
@classmethod
def ogr() - > [OGRGeometry](../../gdal/geometries/ogrgeometry.md?sid=django_contrib_gis_gdal_geometries_ogrgeometry)
Return the OGR Geometry for this Geometry.
Returns
| Type | Description |
|---|
[OGRGeometry](../../gdal/geometries/ogrgeometry.md?sid=django_contrib_gis_gdal_geometries_ogrgeometry) | A GDAL/OGR representation of the geometry. |
srs()
@classmethod
def srs() - > [SpatialReference](../../gdal/srs/spatialreference.md?sid=django_contrib_gis_gdal_srs_spatialreference)
Return the OSR SpatialReference for SRID of this Geometry.
Returns
| Type | Description |
|---|
[SpatialReference](../../gdal/srs/spatialreference.md?sid=django_contrib_gis_gdal_srs_spatialreference) | A GDAL SpatialReference object, or None if the SRID is invalid or not set. |
crs()
@classmethod
def crs() - > [SpatialReference](../../gdal/srs/spatialreference.md?sid=django_contrib_gis_gdal_srs_spatialreference)
Alias for srs property.
Returns
| Type | Description |
|---|
[SpatialReference](../../gdal/srs/spatialreference.md?sid=django_contrib_gis_gdal_srs_spatialreference) | The spatial reference system of the geometry. |
@classmethod
def transform(
ct: object,
clone: boolean
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
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.
Parameters
| Name | Type | Description |
|---|
| ct | object | The target coordinate system, specified as an SRID integer, WKT string, PROJ string, or CoordTransform object. |
| clone | boolean | If True, returns a transformed copy without modifying the original. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A transformed clone if clone=True, otherwise None. |
boundary()
@classmethod
def boundary() - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Return the boundary as a newly allocated Geometry object.
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A geometry representing the boundary of the current geometry. |
buffer()
@classmethod
def buffer(
width: float,
quadsegs: integer
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
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)
Parameters
| Name | Type | Description |
|---|
| width | float | The distance to buffer the geometry by. |
| quadsegs | integer | The number of segments used to approximate a quarter circle. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A geometry representing the buffered area. |
buffer_with_style()
@classmethod
def buffer_with_style(
width: float,
quadsegs: integer,
end_cap_style: integer,
join_style: integer,
mitre_limit: float
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Same as buffer() but allows customizing the style of the memoryview. 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.
Parameters
| Name | Type | Description |
|---|
| width | float | The distance to buffer the geometry by. |
| quadsegs | integer | The number of segments used to approximate a quarter circle. |
| end_cap_style | integer | The style of the buffer end caps (1=round, 2=flat, 3=square). |
| join_style | integer | The style of the buffer joins (1=round, 2=mitre, 3=bevel). |
| mitre_limit | float | The ratio limit for mitered joins. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A geometry representing the buffered area with specific styling. |
centroid()
@classmethod
def centroid() - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
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).
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A Point geometry representing the geometric center. |
convex_hull()
@classmethod
def convex_hull() - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Return the smallest convex Polygon that contains all the points in the Geometry.
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The convex hull geometry. |
difference()
@classmethod
def difference(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Return a Geometry representing the points making up this Geometry that do not make up other.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to subtract from this one. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A geometry representing the spatial difference. |
envelope()
@classmethod
def envelope() - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Return the envelope for this geometry (a polygon).
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A polygon representing the bounding box of the geometry. |
intersection()
@classmethod
def intersection(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Return a Geometry representing the points shared by this Geometry and other.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to intersect with. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A geometry representing the spatial intersection. |
point_on_surface()
@classmethod
def point_on_surface() - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Compute an interior point of this Geometry.
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A Point geometry guaranteed to be on the surface of the geometry. |
relate()
@classmethod
def relate(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > string
Return the DE-9IM intersection matrix for this Geometry and the other.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to relate to. |
Returns
| Type | Description |
|---|
string | A 9-character string representing the intersection matrix. |
simplify()
@classmethod
def simplify(
tolerance: float,
preserve_topology: boolean
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
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.
Parameters
| Name | Type | Description |
|---|
| tolerance | float | The distance tolerance for simplification. |
| preserve_topology | boolean | If True, uses a slower algorithm that prevents topological errors. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A simplified version of the geometry. |
sym_difference()
@classmethod
def sym_difference(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Return a set combining the points in this Geometry not in other, and the points in other not in this Geometry.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to compare against. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A geometry representing the symmetric difference. |
unary_union()
@classmethod
def unary_union() - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Return the union of all the elements of this geometry.
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A single geometry representing the union of all components. |
union()
@classmethod
def union(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Return a Geometry representing all the points in this Geometry and other.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to union with. |
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A geometry representing the spatial union. |
area()
@classmethod
def area() - > float
Return the area of the Geometry.
Returns
| Type | Description |
|---|
float | The area in units of the coordinate system. |
distance()
@classmethod
def distance(
other: [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
) - > float
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.
Parameters
| Name | Type | Description |
|---|
| other | [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | The geometry to measure distance to. |
Returns
| Type | Description |
|---|
float | The minimum distance between the two geometries. |
extent()
@classmethod
def extent() - > tuple
Return the extent of this geometry as a 4-tuple, consisting of (xmin, ymin, xmax, ymax).
Returns
| Type | Description |
|---|
tuple | A 4-tuple of floats representing the bounding box coordinates. |
length()
@classmethod
def length() - > float
Return the length of this Geometry (e.g., 0 for point, or the circumference of a Polygon).
Returns
| Type | Description |
|---|
float | The length or perimeter of the geometry. |
clone()
@classmethod
def clone() - > [GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry)
Clone this Geometry.
Returns
| Type | Description |
|---|
[GEOSGeometry](geosgeometry.md?sid=django_contrib_gis_geos_geometry_geosgeometry) | A new GEOSGeometry instance that is an exact copy of this one. |