geofileops.get_crs#

geofileops.get_crs(path: str | PathLike[Any], layer: str | None = None, min_confidence: int = 70) CRS | None#

Get the CRS (projection) of the file.

Parameters:
  • path (PathLike) – path to the file. GDAL vsi paths are supported.

  • layer (Optional[str]) – layer name. If not specified, and there is only one layer in the file, this layer is used. Otherwise exception.

  • min_confidence (int) – a value between 0-100 where 100 is the most confident. It is used to match the crs info found in the file to a crs defined by EPSG.

Returns:

The projection of the file.

Return type:

pyproj.CRS