![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Represents a coordinate reference system backed by a GDAL OGRSpatialReference. More...
#include <spatialreferencesystem.h>
Classes | |
| struct | LinearUnitInfo |
| Planar linear-unit information used by the 2D mesh writer. More... | |
Signals | |
| void | propertyChanged (const QString &propertyName) |
| Emitted when any property changes. | |
Public Member Functions | |
| SpatialReferenceSystem (const QString &authName="EPSG", int code=4326, QObject *parent=nullptr) | |
| Constructs a CRS from an EPSG code. | |
| SpatialReferenceSystem (const QString &wktOrProj, QObject *parent=nullptr) | |
| Constructs a CRS from a WKT or PROJ string. | |
| SpatialReferenceSystem (const SpatialReferenceSystem &other, QObject *parent=nullptr) | |
| Copy-constructs from another SpatialReferenceSystem. | |
| virtual | ~SpatialReferenceSystem () |
| QString | authName () const |
| Returns the authority name (e.g. "EPSG", "ESRI"). | |
| int | code () const |
| Returns the numeric authority code, or -1 if not known. | |
| QString | description () const |
| Returns a human-readable description/name for this CRS. | |
| void | setDescription (const QString &description) |
| Sets a custom description for this CRS. | |
| QString | toWkt () const |
| Exports this CRS as a WKT2 string. | |
| QString | toProj4 () const |
| Exports this CRS as a legacy PROJ.4 string. | |
| QString | toAuthority () const |
| Returns the "AUTHORITY:CODE" string, e.g. "EPSG:4326". | |
| bool | isGeographic () const |
| Returns true when the CRS uses geographic (angular) coordinates. | |
| bool | isProjected () const |
| Returns true when the CRS is a projected (Cartesian) CRS. | |
| bool | equals (const SpatialReferenceSystem &other) const |
Returns true when this CRS equals other (within GDAL tolerance). | |
| QString | linearUnitsName () const |
| Returns the name of the linear unit (e.g. "metre", "US survey foot"). Returns an empty string for geographic CRSes. | |
| double | linearUnitsToMetres () const |
| Returns the conversion factor from the linear unit to metres. Returns 1.0 for geographic CRSes. | |
| QString | angularUnitsName () const |
| Returns the name of the angular unit (e.g. "degree"). Returns an empty string for projected CRSes. | |
| LinearUnitInfo | planarLinearUnit () const |
| Returns a LinearUnitInfo describing the planar linear unit. | |
| OGRSpatialReference * | ogrSpatialReference () const |
| Returns a non-owning pointer to the underlying OGRSpatialReference. | |
| OGRCoordinateTransformation * | createTransformationTo (const SpatialReferenceSystem &target) const |
Creates a new OGRCoordinateTransformation from this CRS to target. | |
| bool | isLocal () const |
Static Public Member Functions | |
| static SpatialReferenceSystem * | fromWktOrProj (const QString &wktOrProj, QObject *parent=nullptr) |
| Creates a SpatialReferenceSystem from a WKT or PROJ string. | |
| static SpatialReferenceSystem * | fromAuthCode (const QString &authName, int code, QObject *parent=nullptr) |
| Creates a SpatialReferenceSystem from an authority code. | |
| static SpatialReferenceSystem * | untitled (QObject *parent=nullptr) |
| Creates a local / untitled CRS for models with no coordinate system defined. Coordinates are treated as raw Cartesian values; no reprojection is possible. | |
| 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.g. "FEET" or "METERS"). Distances and the scale bar will show correct values without requiring a geographic CRS. | |
Properties | |
| QString | authName |
| int | code |
| QString | description |
| QString | wkt |
| QString | proj4 |
| bool | isGeographic |
| bool | isProjected |
| QString | linearUnits |
Represents a coordinate reference system backed by a GDAL OGRSpatialReference.
Provides access to CRS metadata (authority, code, description, units) and factory methods for creating coordinate transformations between two CRSes. Retains ownership of the underlying OGRSpatialReference.
|
explicit |
Constructs a CRS from an EPSG code.
| authName | Authority name, e.g. "EPSG" (default). |
| code | Numeric authority code, e.g. 4326 (WGS 84, default). |
| parent | Qt parent object. |
|
explicit |
Constructs a CRS from a WKT or PROJ string.
| wktOrProj | WKT or PROJ.4/PROJ string representation. |
| parent | Qt parent object. |
|
explicit |
Copy-constructs from another SpatialReferenceSystem.
|
virtual |
| QString SpatialReferenceSystem::angularUnitsName | ( | ) | const |
Returns the name of the angular unit (e.g. "degree"). Returns an empty string for projected CRSes.
| QString SpatialReferenceSystem::authName | ( | ) | const |
Returns the authority name (e.g. "EPSG", "ESRI").
| int SpatialReferenceSystem::code | ( | ) | const |
Returns the numeric authority code, or -1 if not known.
| OGRCoordinateTransformation * SpatialReferenceSystem::createTransformationTo | ( | const SpatialReferenceSystem & | target | ) | const |
Creates a new OGRCoordinateTransformation from this CRS to target.
Caller takes ownership of the returned object; destroy it with OGRCoordinateTransformation::DestroyCT() or delete.
| target | Destination CRS. |
| QString SpatialReferenceSystem::description | ( | ) | const |
Returns a human-readable description/name for this CRS.
| bool SpatialReferenceSystem::equals | ( | const SpatialReferenceSystem & | other | ) | const |
Returns true when this CRS equals other (within GDAL tolerance).
|
static |
Creates a SpatialReferenceSystem from an authority code.
| authName | e.g. "EPSG". |
| code | Numeric EPSG/authority code. |
| parent | Qt parent for the new object. |
|
static |
Creates a SpatialReferenceSystem from a WKT or PROJ string.
| wktOrProj | WKT or PROJ string. |
| parent | Qt parent for the new object. |
| bool SpatialReferenceSystem::isGeographic | ( | ) | const |
Returns true when the CRS uses geographic (angular) coordinates.
| bool SpatialReferenceSystem::isLocal | ( | ) | const |
Returns true when this is a local (non-geographic, non-projected) CRS.
| bool SpatialReferenceSystem::isProjected | ( | ) | const |
Returns true when the CRS is a projected (Cartesian) CRS.
| QString SpatialReferenceSystem::linearUnitsName | ( | ) | const |
Returns the name of the linear unit (e.g. "metre", "US survey foot"). Returns an empty string for geographic CRSes.
| double SpatialReferenceSystem::linearUnitsToMetres | ( | ) | const |
Returns the conversion factor from the linear unit to metres. Returns 1.0 for geographic CRSes.
|
static |
Creates a local CRS with linear units derived from the SWMM [MAP] section Units field (e.g. "FEET" or "METERS"). Distances and the scale bar will show correct values without requiring a geographic CRS.
| mapUnits | Value of the [MAP] Units line (case-insensitive: "FEET"/"METERS"/…). |
| parent | Qt parent for the new object. |
| OGRSpatialReference * SpatialReferenceSystem::ogrSpatialReference | ( | ) | const |
Returns a non-owning pointer to the underlying OGRSpatialReference.
| SpatialReferenceSystem::LinearUnitInfo SpatialReferenceSystem::planarLinearUnit | ( | ) | const |
Returns a LinearUnitInfo describing the planar linear unit.
Use this at every boundary that must convert between project-CRS XY and engine-SI metres (2D mesh write/read).
|
signal |
Emitted when any property changes.
| propertyName | Name of the changed Q_PROPERTY. |
| void SpatialReferenceSystem::setDescription | ( | const QString & | description | ) |
Sets a custom description for this CRS.
| QString SpatialReferenceSystem::toAuthority | ( | ) | const |
Returns the "AUTHORITY:CODE" string, e.g. "EPSG:4326".
| QString SpatialReferenceSystem::toProj4 | ( | ) | const |
Exports this CRS as a legacy PROJ.4 string.
| QString SpatialReferenceSystem::toWkt | ( | ) | const |
Exports this CRS as a WKT2 string.
|
static |
Creates a local / untitled CRS for models with no coordinate system defined. Coordinates are treated as raw Cartesian values; no reprojection is possible.
|
read |
|
read |
|
readwrite |
|
read |
|
read |
|
read |
|
read |
|
read |