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)
New in version 2.2.0.
New in version 3.0.0: query PROJ database.
Get the units available in the PROJ 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)
New 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 (Optional[str]) – PROJ short name, like “m”, “ft”, “us-ft”, etc… Might be None.
deprecated (bool) – Whether the object is deprecated.
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)
New in version 2.4.0.
- 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)
New in version 3.0.0.
Query for CRS information from the PROJ database.
- Parameters
auth_name (Optional[str], optional) – The name of the authority. Default is all authorities.
pj_types (Union[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 (Optional[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)
New 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 (Optional[AreaOfUse]) – The area of use for the CRS if valid.
projection_method_name (Optional[str]) – 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)
New in version 3.0.0.
Query for EPSG UTM CRS information from the PROJ database.
- Parameters
datum_name (Optional[str], optional) – The name of the datum in the CRS name (‘NAD27’, ‘NAD83’, ‘WGS 84’, …).
area_of_interest (Optional[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.
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
Optional[str]