A library for downloading arbitrary polygons of large remote point cloud datasets.
Project description
cloudfetch
Tired of endlessly clicking through portals to download LiDAR data? Is your area of interest always on intersection of 4 neighbouring tiles? cloudfetch is a library for downloading arbitrary polygons of large remote point cloud datasets. Designed for ease of use and automated processing, it leverages PDAL (Point Data Abstraction Library) and COPC under the hood to crop, merge, and filter point cloud tiles seamlessly.
Features
- Custom Areas of Interest (AOI): Define arbitrary polygons to query specific geographic regions rather than downloading entire dataset tiles.
- Interactive Polygon Drawing: Includes an interactive map widget powered by
tkintermapviewallowing users to draw AOIs directly through a GUI. - Multiple Open Datasets: Built-in support for multiple national remote point cloud datasets, including the Dutch AHN series, French IGN LiDAR HD, and Canadian CanElevation.
- Extendible Architecture Integrate new data sources by subclassing the abstract PointCloudProvider. Developers only need to implement a single get_index method to retrieve tile URLs, and the base class will automatically handle the heavy lifting of downloading, cropping, and merging via PDAL.
- Provider Chaining: Use
ProviderChainto automatically attempt downloads across multiple datasets in sequence (e.g., trying AHN6, and falling back to AHN5 if data is unavailable). - Dynamic Resolution Control: Control the output density via minimum point spacing (Poisson thinning) to keep file sizes manageable.
Installation
cloudfetch requires Python 3.10 or higher.
Because this library relies heavily on PDAL for its C++ point cloud processing capabilities, you must install the underlying PDAL binaries on your system before installing this package. Standard pip cannot build these C++ dependencies reliably.
Step 1: Install PDAL (Prerequisite)
I strongly recommend using a package manager like conda or pixi to install the PDAL Python bindings and binaries:
Using Conda/Mamba:
conda install -c conda-forge python-pdal
Using Pixi:
pixi add pdal python-pdal
(Note: Advanced users can also install PDAL via system package managers like brew install pdal or apt-get install pdal, but Conda/Pixi is the safest route).
Step 2: Install cloudfetch
Once PDAL is installed in your environment, you can safely install the library via PyPI:
pip install cloudfetch
Quickstart
Below is a basic example demonstrating how to draw an AOI interactively, chain two AHN datasets together, and download the resulting point cloud.
import logging
from cloudfetch import AHN5, AHN6
from cloudfetch.base import ProviderChain, AOIPolygon
# Set up logging to track the download and PDAL processing
logging.basicConfig(level=logging.INFO, format="[%(levelname)s] | %(name)s | %(message)s")
def main():
# 1. Prompt the user to draw an Area of Interest on an interactive map
aoi_rdnew = AOIPolygon.get_from_user("Draw AOI for AHN demo")
# 2. Initialize the dataset providers
ahn6 = AHN6(data_dir="./data")
ahn5 = AHN5(data_dir="./data")
# 3. Chain them: The library will try AHN6 first, then fallback to AHN5
ahn_chain = ProviderChain(providers=[ahn6, ahn5])
# 4. Fetch the data, which will be merged, cropped, and saved as COPC.LAZ
result_path = ahn_chain.fetch(aoi=aoi_rdnew.polygon, aoi_crs=aoi_rdnew.crs, output_path="./data/my_output.copc.laz")
if __name__ == "__main__":
main()
Loading Geometries from Files
If you already have a predefined shape (such as a GeoJSON file), you can bypass the UI and load the polygon directly:
aoi = AOIPolygon.get_from_file(Path("my_boundary.geojson"))
Adjusting Resolution
You can dynamically thin the dataset to a specific minimum point spacing by supplying a resolution float (in coordinate units) to the fetch() method:
# Apply a 2.0 coordinate unit radius for Poisson thinning
provider.fetch(aoi=aoi.polygon, resolution=2.0)
Supported Datasets
The library currently supports the following dataset providers out of the box:
- Netherlands:
AHN1,AHN2,AHN3,AHN4,AHN5,AHN6. - France:
IGNLidarHD. - Canada:
CanElevation
License & Authors
- Author: Yair Roorda.
- License: MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cloudfetch-0.1.2.tar.gz.
File metadata
- Download URL: cloudfetch-0.1.2.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e21e17883ba42b73f187ec8d6c6fcf27ec08bc233ca5ea990db9499fb4b2ef5
|
|
| MD5 |
efa118abadc3517eb56c04e2c4e091db
|
|
| BLAKE2b-256 |
6c4d7ff3805ee7c3957720514bd9c72badf266350a0d60181c1ba44f211d24e6
|
Provenance
The following attestation bundles were made for cloudfetch-0.1.2.tar.gz:
Publisher:
publish.yaml on yairroorda/cloudfetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudfetch-0.1.2.tar.gz -
Subject digest:
7e21e17883ba42b73f187ec8d6c6fcf27ec08bc233ca5ea990db9499fb4b2ef5 - Sigstore transparency entry: 1429095879
- Sigstore integration time:
-
Permalink:
yairroorda/cloudfetch@cbbb71762b0d5553623b09c94dff83d0998da097 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/yairroorda
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@cbbb71762b0d5553623b09c94dff83d0998da097 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cloudfetch-0.1.2-py3-none-any.whl.
File metadata
- Download URL: cloudfetch-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa4b0bfb3eac422665a419edc1ca91f75dafda0e17e02351f35e082b2e92f972
|
|
| MD5 |
24d693fc47c552fd5dc757deb10d31bd
|
|
| BLAKE2b-256 |
e9ee587b388778c15f1a5fe56e87ea046c51a67ef496fe854f79057c578ffe4b
|
Provenance
The following attestation bundles were made for cloudfetch-0.1.2-py3-none-any.whl:
Publisher:
publish.yaml on yairroorda/cloudfetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudfetch-0.1.2-py3-none-any.whl -
Subject digest:
fa4b0bfb3eac422665a419edc1ca91f75dafda0e17e02351f35e082b2e92f972 - Sigstore transparency entry: 1429095892
- Sigstore integration time:
-
Permalink:
yairroorda/cloudfetch@cbbb71762b0d5553623b09c94dff83d0998da097 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/yairroorda
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@cbbb71762b0d5553623b09c94dff83d0998da097 -
Trigger Event:
release
-
Statement type: