Skip to main content

A library for downloading arbitrary polygons of large remote point cloud datasets.

Project description

Cloudfetch

PyPI version Documentation CI Tests Python Versions License: MIT

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 areas of large remote point cloud datasets. Designed for ease of use and automated processing It takes care of the repetative tasks associated with working with point clouds and leaves more time for your research or analysis. It leverages PDAL (Point Data Abstraction Library) and COPC (Cloud Optimized Point Clouds) 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 tkintermapview allowing 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 ProviderChain to automatically attempt downloads across multiple datasets in sequence (e.g., trying AHN6, and falling back to AHN5 if data is unavailable).
  • Dynamic Poisson Sampling: Control the output density via minimum point spacing (Poisson thinning) to keep file sizes manageable.

Who cloudfetch is for

Cloudfetch is basically a part of my Thesis at TU Delft that got out of hand. After a few hours of clicking through portals and dragging files around had me frustrated, I decided to spend 10x that time building this. Basically, while anyone is welcome to use or copy cloudfetch keep in mind that:

  • ✅ If you are doing analysis/research using airborne LiDAR this library will probably be a good fit.

  • ✅ If you just want to play around with downloading your favorite landmark and know a little bit of python this is probably a fun way to get started.

  • ▶️ If you are building a product and need stable continued acces to point cloud data this is probably not for you. At least until the project reaches 1.0.0, which it might never.

  • ✖️ If you want a simple one-time download or dont know any python you should use one of the many online portals, they are not as bad as I say. For AHN you can for example use this very nice one provided by het Waterschapshuis

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 its (in my opinion better) alternative 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 cloudfetch using pip:

pip install cloudfetch

Or through the Pixi CLI:

pixi add --pypi 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 Density

You can dynamically thin the dataset to a specific minimum point spacing by supplying a sampling_radius float (in coordinate units) to the fetch() method:

# Apply a 2.0 coordinate unit radius for Poisson thinning
provider.fetch(aoi=aoi.polygon, sampling_radius=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


Download files

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

Source Distribution

cloudfetch-0.1.3.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

cloudfetch-0.1.3-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file cloudfetch-0.1.3.tar.gz.

File metadata

  • Download URL: cloudfetch-0.1.3.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cloudfetch-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a7f39e008d9a39205cb9ec98960a72a8f2c9a102ed1387e0576940ad6afa3058
MD5 998603a0d8bbde1b7b035daca2b875c6
BLAKE2b-256 85b3aa6a1eab9d87fac0269794269a951af957b70087e1b64b40f518f73c13a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloudfetch-0.1.3.tar.gz:

Publisher: publish.yaml on yairroorda/cloudfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cloudfetch-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: cloudfetch-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cloudfetch-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3df8b16511db5f0fe80c32d9255fd292207cfedb677fa1df31a2a8d2c5cfc1f9
MD5 af149506a71b693f3c4ea05b19be0739
BLAKE2b-256 7851ee568ba35cb4b275a9916dbc33ca94da149bb092fa7fe347778b1aea1567

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloudfetch-0.1.3-py3-none-any.whl:

Publisher: publish.yaml on yairroorda/cloudfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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