Package osgeo :: Module ogr :: Class Geometry |
[hide private]
[frames] | no frames]

# Class Geometry

source code

Proxy of C++ OGRGeometryShadow class.

Instance Methods | [hide private]
__repr__(self) | source code
__init__(self, *args, **kwargs) __init__(OGRGeometryShadow self, OGRwkbGeometryType type, char * wkt=None, int wkb=0, char * gml=None) -> Geometry | source code
ExportToWkt(self, *args) ExportToWkt(Geometry self) -> OGRErr | source code
ExportToIsoWkt(self, *args) ExportToIsoWkt(Geometry self) -> OGRErr | source code
ExportToWkb(self, *args, **kwargs) ExportToWkb(Geometry self, OGRwkbByteOrder byte_order) -> OGRErr | source code
ExportToIsoWkb(self, *args, **kwargs) ExportToIsoWkb(Geometry self, OGRwkbByteOrder byte_order) -> OGRErr | source code
ExportToGML(self, *args, **kwargs) ExportToGML(Geometry self, char ** options=None) -> retStringAndCPLFree * | source code
ExportToKML(self, *args) ExportToKML(Geometry self, char const * altitude_mode=None) -> retStringAndCPLFree * | source code
ExportToJson(self, *args, **kwargs) ExportToJson(Geometry self, char ** options=None) -> retStringAndCPLFree * | source code
AddPoint(self, *args, **kwargs) AddPoint(Geometry self, double x, double y, double z=0) | source code
AddPointM(self, *args, **kwargs) AddPointM(Geometry self, double x, double y, double m) | source code
AddPointZM(self, *args, **kwargs) AddPointZM(Geometry self, double x, double y, double z, double m) | source code
AddPoint_2D(self, *args) AddPoint_2D(Geometry self, double x, double y) | source code
AddGeometryDirectly(self, *args) AddGeometryDirectly(Geometry self, Geometry other_disown) -> OGRErr | source code
AddGeometry(self, *args) AddGeometry(Geometry self, Geometry other) -> OGRErr | source code
RemoveGeometry(self, *args) RemoveGeometry(Geometry self, int iSubGeom) -> OGRErr | source code
Clone(self, *args) Clone(Geometry self) -> Geometry | source code
GetGeometryType(self, *args) GetGeometryType(Geometry self) -> OGRwkbGeometryType | source code
GetGeometryName(self, *args) GetGeometryName(Geometry self) -> char const * | source code
Length(self, *args) Length(Geometry self) -> double | source code
Area(self, *args) Area(Geometry self) -> double | source code
GetArea(self, *args) GetArea(Geometry self) -> double | source code
GetPointCount(self, *args) GetPointCount(Geometry self) -> int | source code
GetPoints(self, *args, **kwargs) GetPoints(Geometry self, int nCoordDimension=0) | source code
GetX(self, *args, **kwargs) GetX(Geometry self, int point=0) -> double | source code
GetY(self, *args, **kwargs) GetY(Geometry self, int point=0) -> double | source code
GetZ(self, *args, **kwargs) GetZ(Geometry self, int point=0) -> double | source code
GetM(self, *args, **kwargs) GetM(Geometry self, int point=0) -> double | source code
GetPoint(self, *args) GetPoint(Geometry self, int iPoint=0) | source code
GetPointZM(self, *args) GetPointZM(Geometry self, int iPoint=0) | source code
GetPoint_2D(self, *args) GetPoint_2D(Geometry self, int iPoint=0) | source code
GetGeometryCount(self, *args) GetGeometryCount(Geometry self) -> int | source code
SetPoint(self, *args, **kwargs) SetPoint(Geometry self, int point, double x, double y, double z=0) | source code
SetPointM(self, *args, **kwargs) SetPointM(Geometry self, int point, double x, double y, double m) | source code
SetPointZM(self, *args, **kwargs) SetPointZM(Geometry self, int point, double x, double y, double z, double m) | source code
SetPoint_2D(self, *args, **kwargs) SetPoint_2D(Geometry self, int point, double x, double y) | source code
SwapXY(self, *args) SwapXY(Geometry self) | source code
GetGeometryRef(self, *args) GetGeometryRef(Geometry self, int geom) -> Geometry | source code
Simplify(self, *args) Simplify(Geometry self, double tolerance) -> Geometry | source code
SimplifyPreserveTopology(self, *args) SimplifyPreserveTopology(Geometry self, double tolerance) -> Geometry | source code
DelaunayTriangulation(self, *args, **kwargs) DelaunayTriangulation(Geometry self, double dfTolerance=0.0, int bOnlyEdges=False) -> Geometry | source code
Polygonize(self, *args) Polygonize(Geometry self) -> Geometry | source code
Boundary(self, *args) Boundary(Geometry self) -> Geometry | source code
GetBoundary(self, *args) GetBoundary(Geometry self) -> Geometry | source code
ConvexHull(self, *args) ConvexHull(Geometry self) -> Geometry | source code
MakeValid(self, *args) MakeValid(Geometry self, char ** options=None) -> Geometry | source code
Normalize(self, *args) Normalize(Geometry self) -> Geometry | source code
RemoveLowerDimensionSubGeoms(self, *args) RemoveLowerDimensionSubGeoms(Geometry self) -> Geometry | source code
Buffer(self, *args, **kwargs) Buffer(Geometry self, double distance, int quadsecs=30) -> Geometry | source code
Intersection(self, *args) Intersection(Geometry self, Geometry other) -> Geometry | source code
Union(self, *args) Union(Geometry self, Geometry other) -> Geometry | source code
UnionCascaded(self, *args) UnionCascaded(Geometry self) -> Geometry | source code
Difference(self, *args) Difference(Geometry self, Geometry other) -> Geometry | source code
SymDifference(self, *args) SymDifference(Geometry self, Geometry other) -> Geometry | source code
SymmetricDifference(self, *args) SymmetricDifference(Geometry self, Geometry other) -> Geometry | source code
Distance(self, *args) Distance(Geometry self, Geometry other) -> double | source code
Distance3D(self, *args) Distance3D(Geometry self, Geometry other) -> double | source code
Empty(self, *args) Empty(Geometry self) | source code
IsEmpty(self, *args) IsEmpty(Geometry self) -> bool | source code
IsValid(self, *args) IsValid(Geometry self) -> bool | source code
IsSimple(self, *args) IsSimple(Geometry self) -> bool | source code
IsRing(self, *args) IsRing(Geometry self) -> bool | source code
Intersects(self, *args) Intersects(Geometry self, Geometry other) -> bool | source code
Intersect(self, *args) Intersect(Geometry self, Geometry other) -> bool | source code
Equals(self, *args) Equals(Geometry self, Geometry other) -> bool | source code
Equal(self, *args) Equal(Geometry self, Geometry other) -> bool | source code
Disjoint(self, *args) Disjoint(Geometry self, Geometry other) -> bool | source code
Touches(self, *args) Touches(Geometry self, Geometry other) -> bool | source code
Crosses(self, *args) Crosses(Geometry self, Geometry other) -> bool | source code
Within(self, *args) Within(Geometry self, Geometry other) -> bool | source code
Contains(self, *args) Contains(Geometry self, Geometry other) -> bool | source code
Overlaps(self, *args) Overlaps(Geometry self, Geometry other) -> bool | source code
TransformTo(self, *args) TransformTo(Geometry self, SpatialReference reference) -> OGRErr | source code
GetSpatialReference(self, *args) GetSpatialReference(Geometry self) -> SpatialReference | source code
AssignSpatialReference(self, *args) AssignSpatialReference(Geometry self, SpatialReference reference) | source code
CloseRings(self, *args) CloseRings(Geometry self) | source code
FlattenTo2D(self, *args) FlattenTo2D(Geometry self) | source code
Segmentize(self, *args) Segmentize(Geometry self, double dfMaxLength) | source code
GetEnvelope(self, *args) GetEnvelope(Geometry self) | source code
GetEnvelope3D(self, *args) GetEnvelope3D(Geometry self) | source code
Centroid(self, *args) Centroid(Geometry self) -> Geometry | source code
PointOnSurface(self, *args) PointOnSurface(Geometry self) -> Geometry | source code
WkbSize(self, *args) WkbSize(Geometry self) -> size_t | source code
GetCoordinateDimension(self, *args) GetCoordinateDimension(Geometry self) -> int | source code
CoordinateDimension(self, *args) CoordinateDimension(Geometry self) -> int | source code
Is3D(self, *args) Is3D(Geometry self) -> int | source code
IsMeasured(self, *args) IsMeasured(Geometry self) -> int | source code
SetCoordinateDimension(self, *args) SetCoordinateDimension(Geometry self, int dimension) | source code
Set3D(self, *args) Set3D(Geometry self, int b3D) | source code
SetMeasured(self, *args) SetMeasured(Geometry self, int bMeasured) | source code
GetDimension(self, *args) GetDimension(Geometry self) -> int | source code
HasCurveGeometry(self, *args) HasCurveGeometry(Geometry self, int bLookForCircular=False) -> int | source code
GetLinearGeometry(self, *args, **kwargs) GetLinearGeometry(Geometry self, double dfMaxAngleStepSizeDegrees=0.0, char ** options=None) -> Geometry | source code
GetCurveGeometry(self, *args, **kwargs) GetCurveGeometry(Geometry self, char ** options=None) -> Geometry | source code
Value(self, *args) Value(Geometry self, double dfDistance) -> Geometry | source code
Transform(self, *args) Transform(Geometry self, CoordinateTransformation trans) -> OGRErr Transform(Geometry self, GeomTransformer transformer) -> Geometry | source code
CreatePreparedGeometry(self, *args) CreatePreparedGeometry(Geometry self) -> PreparedGeometry | source code
Destroy(self) | source code
__str__(self) | source code
__copy__(self) | source code
__deepcopy__(self, memo) | source code
__reduce__(self) | source code
__setstate__(self, state) | source code
__iter__(self) | source code

