QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsreferencedgeometry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsreferencedgeometry.h
3 ----------------------
4 begin : June 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSREFERENCEDGEOMETRY_H
19#define QGSREFERENCEDGEOMETRY_H
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
24#include "qgsgeometry.h"
25#include "qgsrectangle.h"
26
39{
40 public:
41
46
52 QgsCoordinateReferenceSystem crs() const { return mCrs; }
53
59 void setCrs( const QgsCoordinateReferenceSystem &crs ) { mCrs = crs; }
60
61 private:
62
64
65};
66
72{
73 Q_GADGET
74
75 public:
76
82
84
86 operator QVariant() const // cppcheck-suppress duplInheritedMember
87 {
88 return QVariant::fromValue( *this );
89 }
90
91 bool operator==( const QgsReferencedRectangle &other ) const;
92 bool operator!=( const QgsReferencedRectangle &other ) const;
93
94#ifdef SIP_RUN
95 SIP_PYOBJECT __repr__();
96 % MethodCode
97 QString str = QStringLiteral( "<QgsReferencedRectangle: %1 (%2)>" ).arg( sipCpp->asWktCoordinates(), sipCpp->crs().authid() );
98 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
99 % End
100#endif
101
102};
103
105
106
111{
112 public:
113
119
121
123 operator QVariant() const
124 {
125 return QVariant::fromValue( *this );
126 }
127
128 bool operator==( const QgsReferencedPointXY &other );
129 bool operator!=( const QgsReferencedPointXY &other );
130
131#ifdef SIP_RUN
132 SIP_PYOBJECT __repr__();
133 % MethodCode
134 QString str = QStringLiteral( "<QgsReferencedPointXY: %1 (%2)>" ).arg( sipCpp->asWkt(), sipCpp->crs().authid() );
135 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
136 % End
137#endif
138
139};
140
142
143
149{
150 public:
151
157
159
161 operator QVariant() const // cppcheck-suppress duplInheritedMember
162 {
163 return QVariant::fromValue( *this );
164 }
165
166 bool operator==( const QgsReferencedGeometry &other ) const;
167 bool operator!=( const QgsReferencedGeometry &other ) const;
168
172 static QgsReferencedGeometry fromReferencedPointXY( const QgsReferencedPointXY &point );
173
177 static QgsReferencedGeometry fromReferencedRect( const QgsReferencedRectangle &rectangle );
178
179
180#ifdef SIP_RUN
181 SIP_PYOBJECT __repr__();
182 % MethodCode
183 QString str = QStringLiteral( "<QgsReferencedGeometry: %1 (%2)>" ).arg( sipCpp->asWkt(), sipCpp->crs().authid() );
184 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
185 % End
186#endif
187
188};
189
191
192#endif // QGSREFERENCEDGEOMETRY_H
Represents a coordinate reference system (CRS).
QgsPointXY()=default
QgsRectangle()=default
Constructor for a null rectangle.
QgsCoordinateReferenceSystem crs() const
Returns the associated coordinate reference system, or an invalid CRS if no reference system is set.
QgsReferencedGeometryBase(const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem())
Constructor for QgsReferencedGeometryBase, with the specified crs.
void setCrs(const QgsCoordinateReferenceSystem &crs)
Sets the associated crs.
A QgsGeometry with associated coordinate reference system.
QgsReferencedGeometry(const QgsGeometry &geometry, const QgsCoordinateReferenceSystem &crs)
Constructor for QgsReferencedGeometry, with the specified initial geometry and crs.
QgsReferencedGeometry()=default
A QgsPointXY with associated coordinate reference system.
QgsReferencedPointXY(const QgsPointXY &point, const QgsCoordinateReferenceSystem &crs)
Constructor for QgsReferencedPointXY, with the specified initial point and crs.
QgsReferencedPointXY()=default
A QgsRectangle with associated coordinate reference system.
QgsReferencedRectangle(const QgsRectangle &rectangle, const QgsCoordinateReferenceSystem &crs)
Constructor for QgsReferencedRectangle, with the specified initial rectangle and crs.
QgsReferencedRectangle()=default
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)