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, int, str) – 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:
CRS instance initialized 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.
Notes
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) – ESRI-style projection file with well-known text defining the CRS for the model grid (must be projected; geographic CRS are not supported).
crs (pyproj.CRS, int, str, 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.**kwargs (dict, optional) –
Support deprecated keyword options.
Deprecated since version 3.4: The following keyword options will be removed for FloPy 3.6:
prj
(str or pathlike): useprjfile
instead.epsg
(int): usecrs
instead.proj4
(str): usecrs
instead.wkt_string
(str): usecrs
instead.
- Return type:
pyproj.CRS instance