Class Variables | [hide private]
| __swig_setmethods__ = `{}`
| __setattr__ = `lambda self, name, value:`
| __swig_getmethods__ = `{}`
| __getattr__ = `lambda self, name:`
| __swig_destroy__ = `_ogr.delete_Geometry`
| __del__ = `lambda self:`

Method Details | [hide private]

### ExportToWkt(self, *args) | source code
    ExportToWkt(Geometry self) -> OGRErr

    OGRErr
    OGR_G_ExportToWkt(OGRGeometryH hGeom, char **ppszSrcText)

    Convert a geometry into well known text format.

    This function relates to the SFCOM IWks::ExportToWKT() method.

    For backward compatibility purposes, it exports the Old-style 99-402
    extended dimension (Z) WKB types for types Point, LineString, Polygon,
    MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. For
    other geometry types, it is equivalent to OGR_G_ExportToIsoWkt().

    This function is the same as the CPP method
    OGRGeometry::exportToWkt().

    Parameters:
    -----------

    hGeom:  handle on the geometry to convert to a text format from.

    ppszSrcText:  a text buffer is allocated by the program, and assigned
    to the passed pointer. After use, *ppszDstText should be freed with
    CPLFree().

    Currently OGRERR_NONE is always returned.

### ExportToIsoWkt(self, *args) | source code
    ExportToIsoWkt(Geometry self) -> OGRErr

    OGRErr
    OGR_G_ExportToIsoWkt(OGRGeometryH hGeom, char **ppszSrcText)

    Convert a geometry into SFSQL 1.2 / ISO SQL/MM Part 3 well known text
    format.

    This function relates to the SFCOM IWks::ExportToWKT() method. It
    exports the SFSQL 1.2 and ISO SQL/MM Part 3 extended dimension (Z&M)
    WKB types.

    This function is the same as the CPP method
    OGRGeometry::exportToWkt(wkbVariantIso).

    Parameters:
    -----------

    hGeom:  handle on the geometry to convert to a text format from.

    ppszSrcText:  a text buffer is allocated by the program, and assigned
    to the passed pointer. After use, *ppszDstText should be freed with
    CPLFree().

    Currently OGRERR_NONE is always returned.

    GDAL 2.0

### ExportToWkb(self, *args, **kwargs) | source code
    ExportToWkb(Geometry self, OGRwkbByteOrder byte_order) -> OGRErr

    OGRErr
    OGR_G_ExportToWkb(OGRGeometryH hGeom, OGRwkbByteOrder eOrder, unsigned
    char *pabyDstBuffer)

    Convert a geometry well known binary format.

    This function relates to the SFCOM IWks::ExportToWKB() method.

    For backward compatibility purposes, it exports the Old-style 99-402
    extended dimension (Z) WKB types for types Point, LineString, Polygon,
    MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. For
    other geometry types, it is equivalent to OGR_G_ExportToIsoWkb().

    This function is the same as the CPP method
    OGRGeometry::exportToWkb(OGRwkbByteOrder, unsigned char *,
    OGRwkbVariant) with eWkbVariant = wkbVariantOldOgc.

    Parameters:
    -----------

    hGeom:  handle on the geometry to convert to a well know binary data
    from.

    eOrder:  One of wkbXDR or wkbNDR indicating MSB or LSB byte order
    respectively.

    pabyDstBuffer:  a buffer into which the binary representation is
    written. This buffer must be at least OGR_G_WkbSize() byte in size.

    Currently OGRERR_NONE is always returned.

### ExportToIsoWkb(self, *args, **kwargs) | source code
    ExportToIsoWkb(Geometry self, OGRwkbByteOrder byte_order) -> OGRErr

    OGRErr
    OGR_G_ExportToIsoWkb(OGRGeometryH hGeom, OGRwkbByteOrder eOrder,
    unsigned char *pabyDstBuffer)

    Convert a geometry into SFSQL 1.2 / ISO SQL/MM Part 3 well known
    binary format.

    This function relates to the SFCOM IWks::ExportToWKB() method. It
    exports the SFSQL 1.2 and ISO SQL/MM Part 3 extended dimension (Z&M)
    WKB types.

    This function is the same as the CPP method
    OGRGeometry::exportToWkb(OGRwkbByteOrder, unsigned char *,
    OGRwkbVariant) with eWkbVariant = wkbVariantIso.

    Parameters:
    -----------

    hGeom:  handle on the geometry to convert to a well know binary data
    from.

    eOrder:  One of wkbXDR or wkbNDR indicating MSB or LSB byte order
    respectively.

    pabyDstBuffer:  a buffer into which the binary representation is
    written. This buffer must be at least OGR_G_WkbSize() byte in size.

    Currently OGRERR_NONE is always returned.

    GDAL 2.0

### Clone(self, *args) | source code
    Clone(Geometry self) -> Geometry

    OGRGeometryH OGR_G_Clone(OGRGeometryH
    hGeom)

    Make a copy of this object.

    This function relates to the SFCOM IGeometry::clone() method.

    This function is the same as the CPP method OGRGeometry::clone().

    Parameters:
    -----------

    hGeom:  handle on the geometry to clone from.

    a handle on the copy of the geometry with the spatial reference system
    as the original.

### GetGeometryType(self, *args) | source code
    GetGeometryType(Geometry self) -> OGRwkbGeometryType

    OGRwkbGeometryType
    OGR_G_GetGeometryType(OGRGeometryH hGeom)

    Fetch geometry type.

    Note that the geometry type may include the 2.5D flag. To get a 2D
    flattened version of the geometry type apply the wkbFlatten() macro to
    the return result.

    This function is the same as the CPP method
    OGRGeometry::getGeometryType().

    Parameters:
    -----------

    hGeom:  handle on the geometry to get type from.

    the geometry type code.

### GetGeometryName(self, *args) | source code
    GetGeometryName(Geometry self) -> char const *

    const char*
    OGR_G_GetGeometryName(OGRGeometryH hGeom)

    Fetch WKT name for geometry type.

    There is no SFCOM analog to this function.

    This function is the same as the CPP method
    OGRGeometry::getGeometryName().

    Parameters:
    -----------

    hGeom:  handle on the geometry to get name from.

    name used for this geometry type in well known text format.

### SwapXY(self, *args) | source code
    SwapXY(Geometry self)

    void OGR_G_SwapXY(OGRGeometryH hGeom)

    Swap x and y coordinates.

    Parameters:
    -----------

    hGeom:  geometry.

    OGR 2.3.0

### Simplify(self, *args) | source code
    Simplify(Geometry self, double tolerance) -> Geometry

    OGRGeometryH
    OGR_G_Simplify(OGRGeometryH hThis, double dTolerance)

    Compute a simplified geometry.

    This function is the same as the C++ method OGRGeometry::Simplify().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry.

    dTolerance:  the distance tolerance for the simplification.

    the simplified geometry or NULL if an error occurs.

    OGR 1.8.0

### SimplifyPreserveTopology(self, *args) | source code
    SimplifyPreserveTopology(Geometry self, double tolerance) -> Geometry

    OGRGeometryH
    OGR_G_SimplifyPreserveTopology(OGRGeometryH hThis, double dTolerance)

    Simplify the geometry while preserving topology.

    This function is the same as the C++ method
    OGRGeometry::SimplifyPreserveTopology().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry.

    dTolerance:  the distance tolerance for the simplification.

    the simplified geometry or NULL if an error occurs.

    OGR 1.9.0

