Export.table.toDrive

Drive में, FeatureCollection को टेबल के तौर पर एक्सपोर्ट करने के लिए, बैच टास्क बनाता है. टास्क टैब से टास्क शुरू किए जा सकते हैं.

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