QGIS API Documentation 3.99.0-Master (d270888f95f)
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
27#include <QString>
28
29using namespace Qt::StringLiterals;
30
43{
44 public:
45
50
56 QgsCoordinateReferenceSystem crs() const { return mCrs; }
57
63 void setCrs( const QgsCoordinateReferenceSystem &crs ) { mCrs = crs; }
64
65 private:
66
68
69};
70
76{
77 Q_GADGET
78
79 public:
80
86
88
90 operator QVariant() const // cppcheck-suppress duplInheritedMember
91 {
92 return QVariant::fromValue( *this );
93 }
94
95 bool operator==( const QgsReferencedRectangle &other ) const;
96 bool operator!=( const QgsReferencedRectangle &other ) const;
97
98#ifdef SIP_RUN
99 SIP_PYOBJECT __repr__();
100 % MethodCode
101 QString str = u"<QgsReferencedRectangle: %1 (%2)>"_s.arg( sipCpp->asWktCoordinates(), sipCpp->crs().authid() );
102 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
103 % End
104#endif
105
106};
107
109
110
115{
116 public:
117
123
125
127 operator QVariant() const
128 {
129 return QVariant::fromValue( *this );
130 }
131
132 bool operator==( const QgsReferencedPointXY &other );
133 bool operator!=( const QgsReferencedPointXY &other );
134
135#ifdef SIP_RUN
136 SIP_PYOBJECT __repr__();
137 % MethodCode
138 QString str = u"<QgsReferencedPointXY: %1 (%2)>"_s.arg( sipCpp->asWkt(), sipCpp->crs().authid() );
139 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
140 % End
141#endif
142
143};
144
146
147
153{
154 public:
155
161
163
165 operator QVariant() const // cppcheck-suppress duplInheritedMember
166 {
167 return QVariant::fromValue( *this );
168 }
169
170 bool operator==( const QgsReferencedGeometry &other ) const;
171 bool operator!=( const QgsReferencedGeometry &other ) const;
172
176 static QgsReferencedGeometry fromReferencedPointXY( const QgsReferencedPointXY &point );
177
181 static QgsReferencedGeometry fromReferencedRect( const QgsReferencedRectangle &rectangle );
182
183
184#ifdef SIP_RUN
185 SIP_PYOBJECT __repr__();
186 % MethodCode
187 QString str = u"<QgsReferencedGeometry: %1 (%2)>"_s.arg( sipCpp->asWkt(), sipCpp->crs().authid() );
188 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
189 % End
190#endif
191
192};
193
195
196#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)