Cloud Optimized GeoTiff utility tools.
Project description
## Cloud Optimized GeoTiff utility tools
## requirements
- click
- gdal
## 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 pyramiddefault:
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,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.
## requirements
- click
- gdal
## 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 pyramiddefault:
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,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 Distribution
cogeotiff-0.1.1.tar.gz
(7.6 kB
view hashes)
Built Distribution
Close
Hashes for cogeotiff-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73b67c54e879e5ecb855ef2c1d51325c350fa02e14cbd82aa6fa9817666c76fc |
|
MD5 | 7bce78d269a8e9d5001f44621c0b7b9b |
|
BLAKE2b-256 | db527e590145b0773a03f906b9989fe549598007c0892d20b0076bcb2cf5ef3b |