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

mercantile.bounds for cog #227

Closed
giswqs opened this issue Feb 22, 2022 · 2 comments
Closed

mercantile.bounds for cog #227

giswqs opened this issue Feb 22, 2022 · 2 comments

Comments

@giswqs
Copy link

giswqs commented Feb 22, 2022

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

@vincentsarago
Copy link
Member

👋 @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
Copy link
Author

giswqs commented Feb 22, 2022

It works. Many thanks!

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

No branches or pull requests

2 participants