Metadata-Version: 2.4
Name: raster2pm
Version: 0.1.3
Summary: Convert raster imagery (orthomosaic, NDVI, NDRE) to PMTiles
Author-email: Samuel Appiah Kubi <appiahkubis14@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/appiahkubis14/raster2pm
Project-URL: Documentation, https://raster2pm.readthedocs.io
Project-URL: Repository, https://github.com/appiahkubis14/raster2pm.git
Project-URL: Issues, https://github.com/appiahkubis14/raster2pm/issues
Keywords: raster,pmtiles,ndvi,ndre,orthomosaic,drone,gis,geotiff
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rasterio>=1.3.0
Requires-Dist: numpy>=1.20.0
Requires-Dist: matplotlib>=3.5.0
Requires-Dist: rio-pmtiles>=0.3.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.4.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.0; extra == "docs"
Dynamic: license-file

﻿# raster2pm 🛰️

[![PyPI version](https://badge.fury.io/py/raster2pm.svg)](https://badge.fury.io/py/raster2pm)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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](data/ndvi.png)

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

![NDRE Conversion](data/ndre.png)

## 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

```bash
# 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
