Skip to main content

Cloud Optimized GeoTiff utility tools.

Project description

## Cloud Optimized GeoTiff utility tools


## Requirements
- click
- gdal

## Install
- pypi: `pip install cogeotiff`
- source code: `python setup.py install`

## Usage

### Python PAI
1. create cog file
example:
```python
from cogeotiff.cog import create_cog
src_path = '~/path_to_image/test.tif'
dest_path = '~/path_to_save/test.tiff.cog'
create_cog(src_path, dest_path, compress='jpeg')
```

2. validate cog file
```python
from cogeotiff.validate_cogeotiff import validate_cog
cog_path = '~/path_to_cog.tif.cog'
result = validate_cog(cog_path)
```

### Command tools
1. create cog file
```bash
Usage: cog create [OPTIONS] SRC_PATH DST_PATH

Options:
--overview-resampling TEXT resampling method for create pyramid default:
nearest
--overview-level INTEGER levels to build
--nodata INTEGER Assign a specified nodata value to output bands.
default: 0
--block-size INTEGER tiled size, default: 512
--compress TEXT compress method: JPEG,RAW,DEFLATE,LZW,WEBP,ZSTD,PACKBITS,default: raw
--help Show this message and exit.
```

2. validate cog file
```bash
Usage: cog create [OPTIONS] COG_PATH
```

## Q&A
- Q: why not use `GDAL BuildOverviews` or `Rasterio` in script?
- A: Because for large file such as 100GB, it's take long time to generate overview and translate to tiled GeoTiff. There is no progress infomataion use `Rasterio` or `GDAL BuildOverviews` methods.
- Q: why not use [rio-cogeo](https://github.com/cogeotiff/rio-cogeo)?
- A: Cause it use `rasterio MemoryFile()`, when the file is too large, it will cause insufficient memory.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cogeotiff-0.1.4-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file cogeotiff-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: cogeotiff-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

File hashes

Hashes for cogeotiff-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e3ecb4e32143041d25af16780691648018353686b8349f341a519a1f2a49a2cc
MD5 5d780554239a9732c6a504be21e99e5d
BLAKE2b-256 3d46c9d15e938a0290fea5b8ca7bdab7b1a2264b2cde5444f74c4c4f97303da2

See more details on using hashes here.

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