Tablo ve vektör verilerini dışa aktarma

Export.table kullanarak bir FeatureCollection öğesini CSV, SHP (shapefile), GeoJSON, KML, KMZ veya TFRecord olarak dışa aktarabilirsiniz. FeatureCollection, vektörleri veya yalnızca bir veri tablosunu temsil edebilir. İkinci durumda, koleksiyondaki özelliklerin geometrisi boş olur.

Bazı dosya biçimleriyle çalışırken aşağıdaki gibi bazı ek kısıtlamalar geçerli olabilir:

  • KML: KML dosyasına aktarılan bir FeatureCollection, tüm geometrileri yansıtılmamış (WGS84) koordinatlara dönüştürülmüş olarak içerir.
  • SHP: Shapefile dosyasına aktarılan bir FeatureCollection, aynı geometri türüne ve projeksiyona sahip özellikler içermeli ve Shapefile boyut sınırlarına uymalıdır. Sütun adları 10 veya daha az karakter olacak şekilde kısaltılır ve bu işlem, yinelenen sütun adları oluşturmamalıdır.
  • TFRecord: TFRecord veri biçimi sayfasını inceleyin.

Cloud Storage'a aktarma

Bir FeatureCollection öğesini Cloud Storage'a aktarmak için Export.table.toCloudStorage() kullanın. Örneğin, daha önce tanımlanan features kullanıldığında:

Kod Düzenleyici (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 kurulumu

Python API ve etkileşimli geliştirme için geemap kullanımı hakkında bilgi edinmek üzere Python Ortamı sayfasını inceleyin.

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()

öğesine

FeatureCollection öğesini Earth Engine öğesi olarak dışa aktarmak için Export.table.toAsset() kullanın. Örneğin, daha önce tanımlanan features kullanıldığında:

Kod Düzenleyici (JavaScript)

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

Python kurulumu

Python API ve etkileşimli geliştirme için geemap kullanımı hakkında bilgi edinmek üzere Python Ortamı sayfasını inceleyin.

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 tablo öğelerinin boyutu ve şekliyle ilgili çeşitli sınırlamalar vardır:

  • Maksimum 100 milyon özellik
  • Maksimum 1.000 özellik (sütun)
  • Her satırın geometrisi için maksimum 100.000 köşe
  • Dize değeri başına en fazla 100.000 karakter

BigQuery'ye aktarma

Export.table.toBigQuery() kullanarak FeatureCollection öğesini bir BigQuery tablosuna aktarabilirsiniz. Bu sayede Earth Engine verilerinizi BigQuery'deki diğer veriler ve araçlarla entegre edebilirsiniz. Daha fazla bilgi için BigQuery'ye aktarma kılavuzunu inceleyin.

Kod Düzenleyici (JavaScript)

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

Python kurulumu

Python API ve etkileşimli geliştirme için geemap kullanımı hakkında bilgi edinmek üzere Python Ortamı sayfasını inceleyin.

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'a

FeatureCollection öğesini Drive hesabınıza aktarmak için Export.table.toDrive() kullanın. Örneğin:

Kod Düzenleyici (JavaScript)

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

Python kurulumu

Python API ve etkileşimli geliştirme için geemap kullanımı hakkında bilgi edinmek üzere Python Ortamı sayfasını inceleyin.

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()

Coğrafi verileri işlemek için çıkış biçiminin KML olarak belirtildiğini unutmayın (SHP de geometri içeren bir tabloyu dışa aktarmak için uygun olur). Coğrafi bilgi içermeyen bir veri tablosunu dışa aktarmak için boş geometriye sahip özellikleri CSV biçiminde dışa aktarın. Aşağıda, uzun sürebilecek bir azaltma işleminin sonuçlarını almak için Export.table.toDrive() kullanımı gösterilmektedir:

Kod Düzenleyici (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 kurulumu

Python API ve etkileşimli geliştirme için geemap kullanımı hakkında bilgi edinmek üzere Python Ortamı sayfasını inceleyin.

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()

Çıkışta geometri olmadığı için bu örnekte biçimin "CSV" olarak ayarlandığını unutmayın.