vyperdatum package

Subpackages

Submodules

vyperdatum.db module

class vyperdatum.db.DB(db_dir: str | None = '/home/docs/checkouts/readthedocs.org/user_builds/vyperdatum/conda/stable/lib/python3.12/site-packages/pyproj/proj_dir/share/proj')[source]

Bases: object

crs_by_keyword(keywords: list[str], dataframe: bool = False) list | None | DataFrame[source]

Return a list (or dataframe) of CRS that their name or description contain the passed keywords. The search is not case-sensitive.

Parameters

sql: str

SQL query (intended to be a scan query) to be executed.

keywords: list[str]

A list of string keywords used to query the database.

dataframe: bool, default=False

If True, converts the result into a pandas dataframe.

Raises

TypeError:

If keywords is not a list of strings.

ValueError:

If no keywords is passed.

Returns

list or pd.DataFrame

property db_file_path: str
query(sql: str, dataframe: bool = False) list | None | DataFrame[source]

Execute a sql query and return the response. This method is intended to run a read (scan) query. Avoid using this method for DML/DDL type operations.

Parameters

sql: str

SQL query (intended to be a scan query) to be executed.

dataframe: bool, default=False

If True, converts the result into a pandas dataframe.

Returns

list or pd.DataFrame

update_db_path() bool[source]

Prepend self.db_dir to pyproj.datadir which guides the pyproj to first look for the database at self.db_dir address.

Raises

ValueError:

If .db_dir is not set.

FileNotFoundError:

If the database file is not found.

Returns

bool:

True if the data_dir is set successfully, otherwise False.

vyperdatum.enums module

class vyperdatum.enums.PROJDB(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: RootEnum

Proj db attributes.

Attributes

FILE_NAME

FILE_NAME = 'proj.db'
TABLE_CONCAT_OPS = 'concatenated_operation'
TABLE_GRID_TRANS = 'grid_transformation'
TABLE_OTHER_TRANS = 'other_transformation'
TABLE_VERTICAL_CRS = 'vertical_crs'
VIEW_CRS = 'crs_view'
class vyperdatum.enums.RootEnum(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

class vyperdatum.enums.VDATUM(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: RootEnum

DIR = 'C:\\Users\\mohammad.ashkezari\\Desktop\\vdatum_all_20230907\\vdatum'
H_FRAMES = ['NAD27', 'NAD83_1986', 'NAD83_2011', 'NAD83_NSRS2007', 'NAD83_MARP00', 'NAD83_PACP00', 'WGS84_G1674', 'ITRF2014', 'IGS14', 'ITRF2008', 'IGS08', 'ITRF2005', 'IGS2005', 'WGS84_G1150', 'ITRF2000', 'IGS00', 'IGb00', 'ITRF96', 'WGS84_G873', 'ITRF94', 'ITRF93', 'ITRF92', 'SIOMIT92', 'WGS84_G730', 'ITRF91', 'ITRF90', 'ITRF89', 'ITRF88', 'WGS84_TRANSIT', 'WGS84_G1762', 'WGS84_G2139']
V_FRAMES = ['NAVD88', 'NGVD29', 'ASVD02', 'W0_USGG2012', 'GUVD04', 'NMVD03', 'PRVD02', 'VIVD09', 'CRD', 'EGM2008', 'EGM1996', 'EGM1984', 'XGEOID16B', 'XGEOID17B', 'XGEOID18B', 'XGEOID19B', 'XGEOID20B', 'IGLD85', 'LWD_IGLD85', 'OHWM_IGLD85', 'CRD', 'LMSL', 'MLLW', 'MLW', 'MTL', 'DTL', 'MHW', 'MHHW', 'LWD', 'NAD27', 'NAD83_1986', 'NAD83_2011', 'NAD83_NSRS2007', 'NAD83_MARP00', 'NAD83_PACP00', 'WGS84_G1674', 'ITRF2014', 'IGS14', 'ITRF2008', 'IGS08', 'ITRF2005', 'IGS2005', 'WGS84_G1150', 'ITRF2000', 'IGS00', 'IGb00', 'ITRF96', 'WGS84_G873', 'ITRF94', 'ITRF93', 'ITRF92', 'SIOMIT92', 'WGS84_G730', 'ITRF91', 'ITRF90', 'ITRF89', 'ITRF88', 'WGS84_TRANSIT', 'WGS84_G1762', 'WGS84_G2139']

vyperdatum.transformer module

class vyperdatum.transformer.Transformer(crs_from: CRS | int | str, crs_to: CRS | int | str, always_xy: bool = False, area_of_interest: AreaOfInterest | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = False, force_over: bool = False, only_best: bool | None = True)[source]

Bases: object

static gdal_extensions() list[str][source]

Return a lower-cased list of driver names supported by gdal.

Returns

list[str]

transform_points(x: float | int | list | ndarray, y: float | int | list | ndarray, z: float | int | list | ndarray)[source]

Conduct point transformation between two coordinate reference systems.

Parameters

x: numeric scalar or array

Input x coordinate(s).

y: numeric scalar or array

Input y coordinate(s).

z: numeric scalar or array, optional

Input z coordinate(s).

transform_raster(input_file: str, output_file: str, apply_vertical: bool, overview: bool = False, warp_kwargs: dict | None = None, final_step: bool = False) bool[source]

Transform the gdal-supported input rater file (input_file) and store the transformed file on the local disk (output_file).

Raises

ValueError:

If .crs_input or .crs_output is not set.

FileNotFoundError:

If the input raster file is not found.

NotImplementedError:

If the input vector file is not supported by gdal.

Parameters

input_file: str

Path to the input raster file (gdal supported).

output_file: str

Path to the transformed raster file.

apply_vertical: bool

Apply GDAL vertical shift.

output_file: str

Path to the transformed raster file.

overview: bool, default=True

If True, overview bands are added to the output raster file (only GTiff support).

final_step: bool

True for the final step of a multi-step transformations, otherwise False.

Returns

bool:

True if successful, otherwise False.

transform_vector(input_file: str, output_file: str) bool[source]

Transform the gdal-supported input vector file (input_file) and store the transformed file on the local disk (output_file).

Raises

ValueError:

If .crs_input or .crs_output is not set.

FileNotFoundError:

If the input vector file is not found.

NotImplementedError:

If the input vector file is not supported by gdal.

Parameters

input_file: str

Path to the input vector file (gdal supported).

output_file: str

Path to the transformed vector file.

Returns

bool:

True if successful, otherwise False.

Module contents