pycsamt.gis.config#

pycsamt.gis.config

Configuration loader for the GIS subpackage.

  • Verifies availability of GDAL or a PROJ-based fallback (pyproj).

  • Loads EPSG definitions into EPSG_DICT for use by lightweight transformers.

On import, the module attempts to locate GDAL resources. If unavailable, it verifies that pyproj can be imported. EPSG definitions are then loaded from pyproj data where possible; otherwise a local epsg.npy mapping is used.

Exports#

HAS_GDALbool

True when GDAL/OSR is available.

EPSG_DICTdict[int, str]

Mapping of EPSG codes to PROJ strings.

GDALMissingErrorException

Raised when a GDAL-dependent routine is used without GDAL.

GisErrorException

Base exception for GIS utilities.

Notes

  • Modern pyproj (>=3) ships a SQLite proj.db rather than a flat epsg file. This loader uses a best-effort approach to find legacy definitions; if none are found, the local epsg.npy is used as a fallback.

Classes

ElevationAPIConfig()

Configuration for elevation API services.

Exceptions

GDALMissingError

Raised when a GDAL/OSR-dependent function is called while GDAL is not available.

GisError

Base exception for GIS utilities.

exception pycsamt.gis.config.GDALMissingError[source]#

Bases: RuntimeError

Raised when a GDAL/OSR-dependent function is called while GDAL is not available.

Notes

Install GDAL (and the osgeo Python bindings) to use GDAL-backed transforms. Prefer high-level helpers that can fall back to PROJ, such as project_point_ll2utm() and project_point_utm2ll(), when GDAL is absent.

exception pycsamt.gis.config.GisError[source]#

Bases: Exception

Base exception for GIS utilities.