You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I retrieve the Slope Degrees map for a specified bounding box, it returns all 90 (or 255/nan) values. This seems to be fixed if I specify a crs of 5070.
What did you expect to happen?
I expected to get the correct slope values, regardless of crs.
Minimal Complete Verifiable Example
importmatplotlib.pyplotaspltimportpy3depxmin=-92.66#Longitude of southwest corner of the boxymin=36.07#Latitude of southwest corner of the boxxmax=-92.53#Longitude of northeast corner of the boxymax=36.21#Latitude of northeast corner of the boxbbox= (xmin,ymin,xmax,ymax)
rush_creek_area_slope=py3dep.get_map("Slope Degrees", bbox, resolution=10)
rush_creek_area_slope.plot(cmap='magma')
plt.axis('equal')
plt.title('Slope')
plt.show()
plt.hist(rush_creek_area_slope.data.ravel())
MVCE confirmation
Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue.
Complete example — the example is self-contained, including all data and the text of any traceback.
New issue — a search of GitHub Issues suggests this is not a duplicate.
Relevant log output
No response
Anything else we need to know?
Note that this behavior is new compared to one year ago, when my code worked (this code is used in a class lab exercise).
I pasted outputs of the plots created by code above here, as I wasn't sure they would work in the log output cell.
Environment
SYS INFO
--------
commit: None
python: 3.12.7 | packaged by conda-forge | (main, Oct 4 2024, 16:05:46) [GCC 13.3.0]
python-bits: 64
OS: Linux
OS-release: 5.15.0-122-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
Thanks for reporting the issue! I can confirm that this is a server side issue. I will reach out to the USGS's 3DEP team and let them know. In the meanwhile, I recommend using xarray-spatial or pywbt for computing slope.
importmatplotlib.pyplotaspltimportpy3depimportxrspatialasxrsxmin=-92.66#Longitude of southwest corner of the boxymin=36.07#Latitude of southwest corner of the boxxmax=-92.53#Longitude of northeast corner of the boxymax=36.21#Latitude of northeast corner of the boxbbox= (xmin,ymin,xmax,ymax)
s=xrs.slope(py3dep.get_dem(bbox, 10).rio.reproject(5070))
s.plot(cmap='magma')
plt.axis('equal')
plt.title('Slope')
What happened?
When I retrieve the Slope Degrees map for a specified bounding box, it returns all 90 (or 255/nan) values. This seems to be fixed if I specify a crs of 5070.
What did you expect to happen?
I expected to get the correct slope values, regardless of crs.
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
No response
Anything else we need to know?
Note that this behavior is new compared to one year ago, when my code worked (this code is used in a class lab exercise).
I pasted outputs of the plots created by code above here, as I wasn't sure they would work in the log output cell.
Environment
PACKAGE VERSION
async-retriever 0.18.0
pygeoogc 0.18.0
pygeoutils 0.18.0
py3dep 0.18.0
pynhd 0.18.0
pygridmet 0.18.0
pydaymet 0.18.0
hydrosignatures 0.18.0
pynldas2 0.18.0
pygeohydro 0.18.0
aiohttp 3.10.10
aiohttp-client-cache 0.12.4
aiosqlite 0.20.0
cytoolz 1.0.0
ujson 5.10.0
defusedxml 0.7.1
joblib 1.4.2
multidict 6.1.0
owslib 0.32.0
pyproj 3.7.0
requests 2.32.3
requests-cache 1.2.1
shapely 2.0.6
url-normalize 1.4.3
urllib3 2.2.3
yarl 1.17.1
geopandas 1.0.1
netcdf4 1.7.1
numpy 2.0.2
rasterio 1.4.2
rioxarray 0.17.0
scipy 1.14.1
xarray 2024.10.0
click 8.1.7
pyflwdir N/A
networkx 3.4.2
pyarrow 18.0.0
folium 0.18.0
h5netcdf 1.4.1
matplotlib 3.9.2
pandas 2.2.2
numba 0.60.0
bottleneck N/A
py7zr 0.22.0
pyogrio 0.10.0
The text was updated successfully, but these errors were encountered: