Skip to main content

Generate a 3Di simulation grid from a model schematisation.

Project description

Github Actions status PyPI

Generate a 3Di simulation grid from a model schematisation.

Usage

This library converts a model schematisation to a 3Di simulation grid. This can be done using a single function that reads data from an SQLite and TIFF and then outputs the generated grid into a Geopackage or HDF5 file:

>>> from threedigrid_builder import make_gridadmin
>>> sqlite_path = "/path/to/model.sqlite"
>>> dem_path = "/path/to/dem.tiff"
>>> out_path = "grid.gpkg"  # or "something.h5" for HDF5 output
>>> make_gridadmin(sqlite_path, dem_path, out_path)

Alternatively, the generated grid can be output in-memory:

>>> make_gridadmin(sqlite_path, dem_path)
{'nodes': {'id': array([   1,    2,    3, ..., 7903, 7904, 7905], dtype=int32), ...}

Installation

This package is distributed as source and binary wheels on PyPI. The currently supported platforms are Windows, Linux, and OSX, all 64 bit versions only.

First install sqlite and spatialite libraries, e.g. on Ubuntu:

$ sudo apt-get install sqlite3 libsqlite3-mod-spatialite

For raster input, GDAL is required to be present. We omitted these from the dependencies because installation of GDAL depends on your platform an on your personal perference. One option is to install gdal using apt-get, and then pygdal with a matching version:

$ sudo apt-get libgdal-dev $ pip install pygdal=={your gdal version}.*

Install the threedigrid-builder:

$ pip install threedigrid-builder

For output into a file for the 3Di calculationcore, enable gridadmin output:

$ pip install threedigrid-builder[gridadmin]

For output into Geopackage for display in e.g. QGis, enable gpkg output:

$ pip install threedigrid-builder[gpkg]

The command line interface requires Typer:

$ pip install threedigrid-builder[cli]

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

threedigrid-builder-1.13.2.dev1.tar.gz (151.1 kB view hashes)

Uploaded Source

Built Distributions

threedigrid_builder-1.13.2.dev1-cp312-cp312-win_amd64.whl (616.6 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

threedigrid_builder-1.13.2.dev1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.13.2.dev1-cp312-cp312-macosx_10_9_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

threedigrid_builder-1.13.2.dev1-cp311-cp311-win_amd64.whl (616.6 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

threedigrid_builder-1.13.2.dev1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.13.2.dev1-cp311-cp311-macosx_10_9_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

threedigrid_builder-1.13.2.dev1-cp310-cp310-win_amd64.whl (617.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

threedigrid_builder-1.13.2.dev1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.13.2.dev1-cp310-cp310-macosx_10_9_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

threedigrid_builder-1.13.2.dev1-cp39-cp39-win_amd64.whl (617.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

threedigrid_builder-1.13.2.dev1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.13.2.dev1-cp39-cp39-macosx_10_9_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

threedigrid_builder-1.13.2.dev1-cp38-cp38-win_amd64.whl (615.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

threedigrid_builder-1.13.2.dev1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.13.2.dev1-cp38-cp38-macosx_10_9_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

Supported by

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