diff --git a/topo_descriptors/helpers.py b/topo_descriptors/helpers.py index 3bf78d2..4d09038 100755 --- a/topo_descriptors/helpers.py +++ b/topo_descriptors/helpers.py @@ -88,7 +88,7 @@ def scale_to_pixel(scales, dem_da): """ check_dem(dem_da) x_coords, y_coords = dem_da["x"].values, dem_da["y"].values - epsg_code = f"epsg:{int(dem_da.attrs['crs'].lower().split('epsg:')[1])}" + epsg_code = dem_da.attrs["crs"].lower() if epsg_code == "epsg:4326": logger.warning( f"Reprojecting coordinates from WGS84 to UTM to obtain units of meters" @@ -185,4 +185,6 @@ def check_dem(dem): if not "crs" in dem.attrs: raise KeyError("missing 'crs' (case sensitive) attribute in dem") if not "epsg:" in dem.attrs["crs"].lower(): - raise ValueError("missing 'epsg:' (case insensitive) key in the 'crs' attribute") + raise ValueError( + "missing 'epsg:' (case insensitive) key in the 'crs' attribute" + )