I want to know the shape, that is the height and width of an ee.Image, how can i get that?

I have been looking through the documentation to see if there is a function for that, but I could not find, I have tried to get the value of the edges of my geometry, which is a rectangle, and then calculate it's amplitude in x and y, but I get a very small result, which does not make sense.


An ee.Image does not necessarily have a height or width if it has been computed from multiple sources. However, if it is an image that has been persisted to an asset you can get that information from the band metadata. Bands within an image can different sizes and coordinate reference systems, so there is not necessarily one answer to what you are asking. To see the crs, resolution, and image sizes - print out the metadata of the image.

    function(img) {

Which yields an array of objects like this:


The dimensions are the x and y size in pixels, and the 0 and 4 index of the crs_transform are the x and y pixel resolutions, respectively.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.