Database

Methods that query the PROJ database for information.

pyproj.database.get_units_map

Note

The backwards compatible import is pyproj.get_units_map

pyproj.database.get_units_map(unicode auth_name=None, unicode category=None, bool allow_deprecated=False)

Added in version 2.2.0.

Added in version 3.0.0: query PROJ database.

Get the units available in the PROJ database.

See: proj_get_units_from_database()

Parameters:
  • auth_name (str, optional) – The authority name to filter by (e.g. EPSG, PROJ). Default is all.

  • category (str, optional) – Category of the unit: one of “linear”, “linear_per_time”, “angular”, “angular_per_time”, “scale”, “scale_per_time” or “time”. Default is all.

  • allow_deprecated (bool, default=False) – Whether or not to allow deprecated units.

Return type:

dict[str, Unit]

class pyproj.database.Unit(auth_name, code, name, category, conv_factor, proj_short_name, deprecated)

Added in version 3.0.0.

Parameters:
  • auth_name (str) – Authority name.

  • code (str) – Object code.

  • name (str) – Object name. For example “metre”, “US survey foot”, etc.

  • category (str) – Category of the unit: one of “linear”, “linear_per_time”, “angular”, “angular_per_time”, “scale”, “scale_per_time” or “time”.

  • conv_factor (float) – Conversion factor to apply to transform from that unit to the corresponding SI unit (metre for “linear”, radian for “angular”, etc.). It might be 0 in some cases to indicate no known conversion factor.

  • proj_short_name (str, optional) – PROJ short name, like “m”, “ft”, “us-ft”, etc… Might be None.

  • deprecated (bool) – Whether the object is deprecated.

pyproj.database.get_authorities

Note

The backwards compatible import is pyproj.get_authorities

pyproj.database.get_authorities()

Added in version 2.4.0.

See: proj_get_authorities_from_database()

Returns:

Authorities in PROJ database.

Return type:

list[str]

pyproj.database.get_codes

Note

The backwards compatible import is pyproj.get_codes

pyproj.database.get_codes(unicode auth_name, pj_type, bool allow_deprecated=False)

Added in version 2.4.0.

See: proj_get_codes_from_database()

Parameters:
  • auth_name (str) – The name of the authority.

  • pj_type (pyproj.enums.PJType) – The type of object to get the authorities.

  • allow_deprecated (bool, default=False) – Allow a deprecated code in the return.

Returns:

Codes associated with authorities in PROJ database.

Return type:

list[str]

pyproj.database.query_crs_info

pyproj.database.query_crs_info(unicode auth_name=None, pj_types=None, area_of_interest=None, bool contains=False, bool allow_deprecated=False)

Added in version 3.0.0.

Query for CRS information from the PROJ database.

See: proj_get_crs_info_list_from_database()

Parameters:
  • auth_name (str, optional) – The name of the authority. Default is all authorities.

  • pj_types (pyproj.enums.PJType | list[pyproj.enums.PJType | None, optional) – The type(s) of CRS to get the information (i.e. the types with CRS in the name). If None is provided, it will use all of types (i.e. PJType.CRS).

  • area_of_interest (AreaOfInterest, optional) – Filter returned CRS by the area of interest. Default method is intersection.

  • contains (bool, default=False) – Only works if the area of interest is passed in. If True, then only CRS whose area of use entirely contains the specified bounding box will be returned. If False, then only CRS whose area of use intersects the specified bounding box will be returned.

  • allow_deprecated (bool, default=False) – Allow a deprecated code in the return.

Returns:

CRS information from the PROJ database.

Return type:

list[CRSInfo]

class pyproj.database.CRSInfo(auth_name, code, name, type, deprecated, area_of_use, projection_method_name)

Added in version 3.0.0.

CRS Information

Parameters:
  • auth_name (str) – Authority name.

  • code (str) – Object code.

  • name (str) – Object name.

  • type (PJType) – The type of CRS

  • deprecated (bool) – Whether the object is deprecated.

  • area_of_use (AreaOfUse | None) – The area of use for the CRS if valid.

  • projection_method_name (str | None) – Name of the projection method for a projected CRS.

pyproj.database.query_utm_crs_info

pyproj.database.query_utm_crs_info(unicode datum_name=None, area_of_interest=None, bool contains=False)

Added in version 3.0.0.

Query for EPSG UTM CRS information from the PROJ database.

See: proj_get_crs_info_list_from_database()

Parameters:
  • datum_name (str, optional) – The name of the datum in the CRS name (‘NAD27’, ‘NAD83’, ‘WGS 84’, …).

  • area_of_interest (AreaOfInterest, optional) – Filter returned CRS by the area of interest. Default method is intersection.

  • contains (bool, default=False) – Only works if the area of interest is passed in. If True, then only CRS whose area of use entirely contains the specified bounding box will be returned. If False, then only CRS whose area of use intersects the specified bounding box will be returned.

Returns:

UTM CRS information from the PROJ database.

Return type:

list[CRSInfo]

pyproj.database.get_database_metadata

pyproj.database.get_database_metadata(unicode key)

Return metadata from the database.

See: proj_context_get_database_metadata()

Available keys:

  • DATABASE.LAYOUT.VERSION.MAJOR

  • DATABASE.LAYOUT.VERSION.MINOR

  • EPSG.VERSION

  • EPSG.DATE

  • ESRI.VERSION

  • ESRI.DATE

  • IGNF.SOURCE

  • IGNF.VERSION

  • IGNF.DATE

  • NKG.SOURCE

  • NKG.VERSION

  • NKG.DATE

  • PROJ.VERSION

  • PROJ_DATA.VERSION : PROJ-data version most compatible with this database.

Parameters:

key (str) – The name of the metadata item to get data for.

Returns:

The metatada information if available.

Return type:

str | None