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
(auth_name=None, category=None, 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.
- Returns
- 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_authorities¶
Note
The backwards compatible import is pyproj.get_authorities
New in version 2.4.0.
- 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
(auth_name, pj_type, 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
(auth_name=None, pj_types=None, area_of_interest=None, contains=False, 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
(datum_name=None, area_of_interest=None, 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]