Package pygeodesy :: Module epsg |
[frames] | no frames]

# Module epsg

Classes Epsg and EPSGError and functions to encode and decode2 EPSG (European Petroleum Survey Group) codes from and to UTM and UPS zones.

A pure Python implementation transcribed from C++ class UTMUPS by Charles Karney, including coverage of UPS as zone `0`.

Version: 19.04.26

Classes
| EPSGError EPSG encode or decode error.
| Epsg EPSG class, sub-class of `int`.

Functions
decode2(epsg) Determine the UTM/USP zone and hemisphere from a given EPSG. |
encode(zone, hemipole=`'````'`, band=`'````'`) Determine the EPSG code for a given UTM/UPS zone number, hemisphere/pole and/or Band. |

Function Details

### decode2(epsg) |
Determine the UTM/USP zone and hemisphere from a given EPSG. Parameters: `epsg` - The EPSG (Epsg, `str` or `scalar`). Returns: 2-Tuple (`zone, 'N'|'S'`) as (`int`, `str`) where `zone` is `1..60` for UTM or `0` for UPS. Raises: `EPSGError` - Invalid epsg. Note: Coverage of UPS follows Karney's function UTMUPS::DecodeEPSG.

### encode(zone, hemipole=`'````'`, band=`'````'`) |
Determine the EPSG code for a given UTM/UPS zone number, hemisphere/pole and/or Band. Parameters: `zone` - The (longitudinal) UTM zone (`int`, 1..60) or UPS zone (`int`, 0) or UTM zone with/-out (latitudinal) Band letter (`str`, '01C'..'60X') or UPS zone with/-out (polar) Band letter (`str`, '00A', '00B', '00Y' or '00Z'). `hemipole` - UTM/UPS hemisphere or UPS projection top/center pole (`str`, `'N[orth]'` or `'S[outh]'`). `band` - Optional (latitudinal) UTM or (polar) UPS Band letter (`str`). Returns: `EPSG` code (Epsg). Raises: `EPSGError` - Invalid zone, hemipole or band. Note: Coverage of UPS follows Karney's function UTMUPS::EncodeEPSG.