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.

NDVI with auto-stretch

raster2pm ndvi.tif --ndvi --auto-stretch -o ndvi.pmtiles

Dashboard Preview

NDVI Conversion

NDRE with custom colormap

raster2pm ndre.tif --ndre --colormap RdYlGn -o ndre.pmtiles

NDRE Conversion

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
# Custom zoom levels
raster2pm ortho.tif --min-zoom 12 --max-zoom 18 -o tiles.pmtiles
# High-quality WEBP output
raster2pm ortho.tif --format WEBP --quality 85 -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.3.tar.gz (18.5 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.3-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: raster2pm-0.1.3.tar.gz
  • Upload date:
  • Size: 18.5 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.3.tar.gz
Algorithm Hash digest
SHA256 2b6d637fe9046c4650e58044513e4389cecd72568203c6af727f71cfc4467e61
MD5 01aeae90a8925d1fbfcbc5933b2460c8
BLAKE2b-256 c24c9a08e20d905c6bee03c7edfb68374b717a3a7160aabd202745d4f4e695f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: raster2pm-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3b03b3c0a699322d7bef63c10a8978ee22e06840246e962762fccb4365c61505
MD5 4d68afb225084ac010b7a36666a55f25
BLAKE2b-256 aca6b07aff19f9a5b1bd2ad06c5ab77f26a9222c544ca3c02c8c701533d05155

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