mercantile.bounds for cog
giswqs opened this issue · 2 comments
giswqs commented
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.
vincentsarago commented
👋 @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)
giswqs commented
It works. Many thanks!