Skip to main content

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

Project description

cloudfetch

Documentation CI Tests 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 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 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 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


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.2.tar.gz (16.9 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.2-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

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

Hashes for cloudfetch-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7e21e17883ba42b73f187ec8d6c6fcf27ec08bc233ca5ea990db9499fb4b2ef5
MD5 efa118abadc3517eb56c04e2c4e091db
BLAKE2b-256 6c4d7ff3805ee7c3957720514bd9c72badf266350a0d60181c1ba44f211d24e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloudfetch-0.1.2.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.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

Hashes for cloudfetch-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fa4b0bfb3eac422665a419edc1ca91f75dafda0e17e02351f35e082b2e92f972
MD5 24d693fc47c552fd5dc757deb10d31bd
BLAKE2b-256 e9ee587b388778c15f1a5fe56e87ea046c51a67ef496fe854f79057c578ffe4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloudfetch-0.1.2-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