테이블 및 벡터 데이터 내보내기

Export.table를 사용하여 FeatureCollection를 CSV, SHP (셰이프파일), GeoJSON, KML, KMZ 또는 TFRecord로 내보낼 수 있습니다. FeatureCollection는 벡터 또는 단순히 데이터 표를 나타낼 수 있습니다. 후자의 경우 컬렉션의 지형지물에 null 도형이 있습니다.

다음과 같은 일부 파일 형식을 사용할 때는 추가 제약조건에 유의하세요.

  • KML: KML 파일로 내보낸 FeatureCollection는 모든 도형이 프로젝션되지 않은 (WGS84) 좌표로 변환됩니다.
  • SHP: 셰이프파일로 내보낸 FeatureCollection에는 도형 유형과 투영이 동일한 지형지물이 포함되어야 하며 셰이프파일 크기 제한 내에 들어맞아야 합니다. 열 이름은 10자(영문 기준) 이하로 자르며 중복된 열 이름을 만들면 안 됩니다.
  • TFRecord: 이 페이지를 참고하세요.

Cloud Storage로

FeatureCollection를 Cloud Storage로 내보내려면 Export.table.toCloudStorage()를 사용합니다. 예를 들어 이전에 정의된 features를 사용합니다.

코드 편집기 (JavaScript)

// Make a collection of points.
var features = ee.FeatureCollection([
  ee.Feature(ee.Geometry.Point(30.41, 59.933), {name: 'Voronoi'}),
  ee.Feature(ee.Geometry.Point(-73.96, 40.781), {name: 'Thiessen'}),
  ee.Feature(ee.Geometry.Point(6.4806, 50.8012), {name: 'Dirichlet'})
]);

// Export a KML file to Cloud Storage.
Export.table.toCloudStorage({
  collection: features,
  description:'vectorsToCloudStorageExample',
  bucket: 'your-bucket-name',
  fileNamePrefix: 'exampleTableExport',
  fileFormat: 'KML'
});

Python 설정

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

import ee
import geemap.core as geemap

Colab (Python)

# Make a collection of points.
features = ee.FeatureCollection([
    ee.Feature(ee.Geometry.Point(30.41, 59.933), {'name': 'Voronoi'}),
    ee.Feature(ee.Geometry.Point(-73.96, 40.781), {'name': 'Thiessen'}),
    ee.Feature(ee.Geometry.Point(6.4806, 50.8012), {'name': 'Dirichlet'}),
])

# Export a KML file to Cloud Storage.
task = ee.batch.Export.table.toCloudStorage(
    collection=features,
    description='vectorsToCloudStorageExample',
    bucket='your-bucket-name',
    fileNamePrefix='exampleTableExport',
    fileFormat='KML',
)
task.start()

애셋

FeatureCollection를 Earth Engine 애셋으로 내보내려면 Export.table.toAsset()를 사용하세요. 예를 들어 이전에 정의된 features를 사용합니다.

코드 편집기 (JavaScript)

// Export an ee.FeatureCollection as an Earth Engine asset.
Export.table.toAsset({
  collection: features,
  description:'exportToTableAssetExample',
  assetId: 'exampleAssetId',
});

Python 설정

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

import ee
import geemap.core as geemap

Colab (Python)

# Export an ee.FeatureCollection as an Earth Engine asset.
task = ee.batch.Export.table.toAsset(
    collection=features,
    description='exportToTableAssetExample',
    assetId='projects/your-project/assets/exampleAssetId',
)
task.start()

Earth Engine 테이블 애셋의 크기와 도형에는 몇 가지 제한사항이 있습니다.

  • 최대 1억 개의 지형지물
  • 최대 1,000개의 속성 (열)
  • 각 행의 도형에 최대 100,000개의 정점
  • 문자열 값당 최대 100,000자(영문 기준)

BigQuery로

Export.table.toBigQuery()를 사용하여 FeatureCollection를 BigQuery 테이블로 내보낼 수 있습니다. 이렇게 하면 Earth Engine 데이터를 BigQuery에서 사용 가능한 다른 데이터 및 도구와 통합할 수 있습니다. 자세한 내용은 BigQuery로 내보내기 가이드를 참고하세요.

코드 편집기 (JavaScript)

Export.table.toBigQuery({
  collection: features,
  table: 'myproject.mydataset.mytable',
  description: 'put_my_data_in_bigquery',
  append: true,
  overwrite: false
});

Python 설정

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

import ee
import geemap.core as geemap

Colab (Python)

task = ee.batch.Export.table.toBigQuery(
    collection=features,
    table='myproject.mydataset.mytable',
    description='put_my_data_in_bigquery',
    append=True,
    overwrite=False,
)
task.start()

Drive로

FeatureCollection를 Drive 계정으로 내보내려면 Export.table.toDrive()를 사용하세요. 예를 들면 다음과 같습니다.

코드 편집기 (JavaScript)

// Export the FeatureCollection to a KML file.
Export.table.toDrive({
  collection: features,
  description:'vectorsToDriveExample',
  fileFormat: 'KML'
});

Python 설정

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

import ee
import geemap.core as geemap

Colab (Python)

# Export the FeatureCollection to a KML file.
task = ee.batch.Export.table.toDrive(
    collection=features, description='vectorsToDriveExample', fileFormat='KML'
)
task.start()

출력 형식은 지리 데이터를 처리하기 위해 KML로 지정됩니다 (도형이 있는 테이블을 내보내는 데 SHP도 적합함). 지리 정보 없이 데이터 표만 내보내려면 CSV 형식으로 null 도형이 있는 지형지물을 내보내세요. 다음은 Export.table.toDrive()를 사용하여 장기 실행 감소의 결과를 가져오는 방법을 보여줍니다.

코드 편집기 (JavaScript)

// Load a Landsat image.
var image = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318');
var projection = image.select('B2').projection().getInfo();

// Create an arbitrary rectangle.
var region = ee.Geometry.Rectangle(-122.2806, 37.1209, -122.0554, 37.2413);

// Get a dictionary of means in the region.
var means = image.reduceRegion({
  reducer: ee.Reducer.mean(),
  geometry: region,
  crs: projection.crs,
  crsTransform: projection.transform,
});

// Make a feature without geometry and set the properties to the dictionary of means.
var feature = ee.Feature(null, means);

// Wrap the Feature in a FeatureCollection for export.
var featureCollection = ee.FeatureCollection([feature]);

// Export the FeatureCollection.
Export.table.toDrive({
  collection: featureCollection,
  description: 'exportTableExample',
  fileFormat: 'CSV'
});

Python 설정

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

import ee
import geemap.core as geemap

Colab (Python)

# Load a Landsat image.
image = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318')
projection = image.select('B2').projection().getInfo()

# Create an arbitrary rectangle.
region = ee.Geometry.Rectangle(-122.2806, 37.1209, -122.0554, 37.2413)

# Get a dictionary of means in the region.
means = image.reduceRegion(
    reducer=ee.Reducer.mean(),
    geometry=region,
    crs=projection['crs'],
    crsTransform=projection['transform'],
)

# Make a feature without geometry and set the properties to the dictionary of means.
feature = ee.Feature(None, means)

# Wrap the Feature in a FeatureCollection for export.
feature_collection = ee.FeatureCollection([feature])

# Export the FeatureCollection.
task = ee.batch.Export.table.toDrive(
    collection=feature_collection,
    description='exportTableExample',
    fileFormat='CSV',
)
task.start()

이 예에서는 출력에 도형이 없으므로 형식이 'CSV'로 설정됩니다.