Skip to content

Commit

Permalink
release 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Oct 3, 2019
1 parent 1340dc0 commit 92bba3a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
master (YYYY-MM-DD)
-------------------
1.1.4 (2019-10-03)
------------------

- Fix support for optimizing open datasets, memfiles, and VRTs (#100)
- Fix support for optimizing open datasets, memfiles, and VRTs (#100 from j08lue)


1.1.3 (2019-09-16)
Expand Down
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Cloud Optimized GeoTIFF (COG) creation and validation plugin for Rasterio

[![Packaging status](https://badge.fury.io/py/rio-cogeo.svg)](https://badge.fury.io/py/rio-cogeo)
[![CircleCI](https://circleci.com/gh/cogeotiff/rio-cogeo.svg?style=svg)](https://circleci.com/gh/cogeotiff/rio-cogeo)
[![codecov](https://codecov.io/gh/cogeotiff/rio-cogeo/branch/master/graph/badge.svg?token=zuHupC20cG)](https://codecov.io/gh/cogeotiff/rio-cogeo)
[![codecov](https://codecov.io/gh/cogeotiff/rio-cogeo/branch/master/graph/badge.svg)](https://codecov.io/gh/cogeotiff/rio-cogeo)

## Cloud Optimized GeoTIFF

Expand Down Expand Up @@ -196,6 +196,42 @@ $ rio cogeo create mydataset.tif mydataset_raw.tif --co BLOCKXSIZE=1024 --co BLO

See https://gdal.org/drivers/raster/gtiff.html#creation-options for full details of creation options.

## API

Rio-cogeo can also be integrated directly in your custom script. See [rio_cogeo.cogeo.cog_translate](https://github.com/cogeotiff/rio-cogeo/blob/master/rio_cogeo/cogeo.py#L53-L108) function.

e.g:

```python
from rio_cogeo.cogeo import cog_translate

def _translate(src_path, dst_path, profile="webp", profile_options={}, **options):
"""Convert image to COG."""
# Format creation option (see gdalwarp `-co` option)
output_profile = cog_profiles.get(profile)
output_profile.update(dict(BIGTIFF="IF_SAFER"))
output_profile.update(profile_options)

# Dataset Open option (see gdalwarp `-oo` option)
config = dict(
GDAL_NUM_THREADS="ALL_CPUS",
GDAL_TIFF_INTERNAL_MASK=True,
GDAL_TIFF_OVR_BLOCKSIZE="128",
)

cog_translate(
src_path,
dst_path,
output_profile,
config=config,
in_memory=False,
quiet=True,
**options,
)
return True
```
ref: https://github.com/developmentseed/cogeo-watchbot/blob/81df27470dd2eb7032d512c35af853b006d1c035/app/translator.py#L34-L56

## Web-Optimized COG

rio-cogeo provide a *--web-optimized* option which aims to create a web-tiling friendly COG.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

setup(
name="rio-cogeo",
version="1.1.3",
version="1.1.4",
description=u"CloudOptimized GeoTIFF (COGEO) creation plugin for rasterio",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 92bba3a

Please sign in to comment.