跳转到主要内容

从模型概化生成3Di模拟网格。

项目描述

Github Actions status PyPI

从模型概化生成3Di模拟网格。

用法

此库将模型概化转换为3Di模拟网格。这可以通过一个读取SQLite和TIFF数据的单函数完成,然后将生成的网格输出到Geopackage或HDF5文件

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

或者,生成的网格可以输出到内存中

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

安装

本软件包以源代码和二进制轮文件形式在PyPI上分发。目前支持的平台有Windows、Linux和OSX,仅限64位版本。

首先安装sqlite和spatialite库,例如在Ubuntu上

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

对于栅格输入,需要GDAL库。我们将其从依赖项中省略,因为GDAL的安装取决于您的平台和您的个人喜好。一种选择是使用apt-get安装gdal,然后安装与版本匹配的pygdal

$ sudo apt-get libgdal-dev $ pip install pygdal=={您的gdal版本}.*

安装threedigrid-builder

$ pip install threedigrid-builder

要将输出保存到文件以供3Di计算核心使用,请启用gridadmin输出

$ pip install threedigrid-builder[gridadmin]

要将输出保存到Geopackage以在QGis等软件中显示,请启用gpkg输出

$ pip install threedigrid-builder[gpkg]

命令行界面需要Typer

$ pip install threedigrid-builder[cli]

项目详情


发布历史 发布通知 | RSS订阅

下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装软件包的信息。

源代码分发

threedigrid_builder-1.19.1.tar.gz (154.4 kB 查看哈希值)

上传时间 源代码

构建版本

threedigrid_builder-1.19.1-cp312-cp312-win_amd64.whl (624.9 kB 查看哈希值)

上传时间 CPython 3.12 Windows x86-64

threedigrid_builder-1.19.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB 查看哈希值)

上传时间 CPython 3.12 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.19.1-cp312-cp312-macosx_10_9_x86_64.whl (1.6 MB 查看哈希值)

上传时间 CPython 3.12 macOS 10.9+ x86-64

threedigrid_builder-1.19.1-cp311-cp311-win_amd64.whl (624.9 kB 查看哈希值)

上传时间 CPython 3.11 Windows x86-64

threedigrid_builder-1.19.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB 查看哈希值)

上传时间 CPython 3.11 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.19.1-cp311-cp311-macosx_10_9_x86_64.whl (1.6 MB 查看哈希值)

上传时间 CPython 3.11 macOS 10.9+ x86-64

threedigrid_builder-1.19.1-cp310-cp310-win_amd64.whl (626.4 kB 查看哈希值)

上传时间 CPython 3.10 Windows x86-64

threedigrid_builder-1.19.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB 查看哈希值)

上传时间 CPython 3.10 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.19.1-cp310-cp310-macosx_10_9_x86_64.whl (1.6 MB 查看哈希值)

上传时间 CPython 3.10 macOS 10.9+ x86-64

threedigrid_builder-1.19.1-cp39-cp39-win_amd64.whl (626.7 kB 查看哈希值)

上传于 CPython 3.9 Windows x86-64

threedigrid_builder-1.19.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB 查看哈希值)

上传于 CPython 3.9 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.19.1-cp39-cp39-macosx_10_9_x86_64.whl (1.6 MB 查看哈希值)

上传于 CPython 3.9 macOS 10.9+ x86-64

threedigrid_builder-1.19.1-cp38-cp38-win_amd64.whl (623.5 kB 查看哈希值)

上传于 CPython 3.8 Windows x86-64

threedigrid_builder-1.19.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB 查看哈希值)

上传于 CPython 3.8 manylinux: glibc 2.17+ x86-64

threedigrid_builder-1.19.1-cp38-cp38-macosx_10_9_x86_64.whl (1.6 MB 查看哈希值)

上传于 CPython 3.8 macOS 10.9+ x86-64

支持者:

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面