QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Member Functions | Static Public Member Functions | List of all members
QgsReferencedGeometry Class Reference

A QgsGeometry with associated coordinate reference system. More...

#include <qgsreferencedgeometry.h>

Inheritance diagram for QgsReferencedGeometry:
Inheritance graph
[legend]

Public Member Functions

 QgsReferencedGeometry ()=default
 Constructor for QgsReferencedGeometry. More...
 
 QgsReferencedGeometry (const QgsGeometry &geometry, const QgsCoordinateReferenceSystem &crs)
 Constructor for QgsReferencedGeometry, with the specified initial geometry and crs. More...
 
 operator QVariant () const
 Allows direct construction of QVariants from geometry. More...
 
- Public Member Functions inherited from QgsGeometry
 QgsGeometry () SIP_HOLDGIL
 Constructor. More...
 
 QgsGeometry (const QgsGeometry &)
 Copy constructor will prompt a deep copy of the object. More...
 
 QgsGeometry (QgsAbstractGeometry *geom)
 Creates a geometry from an abstract geometry object. More...
 
 QgsGeometry (std::unique_ptr< QgsAbstractGeometry > geom)
 Creates a geometry from an abstract geometry object. More...
 
virtual ~QgsGeometry ()
 
OperationResult addPart (const QgsGeometry &newPart)
 Adds a new island polygon to a multipolygon feature. More...
 
OperationResult addPart (const QgsPointSequence &points, QgsWkbTypes::GeometryType geomType=QgsWkbTypes::UnknownGeometry)
 Adds a new part to a the geometry. More...
 
OperationResult addPart (const QVector< QgsPointXY > &points, QgsWkbTypes::GeometryType geomType=QgsWkbTypes::UnknownGeometry)
 Adds a new part to a the geometry. More...
 
OperationResult addPart (QgsAbstractGeometry *part, QgsWkbTypes::GeometryType geomType=QgsWkbTypes::UnknownGeometry)
 Adds a new part to this geometry. More...
 
OperationResult addRing (const QVector< QgsPointXY > &ring)
 Adds a new ring to this geometry. More...
 
OperationResult addRing (QgsCurve *ring)
 Adds a new ring to this geometry. More...
 
void adjacentVertices (int atVertex, int &beforeVertex, int &afterVertex) const
 Returns the indexes of the vertices before and after the given vertex index. More...
 
double angleAtVertex (int vertex) const
 Returns the bisector angle for this geometry at the specified vertex. More...
 
double area () const
 Returns the planar, 2-dimensional area of the geometry. More...
 
QVector< QgsGeometryasGeometryCollection () const
 Returns contents of the geometry as a list of geometries. More...
 
QString asJson (int precision=17) const
 Exports the geometry to a GeoJSON string. More...
 
virtual json asJsonObject (int precision=17) const
 Exports the geometry to a json object. More...
 
QgsMultiPointXY asMultiPoint () const
 Returns the contents of the geometry as a multi-point. More...
 
QgsMultiPolygonXY asMultiPolygon () const
 Returns the contents of the geometry as a multi-polygon. More...
 
QgsMultiPolylineXY asMultiPolyline () const
 Returns the contents of the geometry as a multi-linestring. More...
 
QgsPointXY asPoint () const
 Returns the contents of the geometry as a 2-dimensional point. More...
 
QgsPolygonXY asPolygon () const
 Returns the contents of the geometry as a polygon. More...
 
QgsPolylineXY asPolyline () const
 Returns the contents of the geometry as a polyline. More...
 
QPointF asQPointF () const SIP_HOLDGIL
 Returns contents of the geometry as a QPointF if wkbType is WKBPoint, otherwise returns a null QPointF. More...
 
QPolygonF asQPolygonF () const SIP_HOLDGIL
 Returns contents of the geometry as a QPolygonF. More...
 
QByteArray asWkb (QgsAbstractGeometry::WkbFlags flags=QgsAbstractGeometry::WkbFlags()) const
 Export the geometry to WKB. More...
 
QString asWkt (int precision=17) const
 Exports the geometry to WKT. More...
 
