공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ee.data.getDownloadId
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
다운로드 ID를 가져옵니다.
다운로드 ID와 토큰을 반환하거나 콜백이 지정된 경우 null을 반환합니다.
사용 | 반환 값 |
---|
ee.data.getDownloadId(params, callback) | DownloadId |
인수 | 유형 | 세부정보 |
---|
params | 객체 | 다음과 같은 가능한 값을 갖는 다운로드 옵션을 포함하는 객체입니다.
name: 파일 이름을 구성할 때 사용할 기본 이름입니다. 형식이 'ZIPPED_GEO_TIFF'(기본값), 'ZIPPED_GEO_TIFF_PER_BAND'이거나 filePerBand가 true인 경우에만 적용됩니다. 형식이 'ZIPPED_GEO_TIFF', 'ZIPPED_GEO_TIFF_PER_BAND'이거나 filePerBand가 true인 경우 기본값은 이미지 ID (또는 계산된 이미지의 경우 'download')입니다. 그렇지 않으면 임의의 문자열이 생성됩니다. filePerBand가 true인 경우 밴드 이름이 추가됩니다. |
bands: 다운로드할 밴드에 대한 설명입니다. 밴드 이름 배열 또는 각 항목에 다음 키가 있는 사전 배열이어야 합니다 (선택적 매개변수는 filePerBand가 true인 경우에만 적용됨).
id: 밴드 이름입니다(문자열, 필수).
crs: 밴드 투영을 정의하는 선택적 CRS 문자열입니다.
crs_transform: 지정된 CRS에서 아핀 변환을 지정하는 6개 숫자의 선택적 배열(행 우선 순서): [xScale, xShearing, xTranslation, yShearing, yScale, yTranslation]
dimensions: 밴드가 잘리는 너비와 높이를 정의하는 두 정수의 선택적 배열입니다.
scale: 선택적 숫자로서, 밴드의 스케일을 미터 단위로 지정합니다. crs 및 crs_transform이 지정된 경우 무시됩니다. |
명시적으로 지정하지 않은 모든 밴드에 사용할 기본 CRS 문자열 crs: |
crs_transform: 밴드의 crs_transform 과 동일한 형식으로, 지정되지 않은 밴드에 사용할 기본 아핀 변환입니다. |
지정되지 않은 밴드에 사용할 dimensions: 기본 이미지 자르기 치수입니다. |
scale: 스케일을 지정하지 않은 밴드에 사용할 기본 스케일입니다. crs 및 crs_transform 가 지정된 경우 무시됩니다. |
region: 다운로드할 지역을 지정하는 다각형입니다. crs 및 crs_transform 가 지정된 경우 무시됩니다. |
filePerBand: 대역별로 별도의 GeoTIFF를 생성할지 여부 (불리언) 기본값은 true입니다. false인 경우 단일 GeoTIFF가 생성되고 모든 밴드 수준 변환이 무시됩니다. 형식이 'ZIPPED_GEO_TIFF' 또는 'ZIPPED_GEO_TIFF_PER_BAND'인 경우 이 값은 무시됩니다. |
format: 다운로드 형식 다음 중 하나:
- 'ZIPPED_GEO_TIFF' (GeoTIFF 파일이 zip 파일로 래핑됨, 기본값)
- 'ZIPPED_GEO_TIFF_PER_BAND' (ZIP 파일로 래핑된 여러 GeoTIFF 파일)
- 'NPY' (NumPy 바이너리 형식)
'GEO_TIFF' 또는 'NPY'인 경우 filePerBand 및 모든 밴드 수준 변환이 무시됩니다. NumPy 출력을 로드하면 구조화된 배열이 생성됩니다. |
id: 지원 중단됨, image 매개변수를 사용하세요. |
|
callback | 함수(선택사항) | 선택적 콜백입니다. 제공되지 않으면 호출이 동기적으로 이루어집니다. |
예
코드 편집기 (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));
var downloadId = ee.data.getDownloadId({
image: img,
name: 'multi_band',
bands: ['B3', 'B8', 'B11'],
region: region,
scale: 20,
filePerBand: false
});
print('Multi-band GeoTIFF file wrapped in a zip file',
ee.data.makeDownloadUrl(downloadId));
var downloadId = ee.data.getDownloadId({
image: img,
name: 'custom_single_band',
bands: [
{id: 'B3', scale: 10},
{id: 'B8', scale: 10},
{id: 'B11', scale: 20}
],
region: region
});
print('Band-specific transformations',
ee.data.makeDownloadUrl(downloadId));
var downloadId = ee.data.getDownloadId({
image: img,
bands: ['B3', 'B8', 'B11'],
region: region,
scale: 20,
format: 'GEO_TIFF'
});
print('Multi-band GeoTIFF file',
ee.data.makeDownloadUrl(downloadId));
Python 설정
Python API 및 geemap
를 사용한 대화형 개발에 관한 자세한 내용은
Python 환경 페이지를 참고하세요.
import ee
import geemap.core as geemap
Colab (Python)
"""Demonstrates the ee.data.getDownloadId 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)
# Multi-band GeoTIFF file wrapped in a zip file.
download_id = ee.data.getDownloadId({
'image': img,
'name': 'multi_band',
'bands': ['B3', 'B8', 'B11'],
'region': region,
'scale': 20,
'filePerBand': False
})
response = requests.get(ee.data.makeDownloadUrl(download_id))
with open('multi_band.zip', 'wb') as fd:
fd.write(response.content)
# Band-specific transformations.
download_id = ee.data.getDownloadId({
'image': img,
'name': 'custom_single_band',
'bands': [
{'id': 'B3', 'scale': 10},
{'id': 'B8', 'scale': 10},
{'id': 'B11', 'scale': 20}
],
'region': region
})
response = requests.get(ee.data.makeDownloadUrl(download_id))
with open('custom_single_band.zip', 'wb') as fd:
fd.write(response.content)
# Multi-band GeoTIFF file.
download_id = ee.data.getDownloadId({
'image': img,
'bands': ['B3', 'B8', 'B11'],
'region': region,
'scale': 20,
'format': 'GEO_TIFF'
})
response = requests.get(ee.data.makeDownloadUrl(download_id))
with open('multi_band.tif', 'wb') as fd:
fd.write(response.content)
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003e\u003ccode\u003eee.data.getDownloadId\u003c/code\u003e generates a unique ID and token for downloading Earth Engine data, essential for initiating downloads.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts parameters like image, bands, region, and format to customize the download request to user specifications.\u003c/p\u003e\n"],["\u003cp\u003eUsers can specify download formats including zipped GeoTIFFs (single or multi-band), NumPy arrays, and uncompressed GeoTIFFs.\u003c/p\u003e\n"],["\u003cp\u003eThe function provides flexibility by allowing band-specific transformations such as scale and projection settings for individual bands.\u003c/p\u003e\n"],["\u003cp\u003eDownload links are created using the generated download ID with \u003ccode\u003eee.data.makeDownloadUrl\u003c/code\u003e for accessing the requested data.\u003c/p\u003e\n"]]],["The `ee.data.getDownloadId` function generates a download ID and token for Earth Engine data. Key actions include specifying download parameters like image, bands, region, scale, and format in a `params` object. This can include band-specific transformations. The function returns a `DownloadId`, or null if a callback is specified, allowing for synchronous or asynchronous calls. The output can be configured to be a single or multiple GeoTIFF files wrapped in a zip or in NPY format.\n"],null,[]]