ee.data.makeDownloadUrl
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Erstellt eine Download-URL aus einer Dokument-ID und einem Token.
Gibt die Download-URL zurück.
Nutzung | Ausgabe |
---|
ee.data.makeDownloadUrl(id) | String |
Argument | Typ | Details |
---|
id | DownloadId | Eine Download-ID und ein Token. |
Beispiele
Code-Editor (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));
Python einrichten
Informationen zur Python API und zur Verwendung von geemap
für die interaktive Entwicklung finden Sie auf der Seite
Python-Umgebung.
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)
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 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```"]]