[GIS] image.getDownloadURL download pixel grid dimension limit

google-earth-enginegoogle-earth-engine-javascript-api

I am trying to use image.getDownloadURL(downloadParam) to get the download link of an area of interest, it works fine with small areas, but when I pick a larger area, I will encounter an error like this: Pixel grid dimensions (48569×17664) must be less than or equal to 10000.

If the 10000 pixel dimension limit is set by GEE on the server side, is there any way to increase this limit?

I am aware of the Export.image.toDrive function, to which you can set the maxPixels, I am using image.getDownloadURL(downloadParam) because I am building an EE app that allows users download raster data for a large area.

My code example is here: https://code.earthengine.google.com/84de75665f99d0cb78136bfe8045bfd2

//import SRTM data
var image = ee.Image("USGS/SRTMGL1_003");

//Define small and large AOI
var Small_AOI = 
    ee.Geometry.Polygon(
        [[[-83.36097825867773, 36.44238302457335],
          [-83.36097825867773, 36.17346476392684],
          [-82.68806566102148, 36.17346476392684],
          [-82.68806566102148, 36.44238302457335]]], null, false);

var Large_AOI = 
    ee.Geometry.Polygon(
        [[[-85.40031541688086, 37.58251126010928],
          [-85.40031541688086, 33.88278318496734],
          [-79.02824510438086, 33.88278318496734],
          [-79.02824510438086, 37.58251126010928]]], null, false);
//print(Map.getBounds())
Map.centerObject(Small_AOI)
Map.addLayer(Small_AOI)

//get download link for Small_AOI and Large_AOI
var url_small = image.getDownloadURL({
  image: image,
  //crs: ee.String(crs_textbox.getValue()),
  scale: image.projection().nominalScale(),
  region: Small_AOI,
  //maxPixels: 2e10,
})
print(url_small)

var url_large = image.getDownloadURL({
  image: image,
  //crs: ee.String(crs_textbox.getValue()),
  scale: image.projection().nominalScale(),
  region: Large_AOI,
  //maxPixels: 2e10,
})
print(url_large)

Best Answer

getDownloadURL() is a client-side function that is intended for quick, interactive download of a sample region. Say for instance your app includes a very complex algorithm applied to high resolution data and a user requests a global download - this task would not be able to run interactively in the browser, which is why the limitation is in place.

A data service app is best build using a custom app, where a user can log into their Earth Engine account and export data as an asset to their own account or Google Cloud Storage.

Related Question