Annuncio: tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del
15 aprile 2025 devono
verificare l'idoneità non commerciale per mantenere l'accesso a Earth Engine.
ee.data.makeDownloadUrl
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Crea un URL di download da un docid e un token.
Restituisce l'URL di download.
Utilizzo | Resi |
---|
ee.data.makeDownloadUrl(id) | Stringa |
Argomento | Tipo | Dettagli |
---|
id | DownloadId | Un ID download e un token. |
Esempi
Editor di codice (JavaScript)
// A Sentinel-2 surface reflectance image.
var img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');
// A small region within the image.
var region = ee.Geometry.BBox(-122.0859, 37.0436, -122.0626, 37.0586);
var downloadId = ee.data.getDownloadId({
image: img,
name: 'single_band',
bands: ['B3', 'B8', 'B11'],
region: region
});
print('Single-band GeoTIFF files wrapped in a zip file',
ee.data.makeDownloadUrl(downloadId));
Configurazione di Python
Consulta la pagina
Ambiente Python per informazioni sull'API Python e sull'utilizzo di
geemap
per lo sviluppo interattivo.
import ee
import geemap.core as geemap
Colab (Python)
"""Demonstrates the ee.data.makeDownloadUrl method."""
import io
import requests
import ee
ee.Authenticate()
ee.Initialize()
# A Sentinel-2 surface reflectance image.
img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')
# A small region within the image.
region = ee.Geometry.BBox(-122.0859, 37.0436, -122.0626, 37.0586)
# Image chunk as a NumPy structured array.
import numpy
download_id = ee.data.getDownloadId({
'image': img,
'bands': ['B3', 'B8', 'B11'],
'region': region,
'scale': 20,
'format': 'NPY'
})
response = requests.get(ee.data.makeDownloadUrl(download_id))
data = numpy.load(io.BytesIO(response.content))
print(data)
print(data.dtype)
# Single-band GeoTIFF files wrapped in a zip file.
download_id = ee.data.getDownloadId({
'image': img,
'name': 'single_band',
'bands': ['B3', 'B8', 'B11'],
'region': region
})
response = requests.get(ee.data.makeDownloadUrl(download_id))
with open('single_band.zip', 'wb') as fd:
fd.write(response.content)
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eee.data.makeDownloadUrl\u003c/code\u003e creates a download URL for Earth Engine data using a download ID and token.\u003c/p\u003e\n"],["\u003cp\u003eThe download ID can be obtained with \u003ccode\u003eee.data.getDownloadId\u003c/code\u003e, specifying parameters such as the image, bands, region, and file format.\u003c/p\u003e\n"],["\u003cp\u003eThis function returns a string representing the URL from which the data can be downloaded.\u003c/p\u003e\n"],["\u003cp\u003eYou can use libraries like \u003ccode\u003erequests\u003c/code\u003e in Python to download the data from the generated URL.\u003c/p\u003e\n"]]],[],null,["# ee.data.makeDownloadUrl\n\n\u003cbr /\u003e\n\nCreate a download URL from a docid and token.\n\n\u003cbr /\u003e\n\nReturns the download URL.\n\n| Usage | Returns |\n|-------------------------------|---------|\n| `ee.data.makeDownloadUrl(id)` | String |\n\n| Argument | Type | Details |\n|----------|------------|--------------------------|\n| `id` | DownloadId | A download id and token. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// A Sentinel-2 surface reflectance image.\nvar img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');\n\n// A small region within the image.\nvar region = ee.Geometry.BBox(-122.0859, 37.0436, -122.0626, 37.0586);\n\nvar downloadId = ee.data.getDownloadId({\n image: img,\n name: 'single_band',\n bands: ['B3', 'B8', 'B11'],\n region: region\n});\nprint('Single-band GeoTIFF files wrapped in a zip file',\n ee.data.makeDownloadUrl(downloadId));\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n\"\"\"Demonstrates the ee.data.makeDownloadUrl method.\"\"\"\n\nimport io\nimport requests\nimport ee\n\n\nee.Authenticate()\nee.Initialize()\n\n# A Sentinel-2 surface reflectance image.\nimg = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')\n\n# A small region within the image.\nregion = ee.Geometry.BBox(-122.0859, 37.0436, -122.0626, 37.0586)\n\n# Image chunk as a NumPy structured array.\nimport numpy\ndownload_id = ee.data.getDownloadId({\n 'image': img,\n 'bands': ['B3', 'B8', 'B11'],\n 'region': region,\n 'scale': 20,\n 'format': 'NPY'\n})\nresponse = requests.get(ee.data.makeDownloadUrl(download_id))\ndata = numpy.load(io.BytesIO(response.content))\nprint(data)\nprint(data.dtype)\n\n# Single-band GeoTIFF files wrapped in a zip file.\ndownload_id = ee.data.getDownloadId({\n 'image': img,\n 'name': 'single_band',\n 'bands': ['B3', 'B8', 'B11'],\n 'region': region\n})\nresponse = requests.get(ee.data.makeDownloadUrl(download_id))\nwith open('single_band.zip', 'wb') as fd:\n fd.write(response.content)\n```"]]