QGIS API Documentation 3.41.0-Master (45a0abf3bec)
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_sip.h"
22#include "qgis_core.h"
24#include "qgsrectangle.h"
25#include "qgsgeometry.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 public:
74
80
82
84 operator QVariant() const // cppcheck-suppress duplInheritedMember
85 {
86 return QVariant::fromValue( *this );
87 }
88
89 bool operator==( const QgsReferencedRectangle &other ) const;
90 bool operator!=( const QgsReferencedRectangle &other ) const;
91
92#ifdef SIP_RUN
93 SIP_PYOBJECT __repr__();
94 % MethodCode
95 QString str = QStringLiteral( "<QgsReferencedRectangle: %1 (%2)>" ).arg( sipCpp->asWktCoordinates(), sipCpp->crs().authid() );
96 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
97 % End
98#endif
99
100};
101
103
104
109{
110 public:
111
117
119
121 operator QVariant() const
122 {
123 return QVariant::fromValue( *this );
124 }
125
126 bool operator==( const QgsReferencedPointXY &other );
127 bool operator!=( const QgsReferencedPointXY &other );
128
129#ifdef SIP_RUN
130 SIP_PYOBJECT __repr__();
131 % MethodCode
132 QString str = QStringLiteral( "<QgsReferencedPointXY: %1 (%2)>" ).arg( sipCpp->asWkt(), sipCpp->crs().authid() );
133 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
134 % End
135#endif
136
137};
138
140
141
147{
148 public:
149
155
157
159 operator QVariant() const // cppcheck-suppress duplInheritedMember
160 {
161 return QVariant::fromValue( *this );
162 }
163
164 bool operator==( const QgsReferencedGeometry &other ) const;
165 bool operator!=( const QgsReferencedGeometry &other ) const;
166
170 static QgsReferencedGeometry fromReferencedPointXY( const QgsReferencedPointXY &point );
171
175 static QgsReferencedGeometry fromReferencedRect( const QgsReferencedRectangle &rectangle );
176
177
178#ifdef SIP_RUN
179 SIP_PYOBJECT __repr__();
180 % MethodCode
181 QString str = QStringLiteral( "<QgsReferencedGeometry: %1 (%2)>" ).arg( sipCpp->asWkt(), sipCpp->crs().authid() );
182 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
183 % End
184#endif
185
186};
187
189
190#endif // QGSREFERENCEDGEOMETRY_H
This class represents a coordinate reference system (CRS).
A geometry is the spatial representation of a feature.
A class to represent a 2D point.
Definition qgspointxy.h:60
A rectangle specified with double values.
A base class for geometry primitives which are stored with an associated reference system.
QgsCoordinateReferenceSystem crs() const
Returns the associated coordinate reference system, or an invalid CRS if no reference system is set.
void setCrs(const QgsCoordinateReferenceSystem &crs)
Sets the associated crs.
A QgsGeometry with associated coordinate reference system.
QgsReferencedGeometry()=default
A QgsPointXY with associated coordinate reference system.
QgsReferencedPointXY()=default
A QgsRectangle with associated coordinate reference system.
QgsReferencedRectangle()=default
#define str(x)
Definition qgis.cpp:39
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
const QgsCoordinateReferenceSystem & crs