Rio-cogeo

Latest version: v5.3.0

Safety actively analyzes 630305 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 12

2.2.1

* replace missing rio-tiler dependencies with a custom BBox type definition (https://github.com/cogeotiff/rio-cogeo/pull/198)

2.2.0

* add pydantic models for `info` output (https://github.com/cogeotiff/rio-cogeo/issues/191)
* add `use_cog_driver` option to create COG using new GDAL COG Driver (https://github.com/cogeotiff/rio-cogeo/pull/194)

**Breaking Changes:**

* `rio_cogeo.cogeo.cog_info` now returns a pydantic model

python
from rio_cogeo.cogeo import cog_info

before
info = cog_info("my.tif")
assert isinstance(info, dict)
assert info["GEO"]["CRS"]

now
assert isinstance(info, rio_cogeo.models.Info)
assert info.GEO.CRS


* add `TILING SCHEME` in dataset namespaced metadata when creating WebOptimized COG (https://github.com/cogeotiff/rio-cogeo/pull/193)
* add more info in rio cogeo info `Tags` (https://github.com/cogeotiff/rio-cogeo/pull/193)

python
before
$ rio cogeo create in.tif out.tif -w
$ rio cogeo info out.tif | jq .Tags

>>> {
"AREA_OR_POINT": "Area",
"OVR_RESAMPLING_ALG": "NEAREST"
}

now
$ rio cogeo create in.tif out.tif -w
$ rio cogeo info out.tif | jq .Tags
>> {
"Image Metadata": {
"AREA_OR_POINT": "Area",
"DataType": "Generic",
"OVR_RESAMPLING_ALG": "NEAREST"
},
"Image Structure": {
"COMPRESSION": "DEFLATE",
"INTERLEAVE": "BAND",
"LAYOUT": "COG"
},
"Tiling Scheme": {
"NAME": "WEBMERCATORQUAD",
"ZOOM_LEVEL": "17"
}
}


* update `Web-Optimized` configuration to match GDAL COG Driver (https://github.com/cogeotiff/rio-cogeo/pull/193)

By default only the `raw` data will be aligned to the grid. To align overviews, the `aligned_levels` option can be used (wasn't really working in previous version).

* `rio_cogeo.utils.get_web_optimized_params` has been refactored (https://github.com/cogeotiff/rio-cogeo/pull/193)

* `cog_translate` will now materialize **Nodata or Alpha band** to an internal **mask** automatically for JPEG compresssed output (https://github.com/cogeotiff/rio-cogeo/pull/196)

python
before
cog_translate(raster_path_rgba, "cogeo.tif", jpeg_profile)
with rasterio.open("cogeo.tif") as src:
assert src.count == 4
assert src.compression.value == "JPEG"
assert has_alpha_band(src)
assert not has_mask_band(src)

now
cog_translate(raster_path_rgba, "cogeo.tif", jpeg_profile)
with rasterio.open("cogeo.tif") as src:
assert src.count == 3
assert src.compression.value == "JPEG"
assert has_mask_band(src)

2.1.4

* fix issue in validation when BLOCK_OFFSET_0 is None (https://github.com/cogeotiff/rio-cogeo/issues/182)

2.1.3

* add **colormap** options in `cog_translate` to allow a user to set or update a colormap

python
cmap = {0: (0, 0, 0, 0), 1: (1, 2, 3, 255)}
cog_translate("boring.tif", "cogeo.tif", deflate_profile, colormap=cmap)
with rasterio.open("cogeo.tif") as cog:
print(cog.colormap(1)[1])

>>> (1, 2, 3, 255)


* add **additional_cog_metadata** options in `cog_translate` to allow the user to add more dataset metadatas

python
cog_translate("boring.tif", "cogeo.tif", deflate_profile, additional_cog_metadata={"comments": "I made this tiff with rio-cogeo"})

with rasterio.open("cogeo.tif") as cog:
print(cog.tags()["comment"])

>>> "I made this tiff with rio-cogeo"

2.1.2

* remove useless path translation to pathlib and avoid side effect when using a URL (https://github.com/cogeotiff/rio-cogeo/issues/178)

2.1.1

* drop support for Python 3.5 (https://github.com/cogeotiff/rio-cogeo/issues/173)
* allow pathlib.PurePath object as input and output (https://github.com/cogeotiff/rio-cogeo/issues/173)
* add top-level exports (https://github.com/cogeotiff/rio-cogeo/issues/169)

python
before
from rio_cogeo.cogeo import cog_translate, cog_validate, cog_info
from rio_cogeo.profiles import cog_profiles

now
from rio_cogeo import cog_translate, cog_validate, cog_info, cog_profiles

Page 5 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.