polartoolkit.default_epsg

Contents

polartoolkit.default_epsg#

default_epsg(epsg, hemisphere)[source]#

Returns the provided EPSG code through 1 of 4 methods in the following preference. 1) the parameter epsg which is an EPSG code as a string (โ€œ3031โ€) 2) the parameter hemisphere which is either the strings โ€œnorthโ€ or โ€œsouthโ€ (which correspond to EPSG codes 3413 and 3031 respectively), 3) the user-set environment variable POLARTOOLKIT_EPSG which should be a EPSG code as a string (โ€œ3031โ€) or 4) the user-set environment variable POLARTOOLKIT_HEMISPHERE which should be set to โ€œnorthโ€ or โ€œsouthโ€ (which correspond to EPSG codes 3413 and 3031 respectively). If none of these are provided, an error is raised informing the user how to set the values.

Parameters:
  • epsg (str | None) โ€“ an EPSG code as a string (โ€œ3031โ€), by default None.

  • hemisphere (str | None) โ€“ hemisphere to use, either โ€œnorthโ€ or โ€œsouthโ€, corresponding to EPSG codes 3413 and 3031 respectively, by default None.

Returns:

EPSG code to use

Return type:

str