# 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:
```bash
pip install cog_generation
```
To generate a cog:
```python
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).
Raw data
{
"_id": null,
"home_page": "https://github.com/iamrajbhattarai/cog_generator",
"name": "cog-generator",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "COG,GeoTiff",
"author": "Raj Bhattarai",
"author_email": "raj.bhattarai222@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a8/66/9b603c321e279f454c40da85b964031349faf6a697690371485317a566a7/cog_generator-0.0.1.tar.gz",
"platform": null,
"description": "# Cloud Optimized GeoTiff Generator\n\n## Overview\nThis package wrapped around the native GDAL library enables Cloud Optimized GeoTiffs generation at ease into your Python projects.\n\n## Installation\nYou can install the package via pip:\n```bash\npip install cog_generation\n```\n\nTo generate a cog:\n\n```python\nfrom cog_generator import generate_cog\ninput_tif_list = [\"sample1.tif\", \"sample2.tif\"]\noutput_tif_path = \"output_cog.tif\"\noptions = {\"compress\": \"lzw\", \"level\": 9}\n\nmessage, status_code = generate_cog(input_tif_list, output_tif_path, options)\n```\n\n\n## Parameters available for options\n\n- **compress**: Defaults to `lzw`. Options include `none`, `lzw`, `jpeg`, `deflate`, `zstd`, `webp`, `lerc`, `lerc_deflate`, `lerc_zstd`, `lzma`.\n\n- **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.\n\n- **QUALITY**: Defaults to `75`. JPEG/WEBP quality setting. For WEBP, `QUALITY=100` automatically turns on lossless mode.\n\n- **num_threads**: Defaults to `all_cpus`. Enable multi-threaded compression by specifying the number of worker threads.\n\n- **PREDICTOR**: Defaults to `NO`. Set the predictor for LZW, DEFLATE, and ZSTD compression.\n\n- **bigtiff**: Defaults to `IF_NEEDED`. Control whether the created file is a BigTIFF or a classic TIFF.\n\n- **zoom_level**: (GDAL >= 3.5) Zoom level number (starting at 0 for coarsest zoom level).\n\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "This package wraps around the native GDAL library which enables Cloud Optimized GeoTiffs generation at ease into your Python projects.",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/iamrajbhattarai/cog_generator"
},
"split_keywords": [
"cog",
"geotiff"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "46cd0ff389872784dbbc45bafbd7cfebba5e687ba477c946a223c82e7da7cd52",
"md5": "90e264ed8592bfb741eecabbffdb2339",
"sha256": "75988bef2d7456ab348c5eafd50da67623401cbeebcb2aba5d89bad80d2ebc11"
},
"downloads": -1,
"filename": "cog_generator-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "90e264ed8592bfb741eecabbffdb2339",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 16038,
"upload_time": "2024-02-13T10:11:46",
"upload_time_iso_8601": "2024-02-13T10:11:46.584043Z",
"url": "https://files.pythonhosted.org/packages/46/cd/0ff389872784dbbc45bafbd7cfebba5e687ba477c946a223c82e7da7cd52/cog_generator-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a8669b603c321e279f454c40da85b964031349faf6a697690371485317a566a7",
"md5": "566ab0ab8a3f01898410173a8bf5bcc1",
"sha256": "a7b3af0072fb891f0cddfa291bac8d5baf206f637ab5c24c81c5e3c05fa5a676"
},
"downloads": -1,
"filename": "cog_generator-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "566ab0ab8a3f01898410173a8bf5bcc1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15571,
"upload_time": "2024-02-13T10:11:48",
"upload_time_iso_8601": "2024-02-13T10:11:48.376909Z",
"url": "https://files.pythonhosted.org/packages/a8/66/9b603c321e279f454c40da85b964031349faf6a697690371485317a566a7/cog_generator-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-13 10:11:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "iamrajbhattarai",
"github_project": "cog_generator",
"github_not_found": true,
"lcname": "cog-generator"
}