0

I'm creating and saving the NDVI output of MOD13Q1 of a given district to Google Drive from Google Earth Engine.

If I use the following code, the output tiff gets generated, but it is shifted about 14 KM to the north.

(The shift is not present in the Image shown on the map, but only in the Tiff file that is created)

var modis=ee.Image('MODIS/006/MOD13Q1/2018_09_30')
  .select(['NDVI', 'sur_refl_b03']);                     

var vi = modis.expression(
    '(BL >1500)?0:((A==-3000)?0:(A*0.0001))', {
      'A': modis.select('NDVI'),
      'BL':modis.select('sur_refl_b03')
});   

var geometry = ee.Geometry.Rectangle([79.5, 20.4, 81.8, 21.7]);   

Map.setCenter(80,20.5, 8);    
Map.addLayer(vi, {min: -1, max: 1, palette: [
    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'
  ]});   

Export.image.toDrive({
  image: vi,
  description: 'Gondiya_NDVI_30Sept',
  scale: 250,
  region: geometry,
  fileFormat: 'GeoTIFF',
  formatOptions: {
    cloudOptimized: true
  },
  maxPixels: 1e12
});

What is causing this shift? How do I correct this?

2

This could be a GEE bug exporting to MODIS sinusoidal projection, I'm not sure. but, a fast workaround is to export to a different CRS:

Export.image.toDrive({
  image: vi,
  description: 'Gondiya_NDVI_30Sept',
  scale: 250,
  crs: 'EPSG:4326',
  region: geometry,
  fileFormat: 'GeoTIFF',
  formatOptions: {
    cloudOptimized: true
  },
  maxPixels: 1e12
});

Obviously, you can select a better CRS than WGS84 long/lat regarding your needs.

With original code: enter image description here

With a CRS specification: enter image description here

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.