Export.table.toDrive

Bir FeatureCollection'ı tablo olarak Drive'a aktarmak için toplu görev oluşturur. Görevler, Görevler sekmesinden başlatılabilir.

Kullanımİadeler
Export.table.toDrive(collection, description, folder, fileNamePrefix, fileFormat, selectors, maxVertices, priority)
Bağımsız DeğişkenTürAyrıntılar
collectionFeatureCollectionDışa aktarılacak özellik koleksiyonu.
descriptionDize, isteğe bağlıGörev için kullanıcılar tarafından okunabilir bir ad. Harf, rakam, -, _ (boşluk yok) içerebilir. Varsayılan olarak "myExportTableTask" kullanılır.
folderDize, isteğe bağlıDışa aktarılan dosyanın bulunacağı Google Drive klasörü. Not: (a) Klasör adı herhangi bir düzeyde varsa çıkış bu klasöre yazılır, (b) klasör adları yineleniyorsa çıkış en son değiştirilen klasöre yazılır, (c) klasör adı yoksa kökte yeni bir klasör oluşturulur ve (d) ayırıcı içeren klasör adları (ör. "path/to/file") sistem yolları olarak değil, değişmez dizeler olarak yorumlanır. Varsayılan olarak Drive kökü kullanılır.
fileNamePrefixDize, isteğe bağlıDosya adı ön eki. Harf, rakam, -, _ (boşluk yok) içerebilir. Varsayılan olarak açıklama kullanılır.
fileFormatDize, isteğe bağlıÇıkış biçimi: "CSV" (varsayılan), "GeoJSON", "KML", "KMZ", "SHP" veya "TFRecord".
selectorsList[String]|String, isteğe bağlıDışa aktarmaya dahil edilecek özelliklerin listesi; virgülle ayrılmış adlara sahip tek bir dize veya dizelerin listesi.
maxVerticesNumara, isteğe bağlıGeometri başına maksimum kesilmemiş köşe sayısı. Daha fazla köşe içeren geometriler, bu boyuttan daha küçük parçalara ayrılır.
priorityNumara, isteğe bağlıGörevlerin proje içindeki önceliği. Daha yüksek öncelikli görevler daha erken planlanır. 0 ile 9999 arasında bir tam sayı olmalıdır. Varsayılan olarak 100 değerine ayarlanır.

Örnekler

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

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

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