Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cogify #217

Closed
wants to merge 3 commits into from
Closed

Remove cogify #217

wants to merge 3 commits into from

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Jan 13, 2022

Related Issue(s): #216

Description: As @geospatial-jeff mentioned in #216 (comment), our cogify function is a poor re-implementation of rio-cogeo. Since we aren't adding any value in stactools, this PR just removes our cogify function. Downstream libraries that were using cogify should switch to using rio-cogeo.

This is obviously a breaking change, so should be part of a minor release.

PR checklist:

  • Code is formatted (run scripts/format).
  • Code lints properly (run scripts/lint).
  • Tests pass (run scripts/test).
  • Changes are added to the CHANGELOG.

@gadomski gadomski added this to the v0.3.0 milestone Jan 13, 2022
@vincentsarago
Copy link
Member

you could also use pure rasterio

import rasterio
from rasterio.shutil import copy
    with rasterio.open("non_cog.tif") as src_dst:
        profile = src_dst.meta.copy()
        
        # update profile (block size, compression,...)
        profile["driver"] = "COG"
        profile["blocksize"] = 512. # example
        profile("blockxsize", None)
        profile("blockysize", None)
        
        copy(src_dst, "cog.tif", **profile)

ref: https://github.com/cogeotiff/rio-cogeo/blob/master/rio_cogeo/cogeo.py#L352-L379

using rio-cogeo would still be valuable if you support rasterio version build with GDAL <3.1

@gadomski gadomski mentioned this pull request Jan 19, 2022
5 tasks
@gadomski gadomski deleted the remove-cogify branch February 14, 2022 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants