QGIS API Documentation 4.1.0-Master (60fea48833c)
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:
49
55 QgsCoordinateReferenceSystem crs() const { return mCrs; }
56
62 void setCrs( const QgsCoordinateReferenceSystem &crs ) { mCrs = crs; }
63
64 private:
66};
67
73{
74 Q_GADGET
75
76 public:
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 // clang-format off
96 SIP_PYOBJECT __repr__();
97 % MethodCode
98 QString str = u"<QgsReferencedRectangle: %1 (%2)>"_s.arg( sipCpp->asWktCoordinates(), sipCpp->crs().authid() );
99 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
100 % End
101// clang-format on
102#endif
103};
104
106
107
112{
113 public:
119
121
123 operator QVariant() const { return QVariant::fromValue( *this ); }
124
125 bool operator==( const QgsReferencedPointXY &other );
126 bool operator!=( const QgsReferencedPointXY &other );
127
128#ifdef SIP_RUN
129 // clang-format off
130 SIP_PYOBJECT __repr__();
131 % MethodCode
132 QString str = u"<QgsReferencedPointXY: %1 (%2)>"_s.arg( sipCpp->asWkt(), sipCpp->crs().authid() );
133 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
134 % End
135// clang-format on
136#endif
137};
138
140
141
147{
148 public:
154
156
158 operator QVariant() const // cppcheck-suppress duplInheritedMember
159 {
160 return QVariant::fromValue( *this );
161 }
162
163 bool operator==( const QgsReferencedGeometry &other ) const;
164 bool operator!=( const QgsReferencedGeometry &other ) const;
165
169 static QgsReferencedGeometry fromReferencedPointXY( const QgsReferencedPointXY &point );
170
174 static QgsReferencedGeometry fromReferencedRect( const QgsReferencedRectangle &rectangle );
175
176
177#ifdef SIP_RUN
178 // clang-format off
179 SIP_PYOBJECT __repr__();
180 % MethodCode
181 QString str = u"<QgsReferencedGeometry: %1 (%2)>"_s.arg( sipCpp->asWkt(), sipCpp->crs().authid() );
182 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
183 % End
184// clang-format on
185#endif
186};
187
189
190#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)