flopy.utils.crs module
Utilities related to coordinate reference system handling.
- get_authority_crs(crs)[source]
Try to get the authority representation for a coordinate reference system (CRS), for more robust comparison with other CRS objects.
- Parameters:
crs (pyproj.CRS) – Coordinate reference system (CRS) for the model grid (must be projected; geographic CRS are not supported). The value can be anything accepted by
pyproj.CRS.from_user_input()
, such as an authority string (eg “EPSG:26916”) or a WKT string.- Returns:
authority_crs – CRS instance initiallized with the name and authority code (e.g. epsg: 5070) produced by
pyproj.crs.CRS.to_authority()
- Return type:
pyproj.CRS instance
Notes
pyproj.crs.CRS.to_authority()
will return None if a matching authority name and code can’t be found. In this case, the input crs instance will be returned.References
- get_crs(prjfile=None, crs=None, **kwargs)[source]
Helper function to produce a pyproj.CRS object from various input. Longer-term, this would just handle the
crs
andprjfile
arguments, but in the near term, we need to warn users about deprecating theprj
,epsg
,proj4
andwkt_string
inputs.- Parameters:
prjfile (str or pathlike, optional) – _description_, by default None
prj (str or pathlike, optional) –
Deprecated since version 3.4.
use
prjfile
instead.epsg (int, optional) –
Deprecated since version 3.4.
use
crs
instead.proj4 (str, optional) –
Deprecated since version 3.4.
use
crs
instead.crs (pyproj.CRS, optional if prjfile is specified) – Coordinate reference system (CRS) for the model grid (must be projected; geographic CRS are not supported). The value can be anything accepted by
pyproj.CRS.from_user_input()
, such as an authority string (eg “EPSG:26916”) or a WKT string.wkt_string (str, optional) –
Deprecated since version 3.4.
use
crs
instead.
- Returns:
crs
- Return type:
pyproj.CRS instance