vyperdatum.utils.crs_utils
Attributes
Functions
|
Return CRS horizontal and vertical components string representation |
|
Return CRS string representation in form of code:authority |
|
Return True if transformation from crs_from to crs_to results |
|
Return the input CRS reference epoch, if the input CRS is Dynamic. |
|
Add epoch info to the GDAL warp options if either source or target CRSs are dynamic. |
|
Check if all transformation steps can be successfully instantiated by PROJ. |
|
Spawn a new process to run a commandline utility and capture its output. |
|
Check if all transformation steps can be successfully instantiated by PROJ. |
|
Check if there are more than one geodetic crs in the pipeline. |
|
Check if there are more than one projection types in the pipeline. |
|
Extract PROJ pipeline string from the output of projinfo utility. |
|
|
|
Finds the flipped VCRS by explicitly swapping 'height' and 'depth' |
|
|
|
Detects if the horizontal component of a CRS (including compound) |
Module Contents
- vyperdatum.utils.crs_utils.logger
- vyperdatum.utils.crs_utils.crs_components(crs: pyproj.CRS, raise_no_auth: bool = True) Tuple[str, str | None]
Return CRS horizontal and vertical components string representation in form of code:authority. If the input CRS is horizontal, the vertical component will be None.
- vyperdatum.utils.crs_utils.auth_code(crs: pyproj.CRS, raise_no_auth: bool = True) str | None
Return CRS string representation in form of code:authority
- Raises:
ValueError: – If either code or authority of the crs (or its sub_crs) can not be determined.
- Returns:
crs string in form of code:authority
- Return type:
- vyperdatum.utils.crs_utils.vertical_shift(crs_from: pyproj.CRS, crs_to: pyproj.CRS) bool
Return True if transformation from crs_from to crs_to results in vertical shifts.
- Parameters:
crs_from (pyproj.crs.CRS) – Projection of input data.
crs_to (pyproj.crs.CRS) – Projection of output data.
- Raises:
TypeError: – If either one of crs_from or crs_to is not of type pyproj.CRS.
- Return type:
- vyperdatum.utils.crs_utils.crs_epoch(crs: pyproj.CRS) str | None
Return the input CRS reference epoch, if the input CRS is Dynamic. otherwise return None.
- Parameters:
crs (pyproj.crs.CRS) – pyproj CRS instance.
- Raises:
TypeError: – If crs is not of type pyproj.CRS.
- vyperdatum.utils.crs_utils.add_epoch_option(s_crs: pyproj.CRS, t_crs: pyproj.CRS, warp_kwargs: dict)
Add epoch info to the GDAL warp options if either source or target CRSs are dynamic.
- Parameters:
s_crs (pyproj.crs.CRS) – Source CRS object used in gdal Warp.
t_crs (pyproj.crs.CRS) – Target CRS object used in gdal Warp.
warp_kwargs (dict) – Optional GDAL warp options.
- Raises:
TypeError: – If either one of crs_from or crs_to is not of type pyproj.CRS.
- Returns:
GDAL warp options.
- Return type:
- vyperdatum.utils.crs_utils.validate_transform_steps(steps: list[str] | None) bool
Check if all transformation steps can be successfully instantiated by PROJ.
- Parameters:
steps (Optional[list[str]]) – List of strings in form of authority:code representing the CRSs involved in a transformation pipeline.
- Raises:
NotImplementedError: – When no transformer is identified.
- Returns:
False if either one of the transformation steps fail, otherwise return True.
- Return type:
- vyperdatum.utils.crs_utils.commandline(command: str, args: list[str] | None = None) tuple[dict | None, str | None]
Spawn a new process to run a commandline utility and capture its output.
- vyperdatum.utils.crs_utils.validate_transform_steps_dict(steps: list[dict] | None) bool
Check if all transformation steps can be successfully instantiated by PROJ.
- Parameters:
steps (Optional[list[dict]]) – List of dict objects containing crs_from/to in form of authority:code representing the CRSs involved in a transformation pipeline.
- Raises:
NotImplementedError: – When no transformer is identified.
- Returns:
False if either one of the transformation steps fail, otherwise return True.
- Return type:
- vyperdatum.utils.crs_utils.multiple_geodetic_crs(steps: list[dict] | None) bool
Check if there are more than one geodetic crs in the pipeline.
- vyperdatum.utils.crs_utils.multiple_projections(steps: list[dict] | None) bool
Check if there are more than one projection types in the pipeline.
- vyperdatum.utils.crs_utils.pipeline_string(crs_from: str, crs_to, input_metadata=None) str | None
Extract PROJ pipeline string from the output of projinfo utility.
- vyperdatum.utils.crs_utils.flip_vertical_vaxis(auth_code) str
Finds the flipped VCRS by explicitly swapping ‘height’ and ‘depth’ in the CRS name and searching the database for that exact name.
- vyperdatum.utils.crs_utils.get_meter_vcrs(auth_code)