History#
0.19.5 (2025-03-07)#
Internal Changes#
Use
jsoninstead ofujsondue to the package not being maintained anymore.Use
numbers.Numberinstead ofnp.numberfor type checking as it’s indicated in thenumpydocumentation.
0.19.0 (2025-01-17)#
New Features#
Add a function called
sample_windowto remsample a raster dataset using a window size and arasteriosupported resampling method. This is an efficient way of sampling large raster datasets without reading the entire dataset into memory. The function returns a generator that yields the sampled values in the order of the input coordinates. This function is based on therasterio.sample.sample_genfunction.Add a function called
geo_transformfor transforming any Shapely geometry to a new CRS. It could be a single geometry or an array of geometries.
0.18.0 (2024-10-05)#
New Features#
Add a function called
achored_amoothin``to smooth a ``LineStringusing Cubnic splines that anchores the first and last points of theLineString.Add a function called
smooth_multilinestringto smooth aMultiLineStringusing the newanchored_smoothinfunction.In
line_curvatureusespline_curvatureto calculate the curvature of aLineStringat all points along theLineString. This is more accurate than the previous method and users can now specify the smoothing factor (s) and degree of the spline (k) to control the smoothness of the spline that is used to calculate the curvature.
Breaking Changes#
Drop support for Python 3.8 since its end-of-life date is October 2024.
Remove all exceptions from the main module and raise them from the
exceptionsmodule. This is to declutter the public API and make it easier to maintain.
Internal Changes#
Move all spline and smoothing functions to a new module called
smoothing.
0.17.1 (2024-09-14)#
Internal Changes#
Drop support for Python 3.8 since its end-of-life date is October 2024.
0.16.3 (2024-05-16)#
Internal Changes#
Add the
exceptionsmodule to the high-level API to declutter the main module. In the future, all exceptions will be raised from this module and not from the main module. For now, the exceptions are raised from both modules for backward compatibility.Switch to using the
srclayout instead of theflatlayout for the package structure. This is to make the package more maintainable and to avoid any potential conflicts with other packages.Improve robustness of
json2geodfby ensuring that all geojsons are in the same CRS.
0.16.1 (2024-01-15)#
Bug Fixes#
pyprojuses its own env variables for SSL certification. This release fixes the issue withpyprojnot being able to download the grid database when using DOI SSL certification file. This release usespyproj.network.set_ca_bundle_pathfor setting the SSL certification file given by the user viaHYRIVER_SSL_CERTenv variable.Ignore
FutureWarningof pandas 2.1.0 for all-NaN columns injson2geodf.
Internal Changes#
For
Attrsclass, usedataclassinstead for better performance and consistency.
0.16.0 (2024-01-03)#
Breaking Changes#
Refactor the spline generation functions to make them more efficient, more accurate, and more robust. Switched to using
UnivariateSplinefromscipyinstead ofBSpline. This allows for more control over smoothness of the spline via thesmoothparameter. References to BSpline has been removed from the functions and a new functionality has been added. The new spline generation functions areGeoSpline,make_spline,spline_linestring,smooth_linestring,spline_curvature, andline_curvature. Thesmooth_linestringfunction now returns aLineStringinstead of aSplineobject. This function is intended for smoothing aLineStringwhen curvature, radius of curvature, and tangent angles are not needed. Thespline_linestringfunction now returns aSplineobject that contains the smoothedLineStringand curvature, radius of curvature, and tangent angles. Also,line_curvaturefunction can be used to compute curvature, radius of curvature, and tangent angles of aLineStringat all point along theLineString.
New Features#
Add a new function called
gtiff2vrtfor creating a VRT file from a list of GeoTiff files. Note that this new function requiresgdalto be installed.The
xd_write_crsfunction now keepsspatial_refattribute of the inputxarray.DataArrayorxarray.Datasetto retain CF compliance.
0.15.2 (2023-09-22)#
New Features#
Add
geometry_reprojectfunction for reprojecting a geometry (bounding box, list of coordinates, or anyshapely.geometry) to a new CRS.Add
smooth_linestringfunction for smoothing aLineStringusing B-splines.Make
make_bsplineandbspline_curvaturefunctions public. Themake_bsplinefunction usesscipyto generate aBSplinesobject and thebspline_curvaturefunction calculates the tangent angles, curvature, and radius of curvature of a B-spline at any point along the B-spline.Improve the accuracy and performance of B-spline generation functions.
Internal Changes#
Remove dependency on
dask.
0.15.0 (2023-05-07)#
From release 0.15 onward, all minor versions of HyRiver packages
will be pinned. This ensures that previous minor versions of HyRiver
packages cannot be installed with later minor releases. For example,
if you have py3dep==0.14.x installed, you cannot install
pydaymet==0.15.x. This is to ensure that the API is
consistent across all minor versions.
New Features#
For now, retain compatibility with
shapely<2while supportingshapley>=2.
0.14.0 (2023-03-05)#
New Features#
Ignore index when concatenating multiple responses in
json2geodfto ensure indices are uniqueAdd a new function, called
coords_list, for converting/validating input coordinates of any type to alistoftuple, i.e.,[(x1, y1), (x2, y2), ...].Make
xd_write_crsfunction public.In
xarray_geomaskif the input geometry is very small return at least one pixel.Add a new function, called
multi2poly, for converting aMultiPolygonto aPolygonin aGeoDataFrame. This function tries to convertMultiPolygontoPolygonby first checking ifMultiPolygoncan be directly converted using their exterior boundaries. If not, will try to remove those small sub-Polygonthat their area is less than 1% of the total area of theMultiPolygon. If this fails, the originalMultiPolygonwill be returned.
Breaking Changes#
Bump the minimum required version of
shapelyto 2.0, and use its new API.
Internal Changes#
Sync all minor versions of HyRiver packages to 0.14.0.
0.13.12 (2023-02-10)#
Breaking Changes#
The input
GeoDataFrametobreak_linesnow should be in a projected CRS.
New Features#
Significant improvements in the accuracy and performance of
nested_``Polygon``by changing the logic. Now, the function first determines the nestedPolygonby comparing the centroids of the geometries with their geometry and then picks the largest geometry from each group of nested geometries.Add a new function called
query_indicieswhich is a wrapper aroundgeopandas.sindex.query_bulk. However, instead of returning an array of positional indices, it returns a dictionary of indices where keys are the indices of the input geometry and values are a list of indices of the tree geometries that intersect with the input geometry.
Internal Changes#
Simplify
geo2polygonby making the two CRS arguments optional and only reproject if CRS values are given and different.Apply the geometry mask in
gtiff2xarrayeven if the input geometry is a bounding box since the mask might not be the same geometry as the one that was used during data query.Fully migrate
setup.cfgandsetup.pytopyproject.toml.Convert relative imports to absolute with
absolufy-imports.Sync all patch versions of HyRiver packages to x.x.12.
0.13.11 (2023-01-08)#
Bug Fixes#
Fix an in issue
xarray_geomaskwhere for geometries that are smaller than a single pixel, the bbox clipping operation fails. This is fixed by using theauto_expandoption ofrioxarray.clip_box.
0.13.10 (2022-12-09)#
New Features#
Add a new function called
nested_``Polygon``for determining nested (multi)``Polygon`` in agepandas.GeoDataFrameorgeopandas.GeoSeries.Add a new function called
geodf2xarrayfor rasterizing ageopandas.GeoDataFrameto axarray.DataArray.
Internal Changes#
Modify the codebase based on Refurb suggestions.
In
xarray_geomask, ifdrop=Truerecalculate its transform to ensure the correct geo references are set if the shape of the dataset changes.
0.13.8 (2022-11-04)#
Internal Changes#
Improve the performance of
xarray_geomasksignificantly by first clipping the data to the geometry’s bounding box, then if the geometry is a polygon, masking the data with the polygon. This is much faster than directly masking the data with the polygon. Also, support passing a bounding box toxarray_geomaskin addition to polygon andMultiPolygon.Fix deprecation warning of
pandaswhen changing the geometry column of aGeoDataFramein thenbreak_linesfunction.
0.13.7 (2022-11-04)#
Internal Changes#
When combining the responses, now
daskhandles data chunking more efficiently. This is especially important for handling large responses from WMS services.Improve type hints for CRS-related arguments of all functions by including string, integer, and
pyproj.CRStypes.In
gtiff2xarrayuserasterioengine to make sure allrioxarrayattrs are read.
0.13.6 (2022-08-30)#
Internal Changes#
Add the missing PyPi classifiers for the supported Python versions.
0.13.5 (2022-08-29)#
Breaking Changes#
Append “Error” to all exception classes for conforming to PEP-8 naming conventions.
0.13.2 (2022-06-14)#
Breaking Changes#
Set the minimum supported version of Python to 3.8 since many of the dependencies such as
xarray,pandas,rioxarrayhave dropped support for Python 3.7.Bump min versions of
rioxarrayto 0.10 since it adds reading/writing GCPs.
Internal Changes#
Use micromamba for running tests and use nox for linting in CI.
0.13.1 (2022-06-11)#
New Features#
Add support for passing a custom bounding box in the
Coordinatesclass. The default is the bounds ofEPSG:4326to retain backward compatibility. This new class parameter allows a user to check if a list of coordinates is within a custom bounding box. The bounds should be theEPSG:4326coordinate system.Add a new function called
geometry_listfor converting a list of multi-geometries to a list of geometries.
0.13.0 (2022-03-03)#
Internal Changes#
Write
nodataattribute usingrioxarrayingeotiff2xarraysince the clipping operation ofrioxarrayuses this value as fill value.
Bug Fixes#
In the
break_linesfunction, convertMultiLineStringintoLineStringsinceshapely.ops.substringonly acceptsLineString.
0.12.3 (2022-02-04)#
New Features#
Add a function called
break_linesfor breaking lines at given points.Add a function called
snap2nearestfor snapping points to the nearest point on a line with a given tolerance. It accepts ageopandas.GeoSeriesof points and ageopandas.GeoSeriesorgeopandas.GeoDataFrameof lines. It automatically snaps to the closest lines in the input data.
0.12.2 (2022-01-15)#
New Features#
Add a new class called
GeoBSplinethat generates B-splines from a set of coordinates. Thesplineattribute of this class has five attributes:xandycoordinates,phiandradiuswhich are curvature and radius of curvature, respectively, anddistancewhich is the total distance of each point along the B-spline from the starting points.Add a new class called
Coordinatesthat validates a set of lon/lat coordinates. It normalizes longitudes to the range [-180, 180) and has apointsproperty that isgeopandas.GeoSerieswith validated coordinates. It uses spatial indexing to speed up the validation and should be able to handle large datasets efficiently.Make
transform2tuplea public function.
Internal Changes#
The
geometryandgeo_crsarguments ofgtiff2xarrayare now optional. This is useful for cases when the inputGeoTiffresponse is the results of a bounding box query and there is no need for a geometry mask.Replace the missing values after adding geometry mask via
xarray_geomaskby thenodatavalsattribute of the inputxarray.DataArrayorxarray.Dataset. Therefore, the data type of the inputxarray.DataArrayorxarray.Datasetis conserved.Expose
connectivityargument ofrasterio.features.shapesfunction inxarray2geodffunction.Move all private functions to a new module to make the main module less cluttered.
0.12.1 (2021-12-31)#
Internal Changes#
Refactor
arcgis2geojsonfor better readability and maintainability.In
arcgis2geojsonset the geometry to null if its type is not supported, such as curved polylines.
0.12.0 (2021-12-27)#
Internal Changes#
Add all the missing types so
mypy --strictpasses.Bump version to 0.12.0 to match the release of
pygeoogc.
0.11.7 (2021-11-09)#
Internal Changes#
0.11.6 (2021-10-06)#
New Features#
Add a new function,
xarray2geodf, to convert axarray.DataArrayto ageopandas.GeoDataFrame.
0.11.5 (2021-06-16)#
Bug Fixes#
Fix an issue with
gtiff2xarraywhere thescalesandoffsetsattributes of the outputDataArraywere floats rather than tuples (GH 30).
Internal Changes#
Add a new function,
transform2tuple, for convertingAffinetransforms to a tuple. Previously, theAffinetransform was converted to a tuple usingto_gdal()method ofrasterio.Affinewhich was not compatible withrioxarray.
0.11.4 (2021-08-26)#
Internal Changes#
Use
ujsonfor JSON parsing instead oforjsonsinceorjsononly serializes tobyteswhich is not compatible withaiohttp.Convert the transform attribute data type from
Affinetotuplesince saving a data array tonetcdfcannot handle theAffinetype.
0.11.3 (2021-08-19)#
Fix an issue in
geotiff2xarrayrelated to saving axarrayobject to NetCDF when its transform attribute hasAffinetype rather than a tuple.
0.11.2 (2021-07-31)#
The highlight of this release is performance improvement in gtiff2xarray for
handling large responses.
New Features#
Automatic detection of the driver by default in
gtiff2xarrayas opposed to it beingGTiff.
Internal Changes#
Make
geo2polygon,get_transform, andget_nodata_crspublic functions since other packages use it.Make
xarray_maska public function and simplifygtiff2xarray.Remove
MatchCRSsince it’s already available inpygeoogc.Validate input geometry in
geo2polygon.Refactor
gtiff2xarrayto check for theds_dimsoutside the main loops to improve the performance. Also, the function tries to detect the dimension names automatically ifds_dimsis not provided by the user, explicitly.Improve performance of
json2geodfby using list comprehension and performing checks outside the main loop.
Bug Fixes#
Add the missing arguments for masking the data in
gtiff2xarray.
0.11.1 (2021-06-19)#
Bug Fixes#
In some edge cases the y-coordinates of a response might not be monotonically sorted so
daskfails. This release sorts them to address this issue.
0.11.0 (2021-06-19)#
New Features#
Function
gtiff2xarrayreturns a parallelizedxarray.Datasetorxarray.DataAraaythat can handle large responses much more efficiently. This is achieved usingdask.
Breaking Changes#
Drop support for Python 3.6 since many of the dependencies such as
xarrayandpandashave done so.Refactor
MatchCRS. Now, it should be instantiated by providing the in and out CRSs like so:MatchCRS(in_crs, out_crs). Then its methods, namely,geometry,boundsandcoords, can be called. These methods now have only one input, geometry.Change input and output types of
MatchCRS.coordsfrom tuple of lists of coordinates to list of(x, y)coordinates.Remove
xarray_maskandgtiff2filesincerioxarrayis more general and suitable.
Internal Changes#
Remove unnecessary type checks for private functions.
Refactor
json2geodfto improve robustness. Usegetmethod ofdictfor checking key availability.
0.10.1 (2021-03-27)#
Setting transform of the merged dataset explicitly (GH 3).
Add announcement regarding the new name for the software stack, HyRiver.
Improve
pipinstallation and release workflow.
0.10.0 (2021-03-06)#
The first release after renaming
hydrodatatoPyGeoHydro.Address GH 1 by sorting y coordinate after merge.
Make
mypychecks more strict and fix all the errors and prevent possible bugs.Speed up CI testing by using
mambaand caching.
0.9.0 (2021-02-14)#
Bump version to the same version as PyGeoHydro.
Add
gtiff2filefor saving raster responses asgeotifffile(s).Fix an error in
_get_nodata_crsfor handling no data value when its value in the source is None.Fix the warning during the
GeoDataFramegeneration injson2geodfwhen there is no geometry column in the input JSON.
0.2.0 (2020-12-06)#
Added checking the validity of input arguments in
gtiff2xarrayfunction and provide useful messages for debugging.Add support for
MultiPolygon.Remove the
fill_holeargument.Fixed a bug in
xarray_geomaskfor getting the transform.
0.1.10 (2020-08-18)#
Fixed the
gtiff2xarrayissue with high resolution requests and improved robustness of the function.Replaced
simplejsonwithorjsonto speed up JSON operations.
0.1.9 (2020-08-11)#
Modified
griff2xarrayto reflect the latest changes inpygeoogc0.1.7.
0.1.8 (2020-08-03)#
Retained the compatibility with
xarray0.15 by removing theattrsflag.Added
xarray_geomaskfunction and made it a public function.More efficient handling of large GeoTiff responses by cropping the response before converting it into a dataset.
Added a new function called
geo2polygonfor converting and transforming a polygon or bounding box into a Shapely’s Polygon in the target CRS.
0.1.6 (2020-07-23)#
Fixed the issue with flipped mask in
WMS.Removed
drop_duplicatessince it may cause issues in some instances.
0.1.4 (2020-07-22)#
Refactor
griff2xarrayand added support for WMS 1.3.0 and WFS 2.0.0.Add
MatchCRSclass.Remove dependency on PyGeoOGC.
Increase test coverage.
0.1.3 (2020-07-21)#
Remove duplicate rows before returning the dataframe in the
json2geodffunction.Add the missing dependency
0.1.0 (2020-07-21)#
First release on PyPI.