0

I want to export an image in Google Earth Engine and I want the pixel size to match some in-situ plots with dimensions 2mx30m. How can I set the scale parameter to match this diamesions?

What I currently have (for pixel size 30mx30m):

var myimage= sat_image.reduceRegions(my_points, ee.Reducer.first(),30)
  print(myimage)
  
  
Export.table.toDrive(myimage,
"pts30",
"insitu_points")
geo_dd
  • 283
  • 1
  • 5
  • 22

1 Answers1

0

Instead of specifying the scale parameter, specify a crsTransform parameter. It is a “a row-major ordering of the 3x2 transform matrix”, as the documentation puts it, which means that you should specify a list of numbers like

crsTransform=[xScaling, 0, 0, 0, yScaling, 0]

Note that these numbers are not the same as the scale parameter. The scale parameter specifies meters of nominal scale per pixel. These number specify distance in the projection's coordinate system per pixel. For example, if the projection's numerical units are degrees, then the crsTransform factors are degrees per pixel. Thus, it is usually a good idea to specify a crs together with crsTransform so that you know what projection you're measuring with.

Also, this may not be the best option for such very non-square pixels. Consider, instead of using reduceRegions on points, converting your points to rectangle features and then using reduceRegion with a mean reducer. This will have a similar effect, but lets you choose the exact shape you want to sample with.

I'm not sure how well either option will work or whether there are further issues to deal with — I haven't done anything like this myself. But I looked around and there is very little discussion crsTransform at all, so I figured it was worth writing up.

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108