Skip to main content

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.

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.number_of_vertices())
print("# triangles:", dt.number_of_triangles())

# -- 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
one_random_pt = dt.points[vi]
print("one random point:", one_random_pt)
print(dt.incident_triangles_to_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

@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}
}

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

startinpy-0.12.3-cp314-none-win_amd64.whl (333.6 kB view details)

Uploaded CPython 3.14Windows x86-64

startinpy-0.12.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.4 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

startinpy-0.12.3-cp314-cp314-macosx_11_0_arm64.whl (373.7 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

startinpy-0.12.3-cp313-none-win_amd64.whl (333.6 kB view details)

Uploaded CPython 3.13Windows x86-64

startinpy-0.12.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

startinpy-0.12.3-cp313-cp313-macosx_11_0_arm64.whl (373.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

startinpy-0.12.3-cp312-none-win_amd64.whl (333.6 kB view details)

Uploaded CPython 3.12Windows x86-64

startinpy-0.12.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

startinpy-0.12.3-cp312-cp312-macosx_11_0_arm64.whl (373.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

startinpy-0.12.3-cp311-none-win_amd64.whl (334.0 kB view details)

Uploaded CPython 3.11Windows x86-64

startinpy-0.12.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

startinpy-0.12.3-cp311-cp311-macosx_11_0_arm64.whl (373.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

startinpy-0.12.3-cp310-none-win_amd64.whl (334.0 kB view details)

Uploaded CPython 3.10Windows x86-64

startinpy-0.12.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

startinpy-0.12.3-cp310-cp310-macosx_11_0_arm64.whl (373.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file startinpy-0.12.3-cp314-none-win_amd64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp314-none-win_amd64.whl
Algorithm Hash digest
SHA256 40dc171a37f6b50e56d727771f2375dcdcd30ea5b8365550ced8df47b9629381
MD5 e52b02bffa2ac5fbe61c083c98bfa15a
BLAKE2b-256 c47b1fc35b3bb154229c43533b11d53a25bd08ace6533035fa94fee9aa96be0c

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0cf8fe4149b03b99d98d9b7fd47ad8614b2e9df162c9c8dd05f99e3746c9b6fc
MD5 fe46eca08b630ce71c140649f8841712
BLAKE2b-256 54174fedfee2174162e9016ee50c6f2063495ffdaf03131c98345ff970cf87b8

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 38ae75fe714cf8ae262a9219d5b543f0ba1c097a397df76fd0a451c62575af6e
MD5 ef32fc59a1bd13e86f1e266001438ccf
BLAKE2b-256 bf6417ac70dfc33259754c1c4299cc75a36dd3ddbc562cffa062c0ebda32355b

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp313-none-win_amd64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp313-none-win_amd64.whl
Algorithm Hash digest
SHA256 c60b7207b4744b191723c0c4b4b18f422b736471e945578891667b45a489ed31
MD5 8e9e8224070e0eb6174769fbf8e18ca7
BLAKE2b-256 0d43ed755670ab8fdce6796afc0184084fc11b246ce9b7b99c9966d4724fd6b2

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a8d9f4bff9c5a602e6af47d897e3e4fd5905ff74d468afa1ec8b191797b1e90f
MD5 1c3e87c8ffefa01f60305daf60c3346e
BLAKE2b-256 4f53e667768c0b44713641a96ae807ec791fc012b5f173c15a76e18250184755

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a802b0032c9d1036b231cbf32c95fa19863ab73ecfc21dc194552e2e7a117f72
MD5 bface2b5528608d18797c0d22b3e7920
BLAKE2b-256 24d1b38fb73fb7131abe9ab5caee4b7b21dc5ca6695a5df56bcbac8dad0ee20c

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 dbe43d19b08baeba4596b1f0abed209136a76cb4424636e51967e2a8217cd914
MD5 20ca8325f080fb569bfd9c8aa44aeec3
BLAKE2b-256 b71b6e65fa520e727cfbcaa8d4c1cfee0760edd5f0694c9d5f021203d3ea4543

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cd29839cd0231cb4417e3ef4f32fb1e050787ae0cdb18e570b995f9e027f8945
MD5 c8110ecca02276c2743597c6e4e56843
BLAKE2b-256 40aabb191ab65759f3954a9280b5573abdcd79658d4af5528b17fbe1d00751f9

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 46302250118a5e4345acbd8f77c0b33a895cdc50a4748703c50384aa13f59bb7
MD5 78672ee265ab4ec3c672eb3c7c342818
BLAKE2b-256 09ffad12e25a927e701610fd204e7a4517c7d7756b92a3b0405d44ad280aa13c

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 82d9d970dfdecceabd980940656a658adee4a7675ed558e9de2ba453755a6b5c
MD5 ea1f8d61877ad282644b5c52c24e323d
BLAKE2b-256 abf7da7a837a445ca662faa32383d96664bc9aa64c8153e12e94ee45fe5c03e3

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 899b8b2d3048ab9565a34eb37887575b2eea2361ede40f4d4fcd1207ed264601
MD5 c7419bb14cf85c7f7a573ccc6e3dcddf
BLAKE2b-256 c465478f37002574df3885fa548290894c05b91a0fa29287e81ae31cbc8efdf0

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e7d59c0a8a2f26123fda46ff25a30adfd9fa4a3156df7dbfb64e78b136ff4ed3
MD5 d6028b76139da35ea20563ead3ce33cd
BLAKE2b-256 c8bbf48b8e525a0901b8cdca7e78e82875fbd9d3988a626bb79cfa452397469f

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 69284c0676d2ff59ce73e78df8a842465d109b09cf15438e804c5bc4f26913cd
MD5 9a84c287a33abeac85cd30e00fa4a2ad
BLAKE2b-256 cbcfc9d0b6cf8c1dd911adf7e57f2a98a795651ae26a74a2da282ba4286a169c

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 051e2b791d57aab1449e1d9a5bcabe3743c28c4e4c7bb7e35b78bf3afb6f8bda
MD5 cea0cd602aade902e30a5fdfed25b19e
BLAKE2b-256 cd0444d5a7165196d7b985e1a80b6e5dadf7755e6ca189ac16350fb408029c95

See more details on using hashes here.

File details

Details for the file startinpy-0.12.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for startinpy-0.12.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 916a86cd0f73d0d94963f402a90a2ab962a49834e8a79a3860dcb8aff44135ec
MD5 aee52420b18d90932bbd16cabae10407
BLAKE2b-256 b23dbe235fffa16f43e1caa03baf869f79284180fe392aa388f063af2b13440b

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 Sentry Error logging StatusPage Status page