0

I want to learn count of pixels in my rectangle bound. For example; I should see MxN size of bound. my codes is : https://code.earthengine.google.com/11cafc2e8de63293000ee2a3c2036ae4

CHH
  • 5
  • 2
  • I think It is not possible to calculate the pixels here, because it is geometry, not a raster image. The rectangle bound may be calculated for a raster depending upon the pixel size of the raster. So in this case you may calculate the area covered by geometry instead of pixel as https://code.earthengine.google.com/60108742e524bd175eb6ec7178381773 – Abhilash Singh Chauhan Jan 14 '22 at 17:15
  • Thank you,I cliped any image by my bound and I could get size of geometry or image – CHH Jan 18 '22 at 06:34
  • That’s what I was saying, pixel size is attribute of raster, can’t be performed over geometry/vectors/shapefiles. @CHH – Abhilash Singh Chauhan Jan 18 '22 at 06:35
  • yeah you are right. So, How can I apply the image.shape code to the image? When I applied somethings I found (4,16).But this is not make sense – CHH Jan 18 '22 at 07:42
  • I have to see that, can you share the URL to the code? – Abhilash Singh Chauhan Jan 18 '22 at 15:34
  • yeah,Here is my codes: band_arrs = MclassA2.sampleRectangle(Bound) band_arr_b4 = band_arrs.get('MNDWI') np_arr_b4 = np.array(band_arr_b4.getInfo()) print(np_arr_b4.shape) .........................and result is (4,16) – CHH Jan 18 '22 at 19:33
  • It would be more understandable if you add the link/URL, like you have added in your question. – Abhilash Singh Chauhan Jan 18 '22 at 19:36
  • I am working in Colab. So I do not know how to share any url – CHH Jan 18 '22 at 19:41
  • Ohh okay, I don’t know much of python API of GEE though, I’ll try if I found any solution – Abhilash Singh Chauhan Jan 18 '22 at 19:44

0 Answers0