10#ifndef SPATIALREFERENCESYSTEM_H
11#define SPATIALREFERENCESYSTEM_H
17class OGRSpatialReference;
18class OGRCoordinateTransformation;
49 QObject *
parent =
nullptr);
57 QObject *
parent =
nullptr);
63 QObject *
parent =
nullptr);
72 [[nodiscard]] QString
authName() const;
77 [[nodiscard]]
int code() const;
95 [[nodiscard]] QString
toWkt() const;
101 [[nodiscard]] QString
toProj4() const;
155 double metresPerUnit = 1.0;
182 [[nodiscard]] OGRCoordinateTransformation *
194 QObject *
parent =
nullptr);
205 QObject *
parent =
nullptr);
221 QObject *
parent =
nullptr);
226 [[nodiscard]]
bool isLocal()
const;
237 void initFromAuthCode(
const QString &
authName,
int code);
238 void initFromWktOrProj(
const QString &wktOrProj);
240 OGRSpatialReference *m_ogrSRS =
nullptr;
243 QString m_description;
Represents a coordinate reference system backed by a GDAL OGRSpatialReference.
Definition spatialreferencesystem.h:28
OGRCoordinateTransformation * createTransformationTo(const SpatialReferenceSystem &target) const
Creates a new OGRCoordinateTransformation from this CRS to target.
Definition spatialreferencesystem.cpp:238
QString linearUnitsName() const
Returns the name of the linear unit (e.g. "metre", "US survey foot"). Returns an empty string for geo...
Definition spatialreferencesystem.cpp:187
bool isLocal() const
Definition spatialreferencesystem.cpp:162
static SpatialReferenceSystem * fromWktOrProj(const QString &wktOrProj, QObject *parent=nullptr)
Creates a SpatialReferenceSystem from a WKT or PROJ string.
Definition spatialreferencesystem.cpp:248
bool isProjected
Definition spatialreferencesystem.h:36
static SpatialReferenceSystem * localFromMapUnits(const QString &mapUnits, QObject *parent=nullptr)
Creates a local CRS with linear units derived from the SWMM [MAP] section Units field (e....
Definition spatialreferencesystem.cpp:281
QString toProj4() const
Exports this CRS as a legacy PROJ.4 string.
Definition spatialreferencesystem.cpp:141
void propertyChanged(const QString &propertyName)
Emitted when any property changes.
int code
Definition spatialreferencesystem.h:31
static SpatialReferenceSystem * untitled(QObject *parent=nullptr)
Creates a local / untitled CRS for models with no coordinate system defined. Coordinates are treated ...
Definition spatialreferencesystem.cpp:270
QString description
Definition spatialreferencesystem.h:32
LinearUnitInfo planarLinearUnit() const
Returns a LinearUnitInfo describing the planar linear unit.
Definition spatialreferencesystem.cpp:210
QString wkt
Definition spatialreferencesystem.h:33
QString toWkt() const
Exports this CRS as a WKT2 string.
Definition spatialreferencesystem.cpp:131
double linearUnitsToMetres() const
Returns the conversion factor from the linear unit to metres. Returns 1.0 for geographic CRSes.
Definition spatialreferencesystem.cpp:195
QString toAuthority() const
Returns the "AUTHORITY:CODE" string, e.g. "EPSG:4326".
Definition spatialreferencesystem.cpp:151
static SpatialReferenceSystem * fromAuthCode(const QString &authName, int code, QObject *parent=nullptr)
Creates a SpatialReferenceSystem from an authority code.
Definition spatialreferencesystem.cpp:256
bool equals(const SpatialReferenceSystem &other) const
Returns true when this CRS equals other (within GDAL tolerance).
Definition spatialreferencesystem.cpp:177
QString authName
Definition spatialreferencesystem.h:30
QString proj4
Definition spatialreferencesystem.h:34
void setDescription(const QString &description)
Sets a custom description for this CRS.
Definition spatialreferencesystem.cpp:118
bool isGeographic
Definition spatialreferencesystem.h:35
QString linearUnits
Definition spatialreferencesystem.h:37
QString angularUnitsName() const
Returns the name of the angular unit (e.g. "degree"). Returns an empty string for projected CRSes.
Definition spatialreferencesystem.cpp:201
OGRSpatialReference * ogrSpatialReference() const
Returns a non-owning pointer to the underlying OGRSpatialReference.
Definition spatialreferencesystem.cpp:232
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
Planar linear-unit information used by the 2D mesh writer.
Definition spatialreferencesystem.h:154
QString name
Definition spatialreferencesystem.h:156