int avoidIntersections (const QList< QgsVectorLayer * > &avoidIntersectionsLayers, const QHash< QgsVectorLayer *, QSet< QgsFeatureId > > &ignoreFeatures=(QHash< QgsVectorLayer *, QSet< QgsFeatureId > >()))
 Modifies geometry to avoid intersections with the layers specified in project properties. More...
 
QgsRectangle boundingBox () const
 Returns the bounding box of the geometry. More...
 
bool boundingBoxIntersects (const QgsGeometry &geometry) const
 Returns true if the bounding box of this geometry intersects with the bounding box of another geometry. More...
 
bool boundingBoxIntersects (const QgsRectangle &rectangle) const
 Returns true if the bounding box of this geometry intersects with a rectangle. More...
 
QgsGeometry buffer (double distance, int segments) const
 Returns a buffer region around this geometry having the given width and with a specified number of segments used to approximate curves. More...
 
QgsGeometry buffer (double distance, int segments, EndCapStyle endCapStyle, JoinStyle joinStyle, double miterLimit) const
 Returns a buffer region around the geometry, with additional style options. More...
 
QgsGeometry centroid () const
 Returns the center of mass of a geometry. More...
 
QgsGeometry clipped (const QgsRectangle &rectangle)
 Clips the geometry using the specified rectangle. More...
 
double closestSegmentWithContext (const QgsPointXY &point, QgsPointXY &minDistPoint, int &nextVertexIndex, int *leftOrRightOfSegment=nullptr, double epsilon=DEFAULT_SEGMENT_EPSILON) const
 Searches for the closest segment of geometry to the given point. More...
 
QgsPointXY closestVertex (const QgsPointXY &point, int &closestVertexIndex, int &previousVertexIndex, int &nextVertexIndex, double &sqrDist) const
 Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point and the indices of the vertices before and after the closest vertex. More...
 
double closestVertexWithContext (const QgsPointXY &point, int &atVertex) const
 Searches for the closest vertex in this geometry to the given point. More...
 
QVector< QgsGeometrycoerceToType (QgsWkbTypes::Type type) const
 Attempts to coerce this geometry into the specified destination type. More...
 
QgsGeometry combine (const QgsGeometry &geometry) const
 Returns a geometry representing all the points in this geometry and other (a union geometry operation). More...
 
QgsAbstractGeometry::const_part_iterator const_parts_begin () const
 Returns STL-style const iterator pointing to the first part of the geometry. More...
 
QgsAbstractGeometry::const_part_iterator const_parts_end () const
 Returns STL-style iterator pointing to the imaginary part after the last part of the geometry. More...
 
const QgsAbstractGeometryconstGet () const SIP_HOLDGIL
 Returns a non-modifiable (const) reference to the underlying abstract geometry primitive. More...
 
QgsGeometryConstPartIterator constParts () const
 Returns Java-style iterator for traversal of parts of the geometry. More...
 
bool contains (const QgsGeometry &geometry) const
 Returns true if the geometry completely contains another geometry. More...
 
bool contains (const QgsPointXY *p) const
 Returns true if the geometry contains the point p. More...
 
bool convertGeometryCollectionToSubclass (QgsWkbTypes::GeometryType geomType)
 Converts geometry collection to a the desired geometry type subclass (multi-point, multi-linestring or multi-polygon). More...
 
