Releases: hyriver/py3dep
Releases · hyriver/py3dep
v0.13.1
Release Notes
New Features
- In
deg2mpm
function look for_FillValue
andnodatavals
in the attributes and if not found, fall back tonumpy.nan
.
Internal Changes
- Ensure that the
deg2mpm
function usesdask
if the input isdask
-enabled. - In the
elevation_profile
function use a bounding box to get DEM and a linear interpolation to get the elevation along the profile.
v0.13.0
Release Notes
New Features
- Add a new function called
query_3dep_sources
for querying bounds of 3DEP's data sources within a bounding box. It returns a geo-dataframe that contains the bounding box of each data source and a columndem_res
identifying the resolution of the raw topographic data within each geometry. - Add a new function called
elevation_profile
for getting elevation profile along a line at a given spacing. This function converts the line to a B-spline and then calculates the elevation along the spline at a given uniform spacing.
Breaking Changes
-
Remove caching-related arguments from all functions since now they can be set globally via three environmental variables:
HYRIVER_CACHE_NAME
: Path to the caching SQLite database.HYRIVER_CACHE_EXPIRE
: Expiration time for cached requests in seconds.HYRIVER_CACHE_DISABLE
: Disable reading/writing from/to the cache file.
You can do this like so:
import os
os.environ["HYRIVER_CACHE_NAME"] = "path/to/file.sqlite"
os.environ["HYRIVER_CACHE_EXPIRE"] = "3600"
os.environ["HYRIVER_CACHE_DISABLE"] = "true"
v0.12.2
Release Notes
New Features
- Add a new DEM source to
elevation_bycoords
to get elevation from the National Map's 3DEP WMS service. This can replace thetnm
source sincetnm
is not stable. - Add a new function called
check_3dep_availability
to check the availability of 3DEP's native resolutions within an area of interest. It returns adict
with keys corresponding to the available resolutions and its values are boolean values indicating whether the resolution is available or not. - Replace no data values of
slope
indeg2mm
withnp.nan
, so they do not get converted to another values. The output of this function hasnp.float64
type.
Internal Changes
- Refactor
ElevationByCoords
by using__post_init__
for validating the input parameters rather thanpydantic
's validators. - Refactor
elevation_bygrid
by usingget_map
to get DEM andrioxarray
for re-projection. - Add type checking with
typeguard
and fixed typing issues raised bytypeguard
. - Refactor
show_versions
to ensure getting correct versions of all dependencies.
v0.12.1
Release Notes
Internal Changes
- Use the three new
ar.retrieve_*
functions instead of the oldar.retrieve
function to improve type hinting and to make the API more consistent.
v0.12.0
Release Notes
Breaking Changes
- Set the request caching's expiration time to never expire. Add two flags to all functions to control the caching:
expire_after
anddisable_caching
.
Internal Changes
- Add all the missing types so
mypy --strict
passes. - Improve performance of
elevation_bygrid
by ignoring unnecessary validation.
v0.11.4
v0.11.3
Release Notes
Breaking Changes
- Rewrite the command-line interface using
click.group
to improve UX. The command is nowpy3dep [command] [args] [options]
. The two supported commands arecoords
for getting elevations of a dataframe of coordinates in EPSG:4326 CRS andgeometry
for getting the elevation of a geo-dataframe of geometries. Each sub-command now has a separate help message. The format of the input file for thecoords
command is nowcsv
and for thegeometry
command is.shp
or.gpkg
and must have acrs
attribute. Also, thegeometry
command now accepts multiple layers via the--layers
(-l
) option. More information and examples can be in theREADME.rst
file.
New Features
- Make
fill_depressions
function public. This function conditions an input DEM by applying depression filling and flat area resolution operations.
Internal Changes
- The
get_map
function now checks for validation of the inputlayers
argument before sending the actual request with a more helpful message. - Improve docstrings.
- Move
deg2mpm
,fill_depressions
, andreproject_gtiff
functions to a new file calledutils
. Bothdeg2mpm
andfill_depressions
functions are still accessible frompy3dep
directly. - Increase the test coverage.
v0.11.2
Release Notes
Bug Fixes
- Fix a bug related to
elevation_bycoords
where crs validation fails if its type ispyrpoj.CRS
by converting inputs with CRS types to string.
Internal Changes
- Fix a couple of typing issues and update the
get_transform
API based on the recent changes inpygeoutils
v0.11.5.
v0.11.1
Release Notes
The first highlight of this release is a major refactor of
elevation_bycoords
by adding support for the Bulk Point Query Service
and improving overall performance of the function. Another highlight is
support for performing depression filling in elevation_bygrid
prior to
sampling the underlying DEM.
New Features
- Refactor
elevation_bycoords
function to add support for getting elevations of a list of coordinates via The National Map's Point Query Service. This service is more accurate than Airmap but it's limited to the US only. You can select the source via a new argument calledsource
. You can set it tosource=tnm
to use the TNM service. The default istnm
. - Refactor
elevation_bygrid
function to add a new capability via
fill_depressions
argument for filling depressions in the obtained DEM before extracting elevation data for the input grid points.. This is achieved via RichDEM that needs to be installed if this functionality is desired. You can install it viapip
orconda
(mamba
).
Internal Changes
- Migrate to using
AsyncRetriever
for handling communications with web services. - Handle the interpolation step in
elevation_bygrid
function more
efficiently usingxarray
.
v0.11.0
Release Notes
New Features
- Added command-line interface (:issue_3dep:[10]{.title-ref}).
- All feature query functions use persistent caching that can
significantly improve the performance.
Breaking Changes
- Drop support for Python 3.6 since many of the dependencies such as
xarray
andpandas
have done so. - The returned
xarray
objects are in parallel mode, i.e., in some
casescompute
method should be used to get the results. - Save the output as a
netcdf
instead ofraster
since conversion
fromnc
totiff
can be easily done withrioxarray
.