### DelaunayTriangulation(self, *args, **kwargs) | source code
    DelaunayTriangulation(Geometry self, double dfTolerance=0.0, int bOnlyEdges=False) -> Geometry

    OGRGeometryH
    OGR_G_DelaunayTriangulation(OGRGeometryH hThis, double dfTolerance,
    int bOnlyEdges)

    Return a Delaunay triangulation of the vertices of the geometry.

    This function is the same as the C++ method
    OGRGeometry::DelaunayTriangulation().

    This function is built on the GEOS library, v3.4 or above. If OGR is
    built without the GEOS library, this function will always fail,
    issuing a CPLE_NotSupported error.

    Parameters:
    -----------

    hThis:  the geometry.

    dfTolerance:  optional snapping tolerance to use for improved
    robustness

    bOnlyEdges:  if TRUE, will return a MULTILINESTRING, otherwise it will
    return a GEOMETRYCOLLECTION containing triangular POLYGONs.

    the geometry resulting from the Delaunay triangulation or NULL if an
    error occurs.

    OGR 2.1

### Polygonize(self, *args) | source code
    Polygonize(Geometry self) -> Geometry

    OGRGeometryH
    OGR_G_Polygonize(OGRGeometryH hTarget)

    Polygonizes a set of sparse edges.

    A new geometry object is created and returned containing a collection
    of reassembled Polygons: NULL will be returned if the input collection
    doesn't corresponds to a MultiLinestring, or when reassembling Edges
    into Polygons is impossible due to topological inconsistencies.

    This function is the same as the C++ method OGRGeometry::Polygonize().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hTarget:  The Geometry to be polygonized.

    a handle to a newly allocated geometry now owned by the caller, or
    NULL on failure.

    OGR 1.9.0

### Boundary(self, *args) | source code
    Boundary(Geometry self) -> Geometry

    OGRGeometryH
    OGR_G_Boundary(OGRGeometryH hTarget)

    Compute boundary.

    A new geometry object is created and returned containing the boundary
    of the geometry on which the method is invoked.

    This function is the same as the C++ method OGR_G_Boundary().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hTarget:  The Geometry to calculate the boundary of.

    a handle to a newly allocated geometry now owned by the caller, or
    NULL on failure.

    OGR 1.8.0

### GetBoundary(self, *args) | source code
GetBoundary(Geometry self) -> Geometry OGRGeometryH OGR_G_GetBoundary(OGRGeometryH hTarget) Compute boundary (deprecated) Deprecated See: OGR_G_Boundary()

### ConvexHull(self, *args) | source code
    ConvexHull(Geometry self) -> Geometry

    OGRGeometryH
    OGR_G_ConvexHull(OGRGeometryH hTarget)

    Compute convex hull.

    A new geometry object is created and returned containing the convex
    hull of the geometry on which the method is invoked.

    This function is the same as the C++ method OGRGeometry::ConvexHull().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hTarget:  The Geometry to calculate the convex hull of.

    a handle to a newly allocated geometry now owned by the caller, or
    NULL on failure.

### MakeValid(self, *args) | source code
    MakeValid(Geometry self, char ** options=None) -> Geometry

    OGRGeometryH
    OGR_G_MakeValid(OGRGeometryH hGeom)

    Attempts to make an invalid geometry valid without losing vertices.

    Already-valid geometries are cloned without further intervention.

    This function is the same as the C++ method OGRGeometry::MakeValid().

    This function is built on the GEOS >= 3.8 library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    >= 3.8 library, this function will return a clone of the input
    geometry if it is valid, or NULL if it is invalid

    Parameters:
    -----------

    hGeom:  The Geometry to make valid.

    a newly allocated geometry now owned by the caller, or NULL on
    failure.

    GDAL 3.0

### Normalize(self, *args) | source code
    Normalize(Geometry self) -> Geometry

    OGRGeometryH
    OGR_G_Normalize(OGRGeometryH hGeom)

    Attempts to bring geometry into normalized/canonical form.

    This function is the same as the C++ method OGRGeometry::Normalize().

    This function is built on the GEOS library; check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hGeom:  The Geometry to normalize.

    a newly allocated geometry now owned by the caller, or NULL on
    failure.

    GDAL 3.3

### Buffer(self, *args, **kwargs) | source code
    Buffer(Geometry self, double distance, int quadsecs=30) -> Geometry

    OGRGeometryH OGR_G_Buffer(OGRGeometryH
    hTarget, double dfDist, int nQuadSegs)

    Compute buffer of geometry.

    Builds a new geometry containing the buffer region around the geometry
    on which it is invoked. The buffer is a polygon containing the region
    within the buffer distance of the original geometry.

    Some buffer sections are properly described as curves, but are
    converted to approximate polygons. The nQuadSegs parameter can be used
    to control how many segments should be used to define a 90 degree
    curve - a quadrant of a circle. A value of 30 is a reasonable default.
    Large values result in large numbers of vertices in the resulting
    buffer geometry while small numbers reduce the accuracy of the result.

    This function is the same as the C++ method OGRGeometry::Buffer().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hTarget:  the geometry.

    dfDist:  the buffer distance to be applied. Should be expressed into
    the same unit as the coordinates of the geometry.

    nQuadSegs:  the number of segments used to approximate a 90 degree
    (quadrant) of curvature.

    the newly created geometry, or NULL if an error occurs.

### Intersection(self, *args) | source code
    Intersection(Geometry self, Geometry other) -> Geometry

    OGRGeometryH
    OGR_G_Intersection(OGRGeometryH hThis, OGRGeometryH hOther)

    Compute intersection.

    Generates a new geometry which is the region of intersection of the
    two geometries operated on. The OGR_G_Intersects() function can be
    used to test if two geometries intersect.

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method
    OGRGeometry::Intersection().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry.

    hOther:  the other geometry.

    a new geometry representing the intersection or NULL if there is no
    intersection or an error occurs.