QgsGeometry convertToCurves (double distanceTolerance=1e-8, double angleTolerance=1e-8) const
 Attempts to convert a non-curved geometry into a curved geometry type (e.g. More...
 
bool convertToMultiType ()
 Converts single type geometry into multitype geometry e.g. More...
 
bool convertToSingleType ()
 Converts multi type geometry into single type geometry e.g. More...
 
void convertToStraightSegment (double tolerance=M_PI/180., QgsAbstractGeometry::SegmentationToleranceType toleranceType=QgsAbstractGeometry::MaximumAngle)
 Converts the geometry to straight line segments, if it is a curved geometry type. More...
 
QgsGeometry convertToType (QgsWkbTypes::GeometryType destType, bool destMultipart=false) const
 Try to convert the geometry to the requested type. More...
 
QgsGeometry convexHull () const
 Returns the smallest convex polygon that contains all the points in the geometry. More...
 
bool crosses (const QgsGeometry &geometry) const
 Returns true if the geometry crosses another geometry. More...
 
QgsGeometry delaunayTriangulation (double tolerance=0.0, bool edgesOnly=false) const
 Returns the Delaunay triangulation for the vertices of the geometry. More...
 
bool deletePart (int partNum)
 Deletes part identified by the part number. More...
 
bool deleteRing (int ringNum, int partNum=0)
 Deletes a ring in polygon or multipolygon. More...
 
bool deleteVertex (int atVertex)
 Deletes the vertex at the given position number and item (first number is index 0) More...
 
QgsGeometry densifyByCount (int extraNodesPerSegment) const
 Returns a copy of the geometry which has been densified by adding the specified number of extra nodes within each segment of the geometry. More...
 
QgsGeometry densifyByDistance (double distance) const
 Densifies the geometry by adding regularly placed extra nodes inside each segment so that the maximum distance between any two nodes does not exceed the specified distance. More...
 
QgsGeometry difference (const QgsGeometry &geometry) const
 Returns a geometry representing the points making up this geometry that do not make up other. More...
 
bool disjoint (const QgsGeometry &geometry) const
 Returns true if the geometry is disjoint of another geometry. More...
 
double distance (const QgsGeometry &geom) const
 Returns the minimum distance between this geometry and another geometry. More...
 
double distanceToVertex (int vertex) const
 Returns the distance along this geometry from its first vertex to the specified vertex. More...
 
void draw (QPainter &p) const
 Draws the geometry onto a QPainter. More...
 
bool equals (const QgsGeometry &geometry) const
 Test if this geometry is exactly equal to another geometry. More...
 
QgsGeometry extendLine (double startDistance, double endDistance) const
 Extends a (multi)line geometry by extrapolating out the start or end of the line by a specified distance. More...
 
QgsGeometry extrude (double x, double y)
 Returns an extruded version of this geometry. More...
 
void filterVertices (const std::function< bool(const QgsPoint &) > &filter)
 Filters the vertices from the geometry in place, removing any which do not return true for the filter function check. More...
 
QgsGeometry forceRHR () const
 Forces geometries to respect the Right-Hand-Rule, in which the area that is bounded by a polygon is to the right of the boundary. More...
 
double frechetDistance (const QgsGeometry &geom) const SIP_THROW(QgsNotSupportedException)
 Returns the Fréchet distance between this geometry and geom, restricted to discrete points for both geometries. More...
 
double frechetDistanceDensify (const QgsGeometry &geom, double densifyFraction) const SIP_THROW(QgsNotSupportedException)
 Returns the Fréchet distance between this geometry and geom, restricted to discrete points for both geometries. More...
 
void fromWkb (const QByteArray &wkb)
 Set the geometry, feeding in the buffer containing OGC Well-Known Binary. More...
 
void fromWkb (unsigned char *wkb, int length)
 Set the geometry, feeding in the buffer containing OGC Well-Known Binary and the buffer's length. More...
 
QgsAbstractGeometryget ()
 Returns a modifiable (non-const) reference to the underlying abstract geometry primitive. More...
 
double hausdorffDistance (const QgsGeometry &geom) const
 Returns the Hausdorff distance between this geometry and geom. More...
 
double hausdorffDistanceDensify (const QgsGeometry &geom, double densifyFraction) const
 Returns the Hausdorff distance between this geometry and geom. More...
 
bool insertVertex (const QgsPoint &point, int beforeVertex)
 Insert a new vertex before the given vertex index, ring and item (first number is index 0) If the requested vertex number (beforeVertex.back()) is greater than the last actual vertex on the requested ring and item, it is assumed that the vertex is to be appended instead of inserted. More...
 
bool insertVertex (double x, double y, int beforeVertex)
 Insert a new vertex before the given vertex index, ring and item (first number is index 0) If the requested vertex number (beforeVertex.back()) is greater than the last actual vertex on the requested ring and item, it is assumed that the vertex is to be appended instead of inserted. More...
 
QgsGeometry interpolate (double distance) const
 Returns an interpolated point on the geometry at the specified distance. More...
 
double interpolateAngle (double distance) const
 Returns the angle parallel to the linestring or polygon boundary at the specified distance along the geometry. More...
 
QgsGeometry intersection (const QgsGeometry &geometry) const
 Returns a geometry representing the points shared by this geometry and other. More...
 
bool intersects (const QgsGeometry &geometry) const
 Returns true if this geometry exactly intersects with another geometry. More...
 
bool intersects (const QgsRectangle &rectangle) const
 Returns true if this geometry exactly intersects with a rectangle. More...
 
bool isAxisParallelRectangle (double maximumDeviation, bool simpleRectanglesOnly=false) const
 Returns true if the geometry is a polygon that is almost an axis-parallel rectangle. More...
 
bool isEmpty () const
 Returns true if the geometry is empty (eg a linestring with no vertices, or a collection with no geometries). More...
 
bool isGeosEqual (const QgsGeometry &) const
 Compares the geometry with another geometry using GEOS. More...
 
bool isGeosValid (QgsGeometry::ValidityFlags flags=QgsGeometry::ValidityFlags()) const
 Checks validity of the geometry using GEOS. More...
 
bool isMultipart () const SIP_HOLDGIL
 Returns true if WKB of the geometry is of WKBMulti* type. More...
 
bool isNull () const SIP_HOLDGIL
 Returns true if the geometry is null (ie, contains no underlying geometry accessible via geometry() ). More...
 
bool isSimple () const
 Determines whether the geometry is simple (according to OGC definition), i.e. More...
 
QgsGeometry largestEmptyCircle (double tolerance, const QgsGeometry &boundary=QgsGeometry()) const SIP_THROW(QgsNotSupportedException)
 Constructs the Largest Empty Circle for a set of obstacle geometries, up to a specified tolerance. More...
 
QString lastError () const SIP_HOLDGIL
 Returns an error string referring to the last error encountered either when this geometry was created or when an operation was performed on the geometry. More...
 
double length () const
 Returns the planar, 2-dimensional length of geometry. More...
 
double lineLocatePoint (const QgsGeometry &point) const
 Returns a distance representing the location along this linestring of the closest point on this linestring geometry to the specified point. More...
 
QgsGeometry makeDifference (const QgsGeometry &other) const
 Returns the geometry formed by modifying this geometry such that it does not intersect the other geometry. More...
 
int makeDifferenceInPlace (const QgsGeometry &other)
 Changes this geometry such that it does not intersect the other geometry. More...
 
QgsGeometry makeValid () const
 Attempts to make an invalid geometry valid without losing vertices. More...
 
void mapToPixel (const QgsMapToPixel &mtp)
 Transforms the geometry from map units to pixels in place. More...
 
QgsGeometry mergeLines () const
 Merges any connected lines in a LineString/MultiLineString geometry and converts them to single line strings. More...
 
QgsGeometry minimalEnclosingCircle (QgsPointXY &center, double &radius, unsigned int segments=36) const
 Returns the minimal enclosing circle for the geometry. More...
 
QgsGeometry minimalEnclosingCircle (unsigned int segments=36) const
 Returns the minimal enclosing circle for the geometry. More...
 
double minimumClearance () const SIP_THROW(QgsNotSupportedException)
 Computes the minimum clearance of a geometry. More...
 
QgsGeometry minimumClearanceLine () const SIP_THROW(QgsNotSupportedException)
 Returns a LineString whose endpoints define the minimum clearance of a geometry. More...
 
QgsGeometry minimumWidth () const SIP_THROW(QgsNotSupportedException)
 Returns a linestring geometry which represents the minimum diameter of the geometry. More...
 
bool moveVertex (const QgsPoint &p, int atVertex)
 Moves the vertex at the given position number and item (first number is index 0) to the given coordinates. More...
 
bool moveVertex (double x, double y, int atVertex)
 Moves the vertex at the given position number and item (first number is index 0) to the given coordinates. More...
 
QgsGeometry nearestPoint (const QgsGeometry &other) const
 Returns the nearest (closest) point on this geometry to another geometry. More...
 
QgsGeometry node () const
 Returns a (Multi)LineString representing the fully noded version of a collection of linestrings. More...
 
void normalize ()
 Reorganizes the geometry into a normalized form (or "canonical" form). More...
 
QgsGeometry offsetCurve (double distance, int segments, JoinStyle joinStyle, double miterLimit) const
 Returns an offset line at a given distance and side from an input line. More...
 
 operator QVariant () const
 Allows direct construction of QVariants from geometry. More...
 
QgsGeometryoperator= (QgsGeometry const &rhs)
 Creates a deep copy of the object. More...
 
QgsGeometry orientedMinimumBoundingBox () const
 Returns the oriented minimum bounding box for the geometry, which is the smallest (by area) rotated rectangle which fully encompasses the geometry. More...
 
QgsGeometry orientedMinimumBoundingBox (double &area, double &angle, double &width, double &height) const
 Returns the oriented minimum bounding box for the geometry, which is the smallest (by area) rotated rectangle which fully encompasses the geometry. More...
 
QgsGeometry orthogonalize (double tolerance=1.0E-8, int maxIterations=1000, double angleThreshold=15.0) const
 Attempts to orthogonalize a line or polygon geometry by shifting vertices to make the geometries angles either right angles or flat lines. More...
 
bool overlaps (const QgsGeometry &geometry) const
 Returns true if the geometry overlaps another geometry. More...
 
QgsGeometryPartIterator parts ()
 Returns Java-style iterator for traversal of parts of the geometry. More...
 
QgsAbstractGeometry::part_iterator parts_begin ()
 Returns STL-style iterator pointing to the first part of the geometry. More...
 
QgsAbstractGeometry::part_iterator parts_end ()
 Returns STL-style iterator pointing to the imaginary part after the last part of the geometry. More...
 
QgsGeometry pointOnSurface () const
 Returns a point guaranteed to lie on the surface of a geometry. More...
 
QgsGeometry poleOfInaccessibility (double precision, double *distanceToBoundary=nullptr) const
 Calculates the approximate pole of inaccessibility for a surface, which is the most distant internal point from the boundary of the surface. More...
 
QVector< QgsPointXYrandomPointsInPolygon (int count, const std::function< bool(const QgsPointXY &) > &acceptPoint, unsigned long seed=0, QgsFeedback *feedback=nullptr, int maxTriesPerPoint=0) const
 Returns a list of count random points generated inside a (multi)polygon geometry (if acceptPoint is specified, and restrictive, the number of points returned may be less than count). More...
 
QVector< QgsPointXYrandomPointsInPolygon (int count, unsigned long seed=0, QgsFeedback *feedback=nullptr) const
 Returns a list of count random points generated inside a (multi)polygon geometry. More...
 
bool removeDuplicateNodes (double epsilon=4 *std::numeric_limits< double >::epsilon(), bool useZValues=false)
 Removes duplicate nodes from the geometry, wherever removing the nodes does not result in a degenerate geometry. More...
 
QgsGeometry removeInteriorRings (double minimumAllowedArea=-1) const
 Removes the interior rings from a (multi)polygon geometry. More...
 
bool requiresConversionToStraightSegments () const
 Returns true if the geometry is a curved geometry type which requires conversion to display as straight line segments. More...
 
OperationResult reshapeGeometry (const QgsLineString &reshapeLineString)
 Replaces a part of this geometry with another line. More...
 
OperationResult rotate (double rotation, const QgsPointXY &center)
 Rotate this geometry around the Z axis. More...
 
void set (QgsAbstractGeometry *geometry)
 Sets the underlying geometry store. More...
 
QgsGeometry sharedPaths (const QgsGeometry &other) const
 Find paths shared between the two given lineal geometries (this and other). More...
 
QgsGeometry shortestLine (const QgsGeometry &other) const
 Returns the shortest line joining this geometry to another geometry. More...
 
QgsGeometry simplify (double tolerance) const
 Returns a simplified version of this geometry using a specified tolerance value. More...
 
QgsGeometry singleSidedBuffer (double distance, int segments, BufferSide side, JoinStyle joinStyle=JoinStyleRound, double miterLimit=2.0) const
 Returns a single sided buffer for a (multi)line geometry. More...
 
QgsGeometry smooth (unsigned int iterations=1, double offset=0.25, double minimumDistance=-1.0, double maxAngle=180.0) const
 Smooths a geometry by rounding off corners using the Chaikin algorithm. More...
 
QgsGeometry snappedToGrid (double hSpacing, double vSpacing, double dSpacing=0, double mSpacing=0) const
 Returns a new geometry with all points or vertices snapped to the closest point of the grid. More...
 
OperationResult splitGeometry (const QgsCurve *curve, QVector< QgsGeometry > &newGeometries, bool preserveCircular, bool topological, QgsPointSequence &topologyTestPoints, bool splitFeature=true)
 Splits this geometry according to a given curve. More...
 
OperationResult splitGeometry (const QgsPointSequence &splitLine, QVector< QgsGeometry > &newGeometries, bool topological, QgsPointSequence &topologyTestPoints, bool splitFeature=true, bool skipIntersectionTest=false)
 Splits this geometry according to a given line. More...
 
Q_DECL_DEPRECATED OperationResult splitGeometry (const QVector< QgsPointXY > &splitLine, QVector< QgsGeometry > &newGeometries, bool topological, QVector< QgsPointXY > &topologyTestPoints, bool splitFeature=true)
 Splits this geometry according to a given line. More...
 
double sqrDistToVertexAt (QgsPointXY &point SIP_IN, int atVertex) const
 Returns the squared Cartesian distance between the given point to the given vertex index (vertex at the given position number, ring and item (first number is index 0)) More...
 
QgsGeometry subdivide (int maxNodes=256) const
 Subdivides the geometry. More...
 
QgsGeometry symDifference (const QgsGeometry &geometry) const
 Returns a geometry representing the points making up this geometry that do not make up other. More...
 
QgsGeometry taperedBuffer (double startWidth, double endWidth, int segments) const
 Calculates a variable width buffer ("tapered buffer") for a (multi)curve geometry. More...
 
bool touches (const QgsGeometry &geometry) const
 Returns true if the geometry touches another geometry. More...
 
OperationResult transform (const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection direction=QgsCoordinateTransform::ForwardTransform, bool transformZ=false) SIP_THROW(QgsCsException)
 Transforms this geometry as described by the coordinate transform ct. More...
 
OperationResult transform (const QTransform &t, double zTranslate=0.0, double zScale=1.0, double mTranslate=0.0, double mScale=1.0)
 Transforms the x and y components of the geometry using a QTransform object t. More...
 
void transformVertices (const std::function< QgsPoint(const QgsPoint &) > &transform)
 Transforms the vertices from the geometry in place, applying the transform function to every vertex. More...
 
OperationResult translate (double dx, double dy, double dz=0.0, double dm=0.0)
 Translates this geometry by dx, dy, dz and dm. More...
 
QgsWkbTypes::GeometryType type () const SIP_HOLDGIL
 Returns type of the geometry as a QgsWkbTypes::GeometryType. More...
 
void validateGeometry (QVector< QgsGeometry::Error > &errors, ValidationMethod method=ValidatorQgisInternal, QgsGeometry::ValidityFlags flags=QgsGeometry::ValidityFlags()) const
 Validates geometry and produces a list of geometry errors. More...
 
QgsGeometry variableWidthBufferByM (int segments) const
 Calculates a variable width buffer for a (multi)linestring geometry, where the width at each node is taken from the linestring m values. More...
 
QgsPoint vertexAt (int atVertex) const
 Returns coordinates of a vertex. More...
 
bool vertexIdFromVertexNr (int number, QgsVertexId &id) const
 Calculates the vertex ID from a vertex number. More...
 
int vertexNrFromVertexId (QgsVertexId id) const
 Returns the vertex number corresponding to a vertex id. More...
 
QgsVertexIterator vertices () const
 Returns a read-only, Java-style iterator for traversal of vertices of all the geometry, including all geometry parts and rings. More...
 
QgsAbstractGeometry::vertex_iterator vertices_begin () const
 Returns STL-style iterator pointing to the first vertex of the geometry. More...
 
QgsAbstractGeometry::vertex_iterator vertices_end () const
 Returns STL-style iterator pointing to the imaginary vertex after the last vertex of the geometry. More...
 
QgsGeometry voronoiDiagram (const QgsGeometry &extent=QgsGeometry(), double tolerance=0.0, bool edgesOnly=false) const
 Creates a Voronoi diagram for the nodes contained within the geometry. More...
 
bool within (const QgsGeometry &geometry) const
 Returns true if the geometry is completely within another geometry. More...
 
int wkbSize (QgsAbstractGeometry::WkbFlags flags=QgsAbstractGeometry::WkbFlags()) const
 Returns the length of the QByteArray returned by asWkb() More...
 
QgsWkbTypes::Type wkbType () const SIP_HOLDGIL
 Returns type of the geometry as a WKB type (point / linestring / polygon etc.) More...
 
- Public Member Functions inherited from QgsReferencedGeometryBase
 QgsReferencedGeometryBase (const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem())
 Constructor for QgsReferencedGeometryBase, with the specified crs. More...
 
QgsCoordinateReferenceSystem crs () const
 Returns the associated coordinate reference system, or an invalid CRS if no reference system is set. More...
 
void setCrs (const QgsCoordinateReferenceSystem &crs)
 Sets the associated crs. More...
 

Static Public Member Functions

static QgsReferencedGeometry fromReferencedPointXY (const QgsReferencedPointXY &point)
 Construct a new QgsReferencedGeometry from referenced point. More...
 
static QgsReferencedGeometry fromReferencedRect (const QgsReferencedRectangle &rectangle)
 Construct a new QgsReferencedGeometry from referenced rectangle. More...
 
- Static Public Member Functions inherited from QgsGeometry
static QgsGeometry collectGeometry (const QVector< QgsGeometry > &geometries)
 Creates a new multipart geometry from a list of QgsGeometry objects. More...
 
static bool compare (const QgsMultiPolygonXY &p1, const QgsMultiPolygonXY &p2, double epsilon=4 *std::numeric_limits< double >::epsilon())
 Compares two multipolygons for equality within a specified tolerance. More...
 
static bool compare (const QgsPolygonXY &p1, const QgsPolygonXY &p2, double epsilon=4 *std::numeric_limits< double >::epsilon())
 Compares two polygons for equality within a specified tolerance. More...
 
static bool compare (const QgsPolylineXY &p1, const QgsPolylineXY &p2, double epsilon=4 *std::numeric_limits< double >::epsilon())
 Compares two polylines for equality within a specified tolerance. More...
 
static void convertPointList (const QgsPointSequence &input, QVector< QgsPointXY > &output)
 Downgrades a point list from QgsPoint to QgsPointXY. More...
 
static void convertPointList (const QVector< QgsPointXY > &input, QgsPointSequence &output)
 Upgrades a point list from QgsPointXY to QgsPoint. More...
 
static QgsGeometryEnginecreateGeometryEngine (const QgsAbstractGeometry *geometry)
 Creates and returns a new geometry engine representing the specified geometry. More...
 
static Q_DECL_DEPRECATED QgsPolygonXY createPolygonFromQPolygonF (const QPolygonF &polygon)
 Creates a QgsPolygonXYfrom a QPolygonF. More...
 
static Q_DECL_DEPRECATED QgsPolylineXY createPolylineFromQPolygonF (const QPolygonF &polygon)
 Creates a QgsPolylineXY from a QPolygonF. More...
 
static QgsGeometry createWedgeBuffer (const QgsPoint &center, double azimuth, double angularWidth, double outerRadius, double innerRadius=0)
 Creates a wedge shaped buffer from a center point. More...
 
static QgsGeometry fromMultiPointXY (const QgsMultiPointXY &multipoint)
 Creates a new geometry from a QgsMultiPointXY object. More...
 
static QgsGeometry fromMultiPolygonXY (const QgsMultiPolygonXY &multipoly)
 Creates a new geometry from a QgsMultiPolygon. More...
 
static QgsGeometry fromMultiPolylineXY (const QgsMultiPolylineXY &multiline)
 Creates a new geometry from a QgsMultiPolylineXY object. More...
 
static QgsGeometry fromPointXY (const QgsPointXY &point) SIP_HOLDGIL
 Creates a new geometry from a QgsPointXY object. More...
 
static QgsGeometry fromPolygonXY (const QgsPolygonXY &polygon)
 Creates a new geometry from a QgsPolygon. More...
 
static QgsGeometry fromPolyline (const QgsPolyline &polyline)
 Creates a new LineString geometry from a list of QgsPoint points. More...
 
static QgsGeometry fromPolylineXY (const QgsPolylineXY &polyline)
 Creates a new LineString geometry from a list of QgsPointXY points. More...
 
static QgsGeometry fromQPointF (QPointF point) SIP_HOLDGIL
 Construct geometry from a QPointF. More...
 
static QgsGeometry fromQPolygonF (const QPolygonF &polygon)
 Construct geometry from a QPolygonF. More...
 
static QgsGeometry fromRect (const QgsRectangle &rect) SIP_HOLDGIL
 Creates a new geometry from a QgsRectangle. More...
 
static QgsGeometry fromWkt (const QString &wkt)
 Creates a new geometry from a WKT string. More...
 
static QgsGeometry polygonize (const QVector< QgsGeometry > &geometries)
 Creates a GeometryCollection geometry containing possible polygons formed from the constituent linework of a set of geometries. More...
 
static QgsGeometry unaryUnion (const QVector< QgsGeometry > &geometries)
 Compute the unary union on a list of geometries. More...
 

Additional Inherited Members

- Public Types inherited from QgsGeometry
enum  BufferSide { SideLeft = 0 , SideRight }
 Side of line to buffer. More...
 
enum  EndCapStyle { CapRound = 1 , CapFlat , CapSquare }
 End cap styles for buffers. More...
 
enum  JoinStyle { JoinStyleRound = 1 , JoinStyleMiter , JoinStyleBevel }
 Join styles for buffers. More...
 
enum  OperationResult {
  Success = 0 , NothingHappened = 1000 , InvalidBaseGeometry , InvalidInputGeometryType ,
  SelectionIsEmpty , SelectionIsGreaterThanOne , GeometryEngineError , LayerNotEditable ,
  AddPartSelectedGeometryNotFound , AddPartNotMultiGeometry , AddRingNotClosed , AddRingNotValid ,
  AddRingCrossesExistingRings , AddRingNotInExistingFeature , SplitCannotSplitPoint
}
 Success or failure of a geometry operation. More...
 
enum  ValidationMethod { ValidatorQgisInternal , ValidatorGeos }
 Available methods for validating geometries. More...
 
enum  ValidityFlag { FlagAllowSelfTouchingHoles = 1 << 0 }
 Validity check flags. More...
 
- Properties inherited from QgsGeometry
Q_GADGET bool isNull
 
QgsWkbTypes::GeometryType type
 

Detailed Description

A QgsGeometry with associated coordinate reference system.

Since
QGIS 3.16

Definition at line 155 of file qgsreferencedgeometry.h.

Constructor & Destructor Documentation

◆ QgsReferencedGeometry() [1/2]

QgsReferencedGeometry::QgsReferencedGeometry ( const QgsGeometry geometry,
const QgsCoordinateReferenceSystem crs 
)

Constructor for QgsReferencedGeometry, with the specified initial geometry and crs.

Definition at line 54 of file qgsreferencedgeometry.cpp.

◆ QgsReferencedGeometry() [2/2]

QgsReferencedGeometry::QgsReferencedGeometry ( )
default

Constructor for QgsReferencedGeometry.

Member Function Documentation

◆ fromReferencedPointXY()

QgsReferencedGeometry QgsReferencedGeometry::fromReferencedPointXY ( const QgsReferencedPointXY point)
static

Construct a new QgsReferencedGeometry from referenced point.

Definition at line 59 of file qgsreferencedgeometry.cpp.

◆ fromReferencedRect()

QgsReferencedGeometry QgsReferencedGeometry::fromReferencedRect ( const QgsReferencedRectangle rectangle)
static

Construct a new QgsReferencedGeometry from referenced rectangle.

Definition at line 64 of file qgsreferencedgeometry.cpp.

◆ operator QVariant()

QgsReferencedGeometry::operator QVariant ( ) const
inline

Allows direct construction of QVariants from geometry.

Definition at line 171 of file qgsreferencedgeometry.h.


The documentation for this class was generated from the following files: