Skip to main content

This package wraps around the native GDAL library which enables Cloud Optimized GeoTiffs generation at ease into your Python projects.

Project description

Cloud Optimized GeoTiff Generator

Overview

This package wrapped around the native GDAL library enables Cloud Optimized GeoTiffs generation at ease into your Python projects.

Installation

You can install the package via pip:

pip install cog_generation

To generate a cog:

from cog_generator import generate_cog
input_tif_list = ["sample1.tif", "sample2.tif"]
output_tif_path = "output_cog.tif"
options = {"compress": "lzw", "level": 9}

message, status_code = generate_cog(input_tif_list, output_tif_path, options)

Parameters available for options

  • compress: Defaults to lzw. Options include none, lzw, jpeg, deflate, zstd, webp, lerc, lerc_deflate, lerc_zstd, lzma.

  • level: Defaults to 6 for DEFLATE/LZMA, 9 for ZSTD. Compression level options depend on the compression type. Lower values result in faster compression but less efficient compression rate. 1 is the fastest.

  • QUALITY: Defaults to 75. JPEG/WEBP quality setting. For WEBP, QUALITY=100 automatically turns on lossless mode.

  • num_threads: Defaults to all_cpus. Enable multi-threaded compression by specifying the number of worker threads.

  • PREDICTOR: Defaults to NO. Set the predictor for LZW, DEFLATE, and ZSTD compression.

  • bigtiff: Defaults to IF_NEEDED. Control whether the created file is a BigTIFF or a classic TIFF.

  • zoom_level: (GDAL >= 3.5) Zoom level number (starting at 0 for coarsest zoom level).

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

cog_generator-0.0.1.tar.gz (15.6 kB view hashes)

Uploaded Source

Built Distribution

cog_generator-0.0.1-py3-none-any.whl (16.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page