Skip to main content

Convert raster imagery (orthomosaic, NDVI, NDRE) to PMTiles

Project description

raster2pm 🛰️

PyPI version Python 3.8+ License: MIT

raster → PMTiles — Convert any GeoTIFF to web-optimized map tiles in one command.

Convert orthomosaics, NDVI, NDRE, and any raster imagery to PMTiles with automatic colormap application for vegetation indices.

Why raster2pm?

  • 🗺️ One command: raster2pm input.tif -o output.pmtiles
  • 🎨 Smart colormaps: Auto-detects NDVI/NDRE and applies beautiful color ramps
  • 📊 Built-in diagnostics: Statistics, histograms, and colour warnings
  • 🚀 Memory efficient: Handles massive rasters with block-by-block processing
  • 🌐 Web-ready: Output works with MapLibre, Leaflet, OpenLayers, and pmtiles.io

Installation

# Basic installation
pip install raster2pm

# With development dependencies
pip install raster2pm[dev]


## Complete Usage 

# RGB Orthomosaic
raster2pm ortho.tif -o tiles.pmtiles

# NDVI with auto-stretch
raster2pm ndvi.tif --ndvi --auto-stretch -o ndvi.pmtiles

# NDRE with custom colormap
raster2pm ndre.tif --ndre --colormap RdYlGn -o ndre.pmtiles

# High-quality WEBP output
raster2pm ortho.tif --format WEBP --quality 85 -o tiles.pmtiles

# Custom zoom levels
raster2pm ortho.tif --min-zoom 12 --max-zoom 18 -o tiles.pmtiles

# JPEG with quality setting
raster2pm ortho.tif --format JPEG --quality 75 -o tiles_jpg.pmtiles

# Parallel processing (8 cores)
raster2pm large.tif --workers 8 -o tiles.pmtiles

# Custom metadata
raster2pm field.tif --name "Farm Field 42" --description "2cm/pixel, DJI P4" -o farm.pmtiles

# Check statistics before converting
raster2pm ndvi.tif --ndvi --stats-only

# Manual colormap range
raster2pm ndvi.tif --ndvi --min-value -0.3 --max-value 0.8 -o ndvi.pmtiles

# Disable overlay tiles
raster2pm ortho.tif --no-overlay -o tiles.pmtiles

# Include empty tiles
raster2pm ortho.tif --no-exclude-empty -o tiles.pmtiles

# Different colormaps
raster2pm ndvi.tif --ndvi --colormap viridis --auto-stretch -o ndvi.pmtiles
raster2pm ndvi.tif --ndvi --colormap plasma --auto-stretch -o ndvi.pmtiles
raster2pm ndvi.tif --ndvi --colormap ndvi_custom --auto-stretch -o ndvi.pmtiles

# Verbose output for debugging
raster2pm ortho.tif -v -o tiles.pmtiles

# Keep temporary files
raster2pm ndvi.tif --ndvi --keep-temp -o ndvi.pmtiles

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

raster2pm-0.1.2.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

raster2pm-0.1.2-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file raster2pm-0.1.2.tar.gz.

File metadata

  • Download URL: raster2pm-0.1.2.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for raster2pm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9b8b62a1b7c5f88742a19dfdb6ec813e373721912b59262f1ead09b8dc97374e
MD5 ffe596a5373eba405fb4e13c6efad962
BLAKE2b-256 f677bc19149ca515a2c33b3918b2a62557c0541b1029f3bf6f0fcdc012d314f3

See more details on using hashes here.

File details

Details for the file raster2pm-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: raster2pm-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for raster2pm-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b0d1dc179133b5a28f06ccd9aeb95b6e0f06918b6104806721565bd64f62673
MD5 51c456e5185acdfcdd647a1a8604a476
BLAKE2b-256 5ef64f68d2971184b1989fd17d4b29a1a6596c1963c9d42a2ab1d0fcf2dcefb6

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