टेबल और वेक्टर डेटा एक्सपोर्ट करना

Export.table का इस्तेमाल करके, FeatureCollection को CSV, SHP (शेपफ़ाइल), GeoJSON, KML, KMZ या TFRecord के तौर पर एक्सपोर्ट किया जा सकता है. FeatureCollection, वैक्टर या सिर्फ़ डेटा की टेबल दिखा सकता है. बाद वाले मामले में, कलेक्शन में मौजूद सुविधाओं की ज्यामिति शून्य होगी.

कुछ फ़ाइल फ़ॉर्मैट के साथ काम करते समय, इन अतिरिक्त सीमाओं का ध्यान रखें:

  • 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 टेबल एसेट के साइज़ और आकार पर कई सीमाएं हैं:

  • ज़्यादा से ज़्यादा 10 करोड़ सुविधाएं
  • ज़्यादा से ज़्यादा 1,000 प्रॉपर्टी (कॉलम)
  • हर पंक्ति की ज्यामिति के लिए, ज़्यादा से ज़्यादा 1,00,000 वर्टिसेस
  • हर स्ट्रिंग वैल्यू में ज़्यादा से ज़्यादा 1,00,000 वर्ण

को BigQuery में

FeatureCollection को BigQuery टेबल में एक्सपोर्ट करने के लिए, Export.table.toBigQuery() का इस्तेमाल करें. इससे, 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 में

अपने Drive खाते में FeatureCollection एक्सपोर्ट करने के लिए, 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 फ़ॉर्मैट में, वैल्यू के तौर पर 'शून्य' वाली ज्यामिति वाली सुविधाओं को एक्सपोर्ट करें. यहां, लंबे समय तक चलने वाले ट्रैफ़िक में कमी के नतीजे पाने के लिए, 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' पर सेट है, क्योंकि आउटपुट में कोई ज्यामिति नहीं है.