Export.table.toDrive

यह फ़ंक्शन, Drive में FeatureCollection को टेबल के तौर पर एक्सपोर्ट करने के लिए, बैच टास्क बनाता है. 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, optionalएक्सपोर्ट में शामिल की जाने वाली प्रॉपर्टी की सूची. यह कॉमा लगाकर अलग किए गए नामों वाली एक स्ट्रिंग या स्ट्रिंग की सूची हो सकती है.
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()