### Union(self, *args) | source code
    Union(Geometry self, Geometry other) -> Geometry

    OGRGeometryH OGR_G_Union(OGRGeometryH
    hThis, OGRGeometryH hOther)

    Compute union.

    Generates a new geometry which is the region of union of the two
    geometries operated on.

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method OGRGeometry::Union().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry.

    hOther:  the other geometry.

    a new geometry representing the union or NULL if an error occurs.

### UnionCascaded(self, *args) | source code
    UnionCascaded(Geometry self) -> Geometry

    OGRGeometryH
    OGR_G_UnionCascaded(OGRGeometryH hThis)

    Compute union using cascading.

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method
    OGRGeometry::UnionCascaded().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry.

    a new geometry representing the union or NULL if an error occurs.

### Difference(self, *args) | source code
    Difference(Geometry self, Geometry other) -> Geometry

    OGRGeometryH
    OGR_G_Difference(OGRGeometryH hThis, OGRGeometryH hOther)

    Compute difference.

    Generates a new geometry which is the region of this geometry with the
    region of the other geometry removed.

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method OGRGeometry::Difference().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry.

    hOther:  the other geometry.

    a new geometry representing the difference or NULL if the difference
    is empty or an error occurs.

### SymDifference(self, *args) | source code
    SymDifference(Geometry self, Geometry other) -> Geometry

    OGRGeometryH
    OGR_G_SymDifference(OGRGeometryH hThis, OGRGeometryH hOther)

    Compute symmetric difference.

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

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method
    OGRGeometry::SymmetricDifference().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry.

    hOther:  the other geometry.

    a new geometry representing the symmetric difference or NULL if the
    difference is empty or an error occurs.

    OGR 1.8.0

### SymmetricDifference(self, *args) | source code
SymmetricDifference(Geometry self, Geometry other) -> Geometry OGRGeometryH OGR_G_SymmetricDifference(OGRGeometryH hThis, OGRGeometryH hOther) Compute symmetric difference (deprecated) Deprecated See: OGR_G_SymmetricDifference()

### Distance(self, *args) | source code
    Distance(Geometry self, Geometry other) -> double

    double OGR_G_Distance(OGRGeometryH
    hFirst, OGRGeometryH hOther)

    Compute distance between two geometries.

    Returns the shortest distance between the two geometries. The distance
    is expressed into the same unit as the coordinates of the geometries.

    This function is the same as the C++ method OGRGeometry::Distance().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hFirst:  the first geometry to compare against.

    hOther:  the other geometry to compare against.

    the distance between the geometries or -1 if an error occurs.

### Distance3D(self, *args) | source code
    Distance3D(Geometry self, Geometry other) -> double

    double
    OGR_G_Distance3D(OGRGeometryH hFirst, OGRGeometryH hOther)

    Returns the 3D distance between two geometries.

    The distance is expressed into the same unit as the coordinates of the
    geometries.

    This method is built on the SFCGAL library, check it for the
    definition of the geometry operation. If OGR is built without the
    SFCGAL library, this method will always return -1.0

    This function is the same as the C++ method OGRGeometry::Distance3D().

    Parameters:
    -----------

    hFirst:  the first geometry to compare against.

    hOther:  the other geometry to compare against.

    distance between the two geometries

    GDAL 2.2

    the distance between the geometries or -1 if an error occurs.

### Empty(self, *args) | source code
    Empty(Geometry self)

    void OGR_G_Empty(OGRGeometryH hGeom)

    Clear geometry information.

    This restores the geometry to its initial state after construction,
    and before assignment of actual geometry.

    This function relates to the SFCOM IGeometry::Empty() method.

    This function is the same as the CPP method OGRGeometry::empty().

    Parameters:
    -----------

    hGeom:  handle on the geometry to empty.

### IsEmpty(self, *args) | source code
    IsEmpty(Geometry self) -> bool

    int OGR_G_IsEmpty(OGRGeometryH hGeom)

    Test if the geometry is empty.

    This method is the same as the CPP method OGRGeometry::IsEmpty().

    Parameters:
    -----------

    hGeom:  The Geometry to test.

    TRUE if the geometry has no points, otherwise FALSE.

### IsValid(self, *args) | source code
    IsValid(Geometry self) -> bool

    int OGR_G_IsValid(OGRGeometryH hGeom)

    Test if the geometry is valid.

    This function is the same as the C++ method OGRGeometry::IsValid().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always return FALSE.

    Parameters:
    -----------

    hGeom:  The Geometry to test.

    TRUE if the geometry has no points, otherwise FALSE.

### IsSimple(self, *args) | source code
    IsSimple(Geometry self) -> bool

    int OGR_G_IsSimple(OGRGeometryH
    hGeom)

    Returns TRUE if the geometry is simple.

    Returns TRUE if the geometry has no anomalous geometric points, such
    as self intersection or self tangency. The description of each
    instantiable geometric class will include the specific conditions that
    cause an instance of that class to be classified as not simple.

    This function is the same as the C++ method OGRGeometry::IsSimple()
    method.

    If OGR is built without the GEOS library, this function will always
    return FALSE.

    Parameters:
    -----------

    hGeom:  The Geometry to test.

    TRUE if object is simple, otherwise FALSE.

### IsRing(self, *args) | source code
    IsRing(Geometry self) -> bool

    int OGR_G_IsRing(OGRGeometryH hGeom)

    Test if the geometry is a ring.

    This function is the same as the C++ method OGRGeometry::IsRing().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always return FALSE.

    Parameters:
    -----------

    hGeom:  The Geometry to test.

    TRUE if the geometry has no points, otherwise FALSE.

### Intersects(self, *args) | source code
    Intersects(Geometry self, Geometry other) -> bool

    int OGR_G_Intersects(OGRGeometryH
    hGeom, OGRGeometryH hOtherGeom)

    Do these features intersect?

    Determines whether two geometries intersect. If GEOS is enabled, then
    this is done in rigorous fashion otherwise TRUE is returned if the
    envelopes (bounding boxes) of the two geometries overlap.

    This function is the same as the CPP method OGRGeometry::Intersects.

    Parameters:
    -----------

    hGeom:  handle on the first geometry.

    hOtherGeom:  handle on the other geometry to test against.

    TRUE if the geometries intersect, otherwise FALSE.

### Equals(self, *args) | source code
    Equals(Geometry self, Geometry other) -> bool

    int OGR_G_Equals(OGRGeometryH hGeom,
    OGRGeometryH hOther)

    Returns TRUE if two geometries are equivalent.

    This operation implements the SQL/MM ST_OrderingEquals() operation.

    The comparison is done in a structural way, that is to say that the
    geometry types must be identical, as well as the number and ordering
    of sub-geometries and vertices. Or equivalently, two geometries are
    considered equal by this method if their WKT/WKB representation is
    equal. Note: this must be distinguished for equality in a spatial way
    (which is the purpose of the ST_Equals() operation).

    This function is the same as the CPP method OGRGeometry::Equals()
    method.

    Parameters:
    -----------

    hGeom:  handle on the first geometry.

    hOther:  handle on the other geometry to test against.

    TRUE if equivalent or FALSE otherwise.

### Disjoint(self, *args) | source code
    Disjoint(Geometry self, Geometry other) -> bool

    int OGR_G_Disjoint(OGRGeometryH
    hThis, OGRGeometryH hOther)

    Test for disjointness.

    Tests if this geometry and the other geometry are disjoint.

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method OGRGeometry::Disjoint().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry to compare.

    hOther:  the other geometry to compare.

    TRUE if they are disjoint, otherwise FALSE.

### Touches(self, *args) | source code
    Touches(Geometry self, Geometry other) -> bool

    int OGR_G_Touches(OGRGeometryH hThis,
    OGRGeometryH hOther)

    Test for touching.

    Tests if this geometry and the other geometry are touching.

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method OGRGeometry::Touches().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry to compare.

    hOther:  the other geometry to compare.

    TRUE if they are touching, otherwise FALSE.

### Crosses(self, *args) | source code
    Crosses(Geometry self, Geometry other) -> bool

    int OGR_G_Crosses(OGRGeometryH hThis,
    OGRGeometryH hOther)

    Test for crossing.

    Tests if this geometry and the other geometry are crossing.

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method OGRGeometry::Crosses().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry to compare.

    hOther:  the other geometry to compare.

    TRUE if they are crossing, otherwise FALSE.

### Within(self, *args) | source code
    Within(Geometry self, Geometry other) -> bool

    int OGR_G_Within(OGRGeometryH hThis,
    OGRGeometryH hOther)

    Test for containment.

    Tests if this geometry is within the other geometry.

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method OGRGeometry::Within().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry to compare.

    hOther:  the other geometry to compare.

    TRUE if hThis is within hOther, otherwise FALSE.

### Contains(self, *args) | source code
    Contains(Geometry self, Geometry other) -> bool

    int OGR_G_Contains(OGRGeometryH
    hThis, OGRGeometryH hOther)

    Test for containment.

    Tests if this geometry contains the other geometry.

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method OGRGeometry::Contains().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry to compare.

    hOther:  the other geometry to compare.

    TRUE if hThis contains hOther geometry, otherwise FALSE.

### Overlaps(self, *args) | source code
    Overlaps(Geometry self, Geometry other) -> bool

    int OGR_G_Overlaps(OGRGeometryH
    hThis, OGRGeometryH hOther)

    Test for overlap.

    Tests if this geometry and the other geometry overlap, that is their
    intersection has a non-zero area.

    Geometry validity is not checked. In case you are unsure of the
    validity of the input geometries, call IsValid() before, otherwise the
    result might be wrong.

    This function is the same as the C++ method OGRGeometry::Overlaps().

    This function is built on the GEOS library, check it for the
    definition of the geometry operation. If OGR is built without the GEOS
    library, this function will always fail, issuing a CPLE_NotSupported
    error.

    Parameters:
    -----------

    hThis:  the geometry to compare.

    hOther:  the other geometry to compare.

    TRUE if they are overlapping, otherwise FALSE.

### TransformTo(self, *args) | source code
    TransformTo(Geometry self, SpatialReference reference) -> OGRErr

    OGRErr
    OGR_G_TransformTo(OGRGeometryH hGeom, OGRSpatialReferenceH hSRS)

    Transform geometry to new spatial reference system.

    This function will transform the coordinates of a geometry from their
    current spatial reference system to a new target spatial reference
    system. Normally this means reprojecting the vectors, but it could
    include datum shifts, and changes of units.

    This function will only work if the geometry already has an assigned
    spatial reference system, and if it is transformable to the target
    coordinate system.

    Because this function requires internal creation and initialization of
    an OGRCoordinateTransformation object it is significantly more
    expensive to use this function to transform many geometries than it is
    to create the OGRCoordinateTransformation in advance, and call
    transform() with that transformation. This function exists primarily
    for convenience when only transforming a single geometry.

    This function is the same as the CPP method OGRGeometry::transformTo.

    Parameters:
    -----------

    hGeom:  handle on the geometry to apply the transform to.

    hSRS:  handle on the spatial reference system to apply.

    OGRERR_NONE on success, or an error code.

### GetSpatialReference(self, *args) | source code
    GetSpatialReference(Geometry self) -> SpatialReference

    OGRSpatialReferenceH
    OGR_G_GetSpatialReference(OGRGeometryH hGeom)

    Returns spatial reference system for geometry.

    This function relates to the SFCOM IGeometry::get_SpatialReference()
    method.

    This function is the same as the CPP method
    OGRGeometry::getSpatialReference().

    Parameters:
    -----------

    hGeom:  handle on the geometry to get spatial reference from.

    a reference to the spatial reference geometry.

