cogeotiff/rio-cogeo

mercantile.bounds for cog

giswqs opened this issue · 2 comments

I am trying to create a function for creating COG from numpy array. Note the image does not necessarily cover the entire globe. How can we specify mercantile.bounds based on the image extent (southwest, northeast)?

https://cogeotiff.github.io/rio-cogeo/API/#using-the-api-with-in-memoryfile

bounds = mercantile.bounds(mercantile.Tile(0,0,0))

Here is a sample cog with 206 rows and 343 columns.
image
image

👋 @giswqs

bounds is defined as (minx, miny, maxx, maxy) https://github.com/developmentseed/morecantile/blob/master/morecantile/commons.py#L6-L24

so from what you shared it will be (6.86, 53.39, 6.89, 53.416)

It works. Many thanks!