CurviRiver: Curvilinear Mesh Generator for Rivers
Features
CurviRiver takes as input a Polygon of a river segment and generates a 2D or 3D curvilinear mesh that can be used for hydrodynamic or hydrological modeling. The mesh is generated in three main steps:
Determining the centerline of the input Polygon using Voroni diagram Dijkstra’s algorithm,
Smoothing the generated centerline with a B-spline curve,
Computing the tangent angles of the centerline at each point along the centerline and generating cross-sections perpendicular to the centerline at given intervals,
Generating a 2D mesh from vertices of the cross-sections,
Generating a 3D mesh if depth data is provided, by determining the depth of 2D mesh vertices from the depth data using Inverse Distance Weighting (IDW).
Installation
You can install CurviRiver using pip:
$ pip install curviriver
or using conda (mamba):
$ conda install -c conda-forge curviriver
Quick start
We demonstrate capabilities of CurviRiver by generating a curvilinear mesh along a portion of the Columbia River and interpolating eHydro topobathy data on to the generated mesh vertices. Please visit the example gallery for more examples.
First, we use PyGeoHydro to retrieve eHydro data for a part of the Columbia River that topobathy data are available. We get both the survey outline and the bathymetry data. Then, we use the survey outline polygon to generate a curvilinear mesh. We use the poly_segmentize function for this purpose that has two parameters: Spacing in streamwise direction and number of points in cross-stream direction. The function returns a geopandas.GeoSeries of the cross-sections, vertices of which are the mesh points.
from pygeohydro import EHydro
import curviriver as cr
ehydro = EHydro("outlines")
geom = ehydro.survey_grid.loc[ehydro.survey_grid["OBJECTID"] == 210, "geometry"].iloc[0]
outline = ehydro.bygeom(geom, ehydro.survey_grid.crs)
poly = outline.convex_hull.unary_union
spacing_streamwise = 2000
xs_npts = 5
stream = cr.poly_segmentize(poly, outline.crs, spacing_streamwise, xs_npts)
Contributing
Contributions are very welcomed. Please read CONTRIBUTING.rst file for instructions.
Support
The work for this project is funded by USGS through Water Resources Research Institutes (WRRI).
Metadata
Release files for curviriver 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| curviriver-0.1.0.tar.gz | 999.8 kB | Without provenance | Details for curviriver-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| curviriver-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for curviriver-0.1.0-py3-none-any.whl |
Total release size: 1.0 MB
Release files / curviriver-0.1.0.tar.gz
| Download URL | curviriver-0.1.0.tar.gz |
|---|---|
| Size | 999.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8693a816d65b18c79efc843bbaafaf4bcf7c50e1e2b713e813fe27ffa075cc4e
|
|
BLAKE2b-256 checksum How to use checksums |
afc7e42da867511d1e5d3b15c05681a98bdc0f96cf0d871a3c09b04427cc0bd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / curviriver-0.1.0-py3-none-any.whl
| Download URL | curviriver-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1eea53239fe305722e634eb67267fc80475c17fb0b5949ad7f8669d2ed32c56
|
|
BLAKE2b-256 checksum How to use checksums |
a4c4b43b58c98eb0a2aa07e5adbca1d3a283bfc6c736d447ca1d673189722e97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for curviriver 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.