### AssignSpatialReference(self, *args) | source code
    AssignSpatialReference(Geometry self, SpatialReference reference)

    void
    OGR_G_AssignSpatialReference(OGRGeometryH hGeom, OGRSpatialReferenceH
    hSRS)

    Assign spatial reference to this object.

    Any existing spatial reference is replaced, but under no circumstances
    does this result in the object being reprojected. It is just changing
    the interpretation of the existing geometry. Note that assigning a
    spatial reference increments the reference count on the
    OGRSpatialReference, but does not copy it.

    Starting with GDAL 2.3, this will also assign the spatial reference to
    potential sub-geometries of the geometry ( OGRGeometryCollection,
    OGRCurvePolygon/OGRPolygon, OGRCompoundCurve, OGRPolyhedralSurface and
    their derived classes).

    This is similar to the SFCOM IGeometry::put_SpatialReference() method.

    This function is the same as the CPP method
    OGRGeometry::assignSpatialReference.

    Parameters:
    -----------

    hGeom:  handle on the geometry to apply the new spatial reference
    system.

    hSRS:  handle on the new spatial reference system to apply.

### CloseRings(self, *args) | source code
    CloseRings(Geometry self)

    void OGR_G_CloseRings(OGRGeometryH
    hGeom)

    Force rings to be closed.

    If this geometry, or any contained geometries has polygon rings that
    are not closed, they will be closed by adding the starting point at
    the end.

    Parameters:
    -----------

    hGeom:  handle to the geometry.

### FlattenTo2D(self, *args) | source code
    FlattenTo2D(Geometry self)

    void
    OGR_G_FlattenTo2D(OGRGeometryH hGeom)

    Convert geometry to strictly 2D.

    In a sense this converts all Z coordinates to 0.0.

    This function is the same as the CPP method
    OGRGeometry::flattenTo2D().

    Parameters:
    -----------

    hGeom:  handle on the geometry to convert.

### Segmentize(self, *args) | source code
    Segmentize(Geometry self, double dfMaxLength)

    void OGR_G_Segmentize(OGRGeometryH
    hGeom, double dfMaxLength)

    Modify the geometry such it has no segment longer then the given
    distance.

    Interpolated points will have Z and M values (if needed) set to 0.
    Distance computation is performed in 2d only.

    This function is the same as the CPP method OGRGeometry::segmentize().

    Parameters:
    -----------

    hGeom:  handle on the geometry to segmentize

    dfMaxLength:  the maximum distance between 2 points after
    segmentization

### GetEnvelope(self, *args) | source code
    GetEnvelope(Geometry self)

    void
    OGR_G_GetEnvelope(OGRGeometryH hGeom, OGREnvelope *psEnvelope)

    Computes and returns the bounding envelope for this geometry in the
    passed psEnvelope structure.

    This function is the same as the CPP method
    OGRGeometry::getEnvelope().

    Parameters:
    -----------

    hGeom:  handle of the geometry to get envelope from.

    psEnvelope:  the structure in which to place the results.

### GetEnvelope3D(self, *args) | source code
    GetEnvelope3D(Geometry self)

    void
    OGR_G_GetEnvelope3D(OGRGeometryH hGeom, OGREnvelope3D *psEnvelope)

    Computes and returns the bounding envelope (3D) for this geometry in
    the passed psEnvelope structure.

    This function is the same as the CPP method
    OGRGeometry::getEnvelope().

    Parameters:
    -----------

    hGeom:  handle of the geometry to get envelope from.

    psEnvelope:  the structure in which to place the results.

    OGR 1.9.0

### Centroid(self, *args) | source code
Centroid(Geometry self) -> Geometry int OGR_G_Centroid(OGRGeometryH hGeom, OGRGeometryH hCentroidPoint) Compute the geometry centroid. The centroid location is applied to the passed in OGRPoint object. The centroid is not necessarily within the geometry. This method relates to the SFCOM ISurface::get_Centroid() method however the current implementation based on GEOS can operate on other geometry types such as multipoint, linestring, geometrycollection such as multipolygons. OGC SF SQL 1.1 defines the operation for surfaces (polygons). SQL/MM-Part 3 defines the operation for surfaces and multisurfaces (multipolygons). This function is the same as the C++ method OGRGeometry::Centroid(). This function is built on the GEOS library, check it for the definition of the geometry operation. If OGR is built without the GEOS library, this function will always fail, issuing a CPLE_NotSupported error. OGRERR_NONE on success or OGRERR_FAILURE on error.

### PointOnSurface(self, *args) | source code
    PointOnSurface(Geometry self) -> Geometry

    OGRGeometryH
    OGR_G_PointOnSurface(OGRGeometryH hGeom)

    Returns a point guaranteed to lie on the surface.

    This method relates to the SFCOM ISurface::get_PointOnSurface() method
    however the current implementation based on GEOS can operate on other
    geometry types than the types that are supported by SQL/MM-Part 3 :
    surfaces (polygons) and multisurfaces (multipolygons).

    This method is built on the GEOS library, check it for the definition
    of the geometry operation. If OGR is built without the GEOS library,
    this method will always fail, issuing a CPLE_NotSupported error.

    Parameters:
    -----------

    hGeom:  the geometry to operate on.

    a point guaranteed to lie on the surface or NULL if an error occurred.

    OGR 1.10

### WkbSize(self, *args) | source code
    WkbSize(Geometry self) -> size_t

    int OGR_G_WkbSize(OGRGeometryH hGeom)

    Returns size of related binary representation.

    This function returns the exact number of bytes required to hold the
    well known binary representation of this geometry object. Its
    computation may be slightly expensive for complex geometries.

    This function relates to the SFCOM IWks::WkbSize() method.

    This function is the same as the CPP method OGRGeometry::WkbSize().

    Use OGR_G_WkbSizeEx() if called on huge geometries (> 2 GB serialized)

    Parameters:
    -----------

    hGeom:  handle on the geometry to get the binary size from.

    size of binary representation in bytes.

