Geometry******************************************Geometry Help on Geometry in module osgeo.ogr object: class Geometry(__builtin__.object) | Proxy of C++ Geometry class | | Methods defined here: | | AddGeometry(*args) | AddGeometry(self, Geometry other) -> OGRErr | | AddGeometryDirectly(*args) | AddGeometryDirectly(self, Geometry other_disown) -> OGRErr | | AddPoint(*args, **kwargs) | AddPoint(self, double x, double y, double z=0) | | AddPoint_2D(*args) | AddPoint_2D(self, double x, double y) | | AssignSpatialReference(*args) | AssignSpatialReference(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. | | 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. | | Buffer(*args, **kwargs) | Buffer(self, double distance, int quadsecs=30) -> Geometry | | OGRGeometryH OGR_G_Buffer(OGRGeometryH | hTarget, double dfDist, int nQuadSegs) | | Centroid(*args) | Centroid(self) -> Geometry | | Clone(*args) | Clone(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. | | an handle on the copy of the geometry with the spatial reference | system as the original. | | CloseRings(*args) | CloseRings(self) | | void OGR_G_CloseRings(OGRGeometryH | hGeom) | | Contains(*args) | Contains(self, Geometry other) -> bool | | int OGR_G_Contains(OGRGeometryH | hThis, OGRGeometryH hOther) | | ConvexHull(*args) | ConvexHull(self) -> Geometry | | OGRGeometryH | OGR_G_ConvexHull(OGRGeometryH hTarget) | | Crosses(*args) | Crosses(self, Geometry other) -> bool | | int OGR_G_Crosses(OGRGeometryH hThis, | OGRGeometryH hOther) | | Destroy(self) | | Difference(*args) | Difference(self, Geometry other) -> Geometry | | OGRGeometryH | OGR_G_Difference(OGRGeometryH hThis, OGRGeometryH hOther) | | Disjoint(*args) | Disjoint(self, Geometry other) -> bool | | int OGR_G_Disjoint(OGRGeometryH | hThis, OGRGeometryH hOther) | | Distance(*args) | Distance(self, Geometry other) -> double | | double OGR_G_Distance(OGRGeometryH | hFirst, OGRGeometryH hOther) | | Empty(*args) | Empty(self) | | void OGR_G_Empty(OGRGeometryH hGeom) | | Clear geometry information. This restores the geometry to it's 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. | | Equal(*args) | Equal(self, Geometry other) -> bool | | int OGR_G_Equal(OGRGeometryH hGeom, | OGRGeometryH hOther) | | ExportToGML(*args) | ExportToGML(self) -> char | | ExportToJson(*args) | ExportToJson(self) -> char | | ExportToKML(*args) | ExportToKML(self, char altitude_mode=None) -> char | | ExportToWkb(*args, **kwargs) | ExportToWkb(self, int nLen, OGRwkbByteOrder byte_order=wkbXDR) -> OGRErr | | OGRErr | OGR_G_ExportToWkb(OGRGeometryH hGeom, OGRwkbByteOrder eOrder, unsigned | char *pabyDstBuffer) | | Convert a geometry into well known binary format. | | This function relates to the SFCOM IWks::ExportToWKB() method. | | This function is the same as the CPP method | OGRGeometry::exportToWkb(). | | 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. | | ExportToWkt(*args) | ExportToWkt(self, char argout) -> 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. | | 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. | | Currently OGRERR_NONE is always returned. | | FlattenTo2D(*args) | FlattenTo2D(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. | | GetArea(*args) | GetArea(self) -> double | | GetBoundary(*args) | GetBoundary(self) -> Geometry | | OGRGeometryH | OGR_G_GetBoundary(OGRGeometryH hTarget) | | GetCoordinateDimension(*args) | GetCoordinateDimension(self) -> int | | int | OGR_G_GetCoordinateDimension(OGRGeometryH hGeom) | | Get the dimension of the coordinates in this geometry. | | This function corresponds to the SFCOM IGeometry::GetDimension() | method. | | 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. | | in practice this always returns 2 indicating that coordinates are | specified within a two dimensional space. | | GetDimension(*args) | GetDimension(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. | | GetEnvelope(*args) | GetEnvelope(self, double argout) | | 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. | | GetGeometryCount(*args) | GetGeometryCount(self) -> int | | GetGeometryName(*args) | GetGeometryName(self) -> char | | 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. | | GetGeometryRef(*args) | GetGeometryRef(self, int geom) -> Geometry | | GetGeometryType(*args) | GetGeometryType(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. | | GetPoint(*args) | GetPoint(self, int iPoint=0, double argout=None) | | GetPointCount(*args) | GetPointCount(self) -> int | | GetPoint_2D(*args) | GetPoint_2D(self, int iPoint=0, double argout=None) | | GetSpatialReference(*args) | GetSpatialReference(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. | | GetX(*args, **kwargs) | GetX(self, int point=0) -> double | | GetY(*args, **kwargs) | GetY(self, int point=0) -> double | | GetZ(*args, **kwargs) | GetZ(self, int point=0) -> double | | Intersect(*args) | Intersect(self, Geometry other) -> bool | | int OGR_G_Intersect(OGRGeometryH | hGeom, OGRGeometryH hOtherGeom) | | Intersection(*args) | Intersection(self, Geometry other) -> Geometry | | OGRGeometryH | OGR_G_Intersection(OGRGeometryH hThis, OGRGeometryH hOther) | | IsEmpty(*args) | IsEmpty(self) -> bool | | int OGR_G_IsEmpty(OGRGeometryH hGeom) | | IsRing(*args) | IsRing(self) -> bool | | int OGR_G_IsRing(OGRGeometryH hGeom) | | IsSimple(*args) | IsSimple(self) -> bool | | int OGR_G_IsSimple(OGRGeometryH | hGeom) | | IsValid(*args) | IsValid(self) -> bool | | int OGR_G_IsValid(OGRGeometryH hGeom) | | Overlaps(*args) | Overlaps(self, Geometry other) -> bool | | int OGR_G_Overlaps(OGRGeometryH | hThis, OGRGeometryH hOther) | | SetCoordinateDimension(*args) | SetCoordinateDimension(self, int dimension) | | void | OGR_G_SetCoordinateDimension(OGRGeometryH hGeom, int nNewDimension) | | SetPoint(*args, **kwargs) | SetPoint(self, int point, double x, double y, double z=0) | | SetPoint_2D(*args, **kwargs) | SetPoint_2D(self, int point, double x, double y) | | SymmetricDifference(*args) | SymmetricDifference(self, Geometry other) -> Geometry | | OGRGeometryH | OGR_G_SymmetricDifference(OGRGeometryH hThis, OGRGeometryH hOther) | | Touches(*args) | Touches(self, Geometry other) -> bool | | int OGR_G_Touches(OGRGeometryH hThis, | OGRGeometryH hOther) | | Transform(*args) | Transform(self, CoordinateTransformation trans) -> OGRErr | | 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. | | TransformTo(*args) | TransformTo(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. | | Union(*args) | Union(self, Geometry other) -> Geometry | | OGRGeometryH OGR_G_Union(OGRGeometryH | hThis, OGRGeometryH hOther) | | Within(*args) | Within(self, Geometry other) -> bool | | int OGR_G_Within(OGRGeometryH hThis, | OGRGeometryH hOther) | | WkbSize(*args) | WkbSize(self) -> int | | 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(). | | Parameters: | ----------- | | hGeom: handle on the geometry to get the binary size from. | | size of binary representation in bytes. | | __del__ lambda self | | __getattr__ lambda self, name | | __init__(self, *args, **kwargs) | __init__(self, OGRwkbGeometryType type=wkbUnknown, char wkt=0, int wkb=0, | char gml=0) -> Geometry | | __reduce__(self) | | __repr__ = _swig_repr(self) | | __setattr__ lambda self, name, value | | __setstate__(self, state) | | __str__(self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __swig_destroy__ =| | | __swig_getmethods__ = {} | | __swig_setmethods__ = {} Geometry******************************************Geometry