Skip to main content

Importer and Exporter for GWSW

Project description

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.

Installation

hydxlib is installed with:

$ pip install hydxlib

Running script

It’s possible to run this tool on command line or with python.

Commandline:

$ run-hydxlib path/to/hydx/dir path/to/threedi.sqlite

Python:

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

1.3 (2022-12-12)

  • 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).

1.2 (2022-12-06)

  • Added Heul (HEU), U-Vorm (UVR), Ovaal (OVA) profielen, fixed Muil (MVR), removed trapezium (TPZ).

  • Fixed empty connection_node.the_geom column.

1.1 (2022-11-09)

  • 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.

1.0 (2022-10-25)

  • 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.

0.7 (2020-03-03)

  • Closing database connection

  • Updating bug in rectangular cross sections

0.6 (2019-11-22)

  • Using the final version of the hydx format.

0.5 (2019-02-12)

  • Bug fix discharge coefficient orifices in Threedi.

0.4 (2019-01-18)

  • Small fixes.

0.3 (2019-01-09)

  • Added docstrings and updated the readme.

0.2 (2019-01-09)

  • Enabled automatic pypi.org uploads from travis-ci.com

0.1 (2019-01-09)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hydxlib-1.3.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hydxlib-1.3-py2.py3-none-any.whl (33.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file hydxlib-1.3.tar.gz.

File metadata

  • Download URL: hydxlib-1.3.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for hydxlib-1.3.tar.gz
Algorithm Hash digest
SHA256 9cb8c210a1a778f59caa3af6269570821e559acaca79b81515c0a2a2e225f3f7
MD5 6a2fa53ebfc0609a86fda2205cc36fe2
BLAKE2b-256 e68a0e86789cd23230583b08864846503c7769cd8adf423954e53cb9218cddd9

See more details on using hashes here.

File details

Details for the file hydxlib-1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: hydxlib-1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for hydxlib-1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9c992b89f5ade4b06d11c5a9cb39467644856637de5f9af41eb85fe5876db795
MD5 b98dc115796d38843fb19be80c8bb70a
BLAKE2b-256 1c39cc62791230ab3bc65a3b5f6f0410dcacddc8e113b0b0995d6c87aa22bad6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page