Metadata-Version: 2.4
Name: cog2tiles
Version: 0.0.2
Summary: COG to web map tiles converter with concurrent processing
Project-URL: Homepage, https://github.com/kshitijrajsharma/cog2tiles
Project-URL: Repository, https://github.com/kshitijrajsharma/cog2tiles
Project-URL: Issues, https://github.com/kshitijrajsharma/cog2tiles/issues
Author-email: Kshitij Raj Sharma <krschap@duck.com>
License: MIT
License-File: LICENSE
Keywords: cog,geospatial,gis,mapping,raster,tiles
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: mercantile>=1.2.1
Requires-Dist: numba>=0.61.2
Requires-Dist: numpy>=2.2.6
Requires-Dist: pillow>=11.3.0
Requires-Dist: polars>=1.32.2
Requires-Dist: rasterio>=1.3.0
Requires-Dist: rio-tiler>=7.8.1
Requires-Dist: tqdm>=4.67.1
Requires-Dist: uvloop>=0.21.0
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: commitizen>=4.8.3; extra == 'dev'
Requires-Dist: flake8>=6.0.0; extra == 'dev'
Requires-Dist: isort>=5.12.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# cog2tiles

 Cloud Optimized GeoTIFF (COG) to web map tiles converter built with modern Python.

## Installation

### Using uv (recommended)

```bash
git clone https://github.com/kshitijrajsharma/cog2tiles.git
cd cog2tiles
uv sync
```

### Using pip

```bash
pip install cog2tiles
```

## Usage

### Command Line Interface

Basic usage:
```bash
cog2tiles input.tif -z 19
```

Advanced usage:
```bash
cog2tiles input.tif -z 19 --tile-size 512 --extension png --output-dir tiles/ --workers 64
```

### Options

- `input_cog`: Path to input COG file
- `-z, --zoom`: Target zoom level (0-22)
- `-o, --output-dir`: Output directory (default: tiles)
- `--tile-size`: Tile size in pixels, 256 or 512 (default: 256)
- `--prefix`: Filename prefix for tiles (default: tile)
- `--extension`: Output format - png, jpg, webp (default: png)
- `--workers`: Maximum concurrent workers (default: auto-detected)
- `--log-level`: Logging level - DEBUG, INFO, WARNING, ERROR (default: INFO)

### Python API

```python
import asyncio
from cog2tiles import COGTiler

async def main():
    tiler = COGTiler(
        tile_size=512,
        max_workers=32,
        extension="webp"
    )
    
    await tiler.convert_to_tiles("input.tif", "output/", zoom=19)

asyncio.run(main())
```

## Requirements

- Python 3.11 or higher
- GDAL/rasterio for geospatial operations
- Numba for accelerated processing
- UV for dependency management
- uvloop for the fast asyncio loops (optional)

## Development

### Setup Development Environment

```bash
git clone https://github.com/kshitijrajsharma/cog2tiles.git
cd cog2tiles
uv sync --dev
```

### Running Tests

```bash
uv run pytest
```

### Code Formatting

```bash
uv run black src/
uv run isort src/
```

## Supported Input Formats

- Cloud Optimized GeoTIFF (COG)
- Any rasterio-supported format with proper georeferencing

## Output Formats

- PNG (lossless, supports transparency)
- JPEG (lossy, smaller file sizes)
- WebP (modern format, good compression)

## License

MIT License - see LICENSE file for details.

## Author

Kshitij Raj Sharma (2025)