### GetCoordinateDimension(self, *args) | source code
    GetCoordinateDimension(Geometry self) -> int

    int
    OGR_G_GetCoordinateDimension(OGRGeometryH hGeom)

    Get the dimension of the coordinates in this geometry.

    This function is the same as the CPP method
    OGRGeometry::getCoordinateDimension().

    Parameters:
    -----------

    hGeom:  handle on the geometry to get the dimension of the coordinates
    from.

    Deprecated use OGR_G_CoordinateDimension(), OGR_G_Is3D(), or
    OGR_G_IsMeasured().

    this will return 2 or 3.

### CoordinateDimension(self, *args) | source code
    CoordinateDimension(Geometry self) -> int

    int
    OGR_G_CoordinateDimension(OGRGeometryH hGeom)

    Get the dimension of the coordinates in this geometry.

    This function is the same as the CPP method
    OGRGeometry::CoordinateDimension().

    Parameters:
    -----------

    hGeom:  handle on the geometry to get the dimension of the coordinates
    from.

    this will return 2 for XY, 3 for XYZ and XYM, and 4 for XYZM data.

    GDAL 2.1

### Is3D(self, *args) | source code
    Is3D(Geometry self) -> int

    int OGR_G_Is3D(OGRGeometryH hGeom)

    See whether this geometry has Z coordinates.

    This function is the same as the CPP method OGRGeometry::Is3D().

    Parameters:
    -----------

    hGeom:  handle on the geometry to check whether it has Z coordinates.

    TRUE if the geometry has Z coordinates.

    GDAL 2.1

### IsMeasured(self, *args) | source code
    IsMeasured(Geometry self) -> int

    int OGR_G_IsMeasured(OGRGeometryH
    hGeom)

    See whether this geometry is measured.

    This function is the same as the CPP method OGRGeometry::IsMeasured().

    Parameters:
    -----------

    hGeom:  handle on the geometry to check whether it is measured.

    TRUE if the geometry has M coordinates.

    GDAL 2.1

### SetCoordinateDimension(self, *args) | source code
    SetCoordinateDimension(Geometry self, int dimension)

    void
    OGR_G_SetCoordinateDimension(OGRGeometryH hGeom, int nNewDimension)

    Set the coordinate dimension.

    This method sets the explicit coordinate dimension. Setting the
    coordinate dimension of a geometry to 2 should zero out any existing Z
    values. Setting the dimension of a geometry collection, a compound
    curve, a polygon, etc. will affect the children geometries. This will
    also remove the M dimension if present before this call.

    Deprecated use OGR_G_Set3D() or OGR_G_SetMeasured().

    Parameters:
    -----------

    hGeom:  handle on the geometry to set the dimension of the
    coordinates.

    nNewDimension:  New coordinate dimension value, either 2 or 3.

### Set3D(self, *args) | source code
    Set3D(Geometry self, int b3D)

    void OGR_G_Set3D(OGRGeometryH hGeom,
    int bIs3D)

    Add or remove the Z coordinate dimension.

    This method adds or removes the explicit Z coordinate dimension.
    Removing the Z coordinate dimension of a geometry will remove any
    existing Z values. Adding the Z dimension to a geometry collection, a
    compound curve, a polygon, etc. will affect the children geometries.

    Parameters:
    -----------

    hGeom:  handle on the geometry to set or unset the Z dimension.

    bIs3D:  Should the geometry have a Z dimension, either TRUE or FALSE.

    GDAL 2.1

### SetMeasured(self, *args) | source code
    SetMeasured(Geometry self, int bMeasured)

    void
    OGR_G_SetMeasured(OGRGeometryH hGeom, int bIsMeasured)

    Add or remove the M coordinate dimension.

    This method adds or removes the explicit M coordinate dimension.
    Removing the M coordinate dimension of a geometry will remove any
    existing M values. Adding the M dimension to a geometry collection, a
    compound curve, a polygon, etc. will affect the children geometries.

    Parameters:
    -----------

    hGeom:  handle on the geometry to set or unset the M dimension.

    bIsMeasured:  Should the geometry have a M dimension, either TRUE or
    FALSE.

    GDAL 2.1

### GetDimension(self, *args) | source code
    GetDimension(Geometry self) -> int

    int
    OGR_G_GetDimension(OGRGeometryH hGeom)

    Get the dimension of this geometry.

    This function corresponds to the SFCOM IGeometry::GetDimension()
    method. It indicates the dimension of the geometry, but does not
    indicate the dimension of the underlying space (as indicated by
    OGR_G_GetCoordinateDimension() function).

    This function is the same as the CPP method
    OGRGeometry::getDimension().

    Parameters:
    -----------

    hGeom:  handle on the geometry to get the dimension from.

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

### Transform(self, *args) | source code
    Transform(Geometry self, CoordinateTransformation trans) -> OGRErr
    Transform(Geometry self, GeomTransformer transformer) -> Geometry

    OGRErr OGR_G_Transform(OGRGeometryH
    hGeom, OGRCoordinateTransformationH hTransform)

    Apply arbitrary coordinate transformation to geometry.

    This function will transform the coordinates of a geometry from their
    current spatial reference system to a new target spatial reference
    system. Normally this means reprojecting the vectors, but it could
    include datum shifts, and changes of units.

    Note that this function does not require that the geometry already
    have a spatial reference system. It will be assumed that they can be
    treated as having the source spatial reference system of the
    OGRCoordinateTransformation object, and the actual SRS of the geometry
    will be ignored. On successful completion the output
    OGRSpatialReference of the OGRCoordinateTransformation will be
    assigned to the geometry.

    This function is the same as the CPP method OGRGeometry::transform.

    Parameters:
    -----------

    hGeom:  handle on the geometry to apply the transform to.

    hTransform:  handle on the transformation to apply.

    OGRERR_NONE on success or an error code.