Singleton that queries the GDAL CRS database and manages CRS objects.
More...
#include <crsmanager.h>
Singleton that queries the GDAL CRS database and manages CRS objects.
Provides methods to:
- List all CRSes available in the GDAL database (filterable by authority / type / keyword).
- Create SpatialReferenceSystem instances by authority+code or WKT/PROJ string.
- Compare two SRSes for equality.
- Query units for a CRS.
Usage:
Singleton that queries the GDAL CRS database and manages CRS objects.
Definition crsmanager.h:51
static CRSManager & instance()
Returns the application-wide singleton instance.
Definition crsmanager.cpp:79
QList< CRSInfo > queryDatabase(const QString &keyword={}, const QString &authority={}, bool includeDeprecated=false) const
Returns a flat list of all (or matching) CRS records from the GDAL database.
Definition crsmanager.cpp:110
◆ addRecentCRS()
| void CRSManager::addRecentCRS |
( |
const QString & |
authName, |
|
|
int |
code |
|
) |
| |
Records an authority+code pair as recently used.
◆ areSameCRS()
Returns true when a and b represent the same CRS.
◆ availableAuthorities()
| QStringList CRSManager::availableAuthorities |
( |
| ) |
const |
Returns the list of authority names found in the GDAL database.
◆ clearRecentCRSes()
| void CRSManager::clearRecentCRSes |
( |
| ) |
|
Clears the recent-CRS list.
◆ createFromAuthCode()
| SpatialReferenceSystem * CRSManager::createFromAuthCode |
( |
const QString & |
authName, |
|
|
int |
code, |
|
|
QObject * |
parent = nullptr |
|
) |
| const |
Creates a CRS from an authority + code pair.
- Parameters
-
| authName | e.g. "EPSG". |
| code | Numeric authority code. |
| parent | Qt parent for the new object. |
- Returns
- Heap-allocated SpatialReferenceSystem, or nullptr on failure. Caller takes ownership unless a parent is given.
◆ createFromWktOrProj()
| SpatialReferenceSystem * CRSManager::createFromWktOrProj |
( |
const QString & |
wktOrProj, |
|
|
QObject * |
parent = nullptr |
|
) |
| const |
Creates a CRS from a WKT2 or PROJ string.
- Parameters
-
| wktOrProj | WKT2 or PROJ string. |
| parent | Qt parent for the new object. |
- Returns
- Heap-allocated SpatialReferenceSystem, or nullptr on failure.
◆ instance()
Returns the application-wide singleton instance.
◆ loadSettings()
| void CRSManager::loadSettings |
( |
| ) |
|
Loads recent CRS list from persistent settings.
◆ queryDatabase()
| QList< CRSInfo > CRSManager::queryDatabase |
( |
const QString & |
keyword = {}, |
|
|
const QString & |
authority = {}, |
|
|
bool |
includeDeprecated = false |
|
) |
| const |
Returns a flat list of all (or matching) CRS records from the GDAL database.
- Parameters
-
| keyword | Free-text filter (matches name / code string). Empty = no filter. |
| authority | Authority filter, e.g. "EPSG". Empty = all authorities. |
| includeDeprecated | Whether to include deprecated CRSes (default: false). |
- Returns
- List of matching CRSInfo records, sorted by authority then code.
◆ recentCRSes()
| QList< QPair< QString, int > > CRSManager::recentCRSes |
( |
| ) |
const |
Returns authority:code pairs the user has recently used.
◆ recentCRSesChanged
| void CRSManager::recentCRSesChanged |
( |
| ) |
|
|
signal |
Emitted when the recent-CRS list changes.
◆ saveSettings()
| void CRSManager::saveSettings |
( |
| ) |
const |
Saves recent CRS list to persistent settings.
◆ totalCRSCount()
| int CRSManager::totalCRSCount |
( |
| ) |
const |
Returns the total number of non-deprecated CRSes in the GDAL database.
◆ webMercator()
Returns the Web Mercator projected CRS (EPSG:3857).
◆ wgs84()
Returns the WGS 84 geographic CRS (EPSG:4326).
The returned pointer is owned by CRSManager and stays valid for the lifetime of the application.
◆ authorities
| QStringList CRSManager::authorities |
|
read |
◆ totalCRSCount
| int CRSManager::totalCRSCount |
|
read |
The documentation for this class was generated from the following files:
- /home/runner/work/openswmm.gui/openswmm.gui/include/map/crsmanager.h
- /home/runner/work/openswmm.gui/openswmm.gui/src/map/crsmanager.cpp