startinpy

startinpy: A Python library for modelling and processing 2.5D triangulated terrains - Published in JOSS (2024)

https://github.com/hugoledoux/startinpy

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README and JOSS metadata
  • Academic publication links
  • Committers with academic emails
    2 of 5 committers (40.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

delaunay-triangulation gis interpolation terrain tin
Last synced: 4 months ago · JSON representation ·

Repository

A Python library for modelling and processing 2.5D terrains using a (2D) Delaunay triangulation.

Basic Info
  • Host: GitHub
  • Owner: hugoledoux
  • License: mit
  • Language: Rust
  • Default Branch: master
  • Homepage: https://startinpy.rtfd.io/
  • Size: 14.3 MB
Statistics
  • Stars: 33
  • Watchers: 2
  • Forks: 7
  • Open Issues: 2
  • Releases: 20
Topics
delaunay-triangulation gis interpolation terrain tin
Created over 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Citation

README.md

PyPI docs GitHub license

startinpy

A library for modelling and processing 2.5D terrains using a (2D) Delaunay triangulation. The triangulation is computed in 2D, but the z-elevation of the vertices are kept.

The underlying code is written in Rust (so it's rather fast) and robust arithmetic is used (so it shouldn't crash). startinpy uses the startin Rust library and adds several utilities and functions, for instance NumPy support for input/output, exporting to several formats, and easy-of-use.

startinpy allows you to:

  1. insert incrementally points
  2. delete vertices (useful for simplification, interpolation, and other operations)
  3. interpolate with several methods: TIN, natural neighbours, IDW, Laplace, etc.
  4. use other useful terrain Python libraries that are also NumPy-based, eg laspy, rasterio, meshio
  5. output the TIN to several formats: OBJ, PLY, GeoJSON, and CityJSON
  6. store extra attributes with the vertices (the ones from LAS/LAZ)

Documentation

https://startinpy.rtfd.io

Installation

pip

To install the latest release: pip install startinpy

(watch out: this does not work with Linux currently, it installs an old version!)

If you want to compile it yourself

  1. install latest Rust
  2. install maturin
  3. maturin build --release
  4. cd ./target/wheels/
  5. pip install [name-wheel].whl will install it to your local Python

Development

  1. install Rust (v1.39+)
  2. install maturin
  3. maturin develop
  4. move to another folder, and import startinpy shouldn't return any error

Testing

To run the automated test suite:

  1. install the test requirements: pip install -r tests/requirements.txt
  2. pytest

Examples

The folder ./demo contains a few examples.

```python import laspy import numpy as np import startinpy

las = laspy.read("../data/small.laz") pts = np.vstack((las.x, las.y, las.z)).transpose()

dt = startinpy.DT() dt.insert(pts)

-- remove vertex #4

try: dt.remove(4) except Exception as e: print(e)

print("# vertices:", dt.numberofvertices()) print("# triangles:", dt.numberoftriangles())

-- print the vertices forming the convex hull, in CCW-order

print("CH: ", dt.convex_hull())

-- fetch all the incident triangles (CCW-ordered) to the vertex #235

vi = 235 onerandompt = dt.points[vi] print("one random point:", onerandompt) print(dt.incidenttrianglesto_vertex(vi))

-- interpolate at a location with the linear in TIN method

zhat = dt.interpolate({"method": "TIN"}, [[85718.5, 447211.6]]) print("result: ", zhat[0]) ```

If you use this software, please cite this article

bibtex @article{Ledoux24, author = {Ledoux, Hugo}, title = {{startinpy}: {A} {P}ython library for modelling and processing {2.5D} triangulated terrains}, journal = {Journal of Open Source Software}, year = {2024}, volume = {9}, number = {103}, pages = {7123}, doi = {10.21105/joss.07123} }

Owner

  • Name: Hugo Ledoux
  • Login: hugoledoux
  • Kind: user
  • Location: Delft, the Netherlands
  • Company: Delft University of Technology

3D geoinformation processing, @cityjson, triangulations. I work at @tudelft3d

JOSS Publication

startinpy: A Python library for modelling and processing 2.5D triangulated terrains
Published
November 12, 2024
Volume 9, Issue 103, Page 7123
Authors
Hugo Ledoux ORCID
Delft University of Technology, the Netherlands
Editor
Michael Mahoney ORCID
Tags
Delaunay triangulation terrain interpolation GIS

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Ledoux
  given-names: Hugo
  orcid: "https://orcid.org/0000-0002-1251-8654"
doi: 10.5281/zenodo.14001126
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Ledoux
    given-names: Hugo
    orcid: "https://orcid.org/0000-0002-1251-8654"
  date-published: 2024-11-12
  doi: 10.21105/joss.07123
  issn: 2475-9066
  issue: 103
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 7123
  title: "startinpy: A Python library for modelling and processing 2.5D
    triangulated terrains"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.07123"
  volume: 9
title: "startinpy: A Python library for modelling and processing 2.5D
  triangulated terrains"

GitHub Events

Total
  • Create event: 4
  • Release event: 3
  • Issues event: 4
  • Watch event: 5
  • Delete event: 3
  • Issue comment event: 3
  • Push event: 24
  • Pull request event: 1
  • Fork event: 1
Last Year
  • Create event: 4
  • Release event: 3
  • Issues event: 4
  • Watch event: 5
  • Delete event: 3
  • Issue comment event: 3
  • Push event: 24
  • Pull request event: 1
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 464
  • Total Committers: 5
  • Avg Commits per committer: 92.8
  • Development Distribution Score (DDS): 0.034
Past Year
  • Commits: 50
  • Committers: 3
  • Avg Commits per committer: 16.667
  • Development Distribution Score (DDS): 0.08
Top Committers
Name Email Commits
Hugo Ledoux h****x@t****l 448
Ewout ter Hoeven e****n@s****l 11
Pete Gadomski p****i@g****m 3
Wei Ji 2****4 1
Maarten Pronk g****t@e****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 18
  • Total pull requests: 12
  • Average time to close issues: 3 months
  • Average time to close pull requests: 22 days
  • Total issue authors: 7
  • Total pull request authors: 5
  • Average comments per issue: 1.83
  • Average comments per pull request: 2.58
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 5
  • Average time to close issues: 13 days
  • Average time to close pull requests: 15 days
  • Issue authors: 4
  • Pull request authors: 2
  • Average comments per issue: 1.14
  • Average comments per pull request: 1.4
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • hugoledoux (7)
  • djdan7 (4)
  • mllobera (3)
  • weiji14 (2)
  • kylemann16 (1)
  • Ylannl (1)
  • gadomski (1)
Pull Request Authors
  • gadomski (8)
  • EwoutH (5)
  • DimitrisMantas (2)
  • weiji14 (2)
  • evetion (1)
Top Labels
Issue Labels
enhancement (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 324 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 19
  • Total maintainers: 1
pypi.org: startinpy

Modelling terrains with Delaunay triangulation

  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 324 Last month
Rankings
Downloads: 9.5%
Dependent packages count: 10.0%
Average: 14.2%
Stargazers count: 14.5%
Forks count: 15.3%
Dependent repos count: 21.7%
Maintainers (1)
Last synced: 4 months ago

Dependencies

docs/requirements.txt pypi
  • sphinx ==4.3
  • sphinx-celery ==2.0.0
  • toml ==0.10.2
.github/workflows/build.yml actions
  • actions-rs/toolchain v1 composite
  • actions/checkout v2 composite
  • messense/maturin-action v1 composite
.github/workflows/publish.yml actions
  • actions-rs/toolchain v1 composite
  • actions/checkout v2 composite
  • messense/maturin-action v1 composite
Cargo.toml cargo
pyproject.toml pypi
setup.py pypi