I'm new to Google Earth Engine analysis so I can't solve a simple task with the python API.
What I want to do is to clip an image with a specified boundary that corresponds to a reference image then export it to my google drive. When I execute the code, the image is exported, and its appearance is not bad. However, the upper boundary of it is different which I have specified. I've been looking and testing for a solution to this problem for a quite long time, but still, I can't find a good solution for it. The code and the information regarding my problems are attached below. The coordinates of the boundary are acquired by using
rasterio.bounds. The target ROI is the coordinates of the reference image.
Please help me!
Product: MODIS MOD14A1
Target ROI: left=97.99955519999997, bottom=50.000064, right=117.99952319999997, top=58.0000512
The boundary of the output file: left=97.9972143445986, bottom=49.991245561251375, right=118.00269572194034, top=58.399476620610095
#The band that I want to use band=['MaxFRP'] #Set a region of interest ROI=ee.Geometry.Rectangle(coords=[97.99955519999997,50.000064,117.99952319999997,58.0000512]) #Get a collection of images output=ee.ImageCollection("MODIS/006/MOD14A1").filterDate('2001-04-01','2001-04-05').select(band) #Extract the first image of the image collection output_first=output.toList(output.size().getInfo()).get(0) #Clip the image by ROI output_first_image_clipped=ee.Image(output_first).clip(ROI) #Export the image to google drive task=ee.batch.Export.image.toDrive( description='testImage', image=output_first_image_clipped, scale=1000, crs='EPSG:4326' ) task.start()
I also attached the reference image over the output image from the GEE. The black area shows the unwanted area due to the wrong top-line coordinate.