geomodels.data module

Tools for geographic models data download and installation.

class geomodels.data.EModelGroup[source]

Bases: enum.Enum

Model groups.

ALL = 'all'
MINIMAL = 'minimal'
RECOMMENDED = 'recommended'
class geomodels.data.EModelType[source]

Bases: enum.Enum

Enumerate geographic model types.

GEOID = 'geoids'
GRAVITY = 'gravity'
MAGNETIC = 'magnetic'
class geomodels.data.EGeoidModel[source]

Bases: enum.Enum

Enumerate geoid models.

EGM2008_1 = 'egm2008-1'
EGM2008_2_5 = 'egm2008-2_5'
EGM2008_5 = 'egm2008-5'
EGM84_15 = 'egm84-15'
EGM84_30 = 'egm84-30'
EGM96_15 = 'egm96-15'
EGM96_5 = 'egm96-5'
get_model_type = <function EGeoidModel.get_model_type>[source]
class geomodels.data.EGravityModel[source]

Bases: enum.Enum

Enumerate gravity models.

EGM2008 = 'egm2008'
EGM84 = 'egm84'
EGM96 = 'egm96'
WGS84 = 'wgs84'
get_model_type = <function EGravityModel.get_model_type>[source]
class geomodels.data.EMagneticModel[source]

Bases: enum.Enum

Enumerate magnetic field models.

EMM2010 = 'emm2010'
EMM2015 = 'emm2015'
EMM2017 = 'emm2017'
IGRF11 = 'igrf11'
IGRF12 = 'igrf12'
WMM2010 = 'wmm2010'
WMM2015 = 'wmm2015'
WMM2020 = 'wmm2020'
get_model_type = <function EMagneticModel.get_model_type>[source]
class geomodels.data.EArchiveType[source]

Bases: enum.Enum

Enumerate the archive type.

BZ2 = '.tar.bz2'
ZIP = '.zip'
geomodels.data.get_default_data_path() → str[source]

Return the default data path.

The GEOGRAPHICLIB_DATA environment variable is used if available to locate the location where the geographic model data are installed.

If GEOGRAPHICLIB_DATA is not set, then then it is returned the path configured at build time.

geomodels.data.get_model_url(model: Union[geomodels.data.EGeoidModel, geomodels.data.EGravityModel, geomodels.data.EMagneticModel], base_url: Optional[str] = None, archive_type: geomodels.data.EArchiveType = <EArchiveType.BZ2: '.tar.bz2'>) → str[source]

Return the download URL for the specified geographic model.

Parameters:
  • model – the enumeration corresponding to the desired geographic model. It can be one of the enumerates defined in EGeoidModel, EGravityModel or EMagneticModel.
  • base_url (str) – (optional) base URL for data download. The full URL is build from this function starting form base_url and model information.
  • archive_type (EArchiveType) – specifies the archive type that should be downloaded. Default: data:`EArchiveType.BZ2.
geomodels.data.install(model: Union[geomodels.data.EModelGroup, geomodels.data.EModelType, geomodels.data.EGeoidModel, geomodels.data.EGravityModel, geomodels.data.EMagneticModel] = <EModelGroup.MINIMAL: 'minimal'>, datadir: Union[str, os.PathLike, None] = None, base_url: str = None, archive_type: geomodels.data.EArchiveType = <EArchiveType.BZ2: '.tar.bz2'>, progress: bool = True)[source]

Install the specified geographic model data.

Parameters:
  • model – the enumeration corresponding to the desired geographic model. It can be one of the enumerates defined in EGeoidModel, EGravityModel, EMagneticModel, or one of the enumerates defined in EModelType to indicate that all geographic models of the specified type shall be installed, or one of the enumerates defined in EModelGroup to indicate that a specific group of model data shall be installed: EModelGroup.ALL (all available models of any kind), EModelGroup.MINIMAL (only the default model for each type) or EModelGroup.RECOMMENDED.
  • datadir (PathType) – (optional) specify the target location where geographic model data shall be installed. If not specified that the path returned by get_default_data_path() is assumed.
  • base_url (str) – (optional) base URL for data download. The full URL is built from this function starting form base_url and model information.
  • archive_type (EArchiveType) – specifies the archive type that should be downloaded. Default: EArchiveType.BZ2.
  • progress (bool) – enable/disable progress information display (default: True)