Importer and Exporter for GWSW
A library for the GWSW-hydx exchange format
RioNED is going to release a new format for exchanging sewerage data called GWSW-hydx. hydxlib can be used to import sewerage data from a hydx format (*.csv) to 3Di native spatialite files, or alternatively JSON.
For more information about GWSW-hydx: https://apps.gwsw.nl/item_hyddef
For more information about the database scheme of 3Di: https://docs.3di.live/
Purporse of this script is to exchange information between different formats. This means that this library doesn’t improve lacking or incorrect data. For example, it doesn’t remove double manholes on the same location. This libary does provide all kinds of checks with warning and error messages.
This tool is currently in development. Therefore only nodes, weirs, orifices and pumpstations are currently supported.
hydxlib is installed with:
$ pip install hydxlib
It’s possible to run this tool on command line or with python.
$ run-hydxlib path/to/hydx/dir path/to/threedi.sqlite
from hydxlib import run_import_export run_import_export("threedi", "path/to/hydx/dir", "path/to/threedi.sqlite")
Installation for development
Clone hydxlib from github and then install locally using pip + virtualenv:
$ virtualenv .venv $ source .venv/bin/activate $ pip install -e .[test]
There will be a script you can run like this:
$ run-hydxlib ...
It runs the main() function in hydxlib/scripts.py, adjust that if necessary. The script is configured in setup.py (see entry_points).
Run the tests regularly:
$ pytest hydxlib --cov
The code is linted automatically on each PR. To enable autoformatting locally, install pre-commit:
$ pre-commit install
Changelog of hydxlib
Updated required threedi-schema version to 0.217.*
Extra release to signal updated requirements.
Make exporter work with SQLAlchemy 2.*
Updated required threedi-schema version to 0.216.*
Fix error for missing “VerloopVolume” (VER_VOL).
Fixed packaging (hydxlib was not listed as package in setup).
Updated required threedi-schema version to 0.214.*
Updated strictly required threedi-schema version to 0.214.3
Added threedi-schema as a dependency, removing threedi-modelchecker
Fixed writing logging to file
Fixed all tabulated profiles (TAB, HEU, MVR, UVR, OVA) and added TPZ and YZP.
Added inverted egg (EIG) profile.
Added trapezium profile in case no tabulated profile is given.
Add all cross sections to the 3Di spatialite and use the identifications from the input file.
Check if a profile is open/closed depending on the verbinding type (OPL or not).
Added Heul (HEU), U-Vorm (UVR), Ovaal (OVA) profielen, fixed Muil (MVR), removed trapezium (TPZ).
Fixed empty connection_node.the_geom column.
Log through the hydxlib.* logger instead of the root logger.
Emit error log if a value is required according to GWSW, but missing.
Made log messages more comprehensible by using terminology from GWSW instead of internal model and field names.
Set KNP_MAT to not required.
Emit more comprehensible error if a verbinding with types GSL, OPL, ITR, or DRL has no profile.
Backport changes from https://github.com/threedi/beta-plugins.
Added threedi-modelchecker as a dependency, and used the 3Di schema in it as a replacement for hydxlib.sql_models.
Removed PostGRES support (only spatialite remains).
Replaced GDAL with pyproj.
An ‘RHK’ profile is now interpreted as a closed (instead of open) rectangle.
Add JSON export format.
Closing database connection
Updating bug in rectangular cross sections
Using the final version of the hydx format.
Bug fix discharge coefficient orifices in Threedi.
Added docstrings and updated the readme.
Enabled automatic pypi.org uploads from travis-ci.com
Initial project structure created with cookiecutter and https://github.com/nens/cookiecutter-python-template .
Set up automatic testing with travis: https://travis-ci.com/nens/hydxlib .
First working version with hydx import and 3Di postgres output. In this version only nodes, weirs, orifices and pumpstations are supported.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.