Export.table.toDrive

FeatureCollection을 테이블로 Drive에 내보내는 일괄 작업을 만듭니다. Tasks 탭에서 작업을 시작할 수 있습니다.

사용반환 값
Export.table.toDrive(collection, description, folder, fileNamePrefix, fileFormat, selectors, maxVertices, priority)
인수유형세부정보
collectionFeatureCollection내보낼 지형지물 컬렉션입니다.
description문자열, 선택사항사람이 읽을 수 있는 작업 이름입니다. 문자, 숫자, -, _를 포함할 수 있습니다(공백 없음). 기본값은 'myExportTableTask'입니다.
folder문자열, 선택사항내보내기가 저장될 Google Drive 폴더입니다. 참고: (a) 폴더 이름이 어느 수준에든 있으면 출력이 해당 폴더에 작성됩니다. (b) 중복된 폴더 이름이 있으면 가장 최근에 수정된 폴더에 출력이 작성됩니다. (c) 폴더 이름이 없으면 루트에 새 폴더가 생성됩니다. (d) 구분자가 있는 폴더 이름 (예: 'path/to/file')은 시스템 경로가 아닌 리터럴 문자열로 해석됩니다. 기본값은 Drive 루트입니다.
fileNamePrefix문자열, 선택사항파일 이름 접두사입니다. 문자, 숫자, -, _를 포함할 수 있습니다(공백 없음). 기본값은 설명입니다.
fileFormat문자열, 선택사항출력 형식: 'CSV' (기본값), 'GeoJSON', 'KML', 'KMZ', 'SHP' 또는 'TFRecord'
selectorsList<String>|String(선택사항)내보내기에 포함할 속성 목록입니다. 쉼표로 구분된 이름이 있는 단일 문자열 또는 문자열 목록입니다.
maxVertices숫자, 선택사항기하 도형당 잘리지 않은 최대 꼭짓점 수입니다. 꼭짓점이 이 수보다 많은 기하 도형은 이 크기보다 작은 조각으로 잘립니다.
priority숫자, 선택사항프로젝트 내 작업의 우선순위입니다. 우선순위가 높은 작업은 더 빨리 예약됩니다. 0에서 9999 사이의 정수여야 합니다. 기본값은 100입니다.

코드 편집기 (JavaScript)

// A Sentinel-2 surface reflectance image.
var img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');
Map.setCenter(-122.359, 37.428, 9);
Map.addLayer(img, {bands: ['B11', 'B8', 'B3'], min: 100, max: 3500}, 'img');

// Sample the image at 20 m scale, a point feature collection is returned.
var samp = img.sample({scale: 20, numPixels: 50, geometries: true});
Map.addLayer(samp, {color: 'white'}, 'samp');
print('Image sample feature collection', samp);

// Export the image sample feature collection to Drive as a CSV file.
Export.table.toDrive({
  collection: samp,
  description: 'image_sample_demo_csv',
  folder: 'earth_engine_demos',
  fileFormat: 'CSV'
});

// Export a subset of collection properties: three bands and the geometry
// as GeoJSON.
Export.table.toDrive({
  collection: samp,
  description: 'image_sample_demo_prop_subset',
  folder: 'earth_engine_demos',
  fileFormat: 'GeoJSON',
  selectors: ['B8', 'B11', 'B12', '.geo']
});

// Export the image sample feature collection to Drive as a shapefile.
Export.table.toDrive({
  collection: samp,
  description: 'image_sample_demo_shp',
  folder: 'earth_engine_demos',
  fileFormat: 'SHP'
});

Python 설정

Python API 및 geemap를 사용한 대화형 개발에 관한 자세한 내용은 Python 환경 페이지를 참고하세요.

import ee
import geemap.core as geemap

Colab (Python)

# A Sentinel-2 surface reflectance image.
img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')
m = geemap.Map()
m.set_center(-122.359, 37.428, 9)
m.add_layer(
    img, {'bands': ['B11', 'B8', 'B3'], 'min': 100, 'max': 3500}, 'img'
)

# Sample the image at 20 m scale, a point feature collection is returned.
samp = img.sample(scale=20, numPixels=50, geometries=True)
m.add_layer(samp, {'color': 'white'}, 'samp')
display(m)
display('Image sample feature collection', samp)

# Export the image sample feature collection to Drive as a CSV file.
task = ee.batch.Export.table.toDrive(
    collection=samp,
    description='image_sample_demo_csv',
    folder='earth_engine_demos',
    fileFormat='CSV',
)
task.start()

# Export a subset of collection properties: three bands and the geometry
# as GeoJSON.
task = ee.batch.Export.table.toDrive(
    collection=samp,
    description='image_sample_demo_prop_subset',
    folder='earth_engine_demos',
    fileFormat='GeoJSON',
    selectors=['B8', 'B11', 'B12', '.geo'],
)
task.start()

# Export the image sample feature collection to Drive as a shapefile.
task = ee.batch.Export.table.toDrive(
    collection=samp,
    description='image_sample_demo_shp',
    folder='earth_engine_demos',
    fileFormat='SHP',
)
task.start()