ee.FeatureCollection.copyProperties

यह एक एलिमेंट से दूसरे एलिमेंट में मेटाडेटा प्रॉपर्टी कॉपी करता है.

इस्तेमालरिटर्न
FeatureCollection.copyProperties(source, properties, exclude)एलिमेंट
आर्ग्यूमेंटटाइपविवरण
यह: destinationElement, डिफ़ॉल्ट: nullवह ऑब्जेक्ट जिसकी प्रॉपर्टी को बदलना है.
sourceElement, डिफ़ॉल्ट: nullवह ऑब्जेक्ट जिससे प्रॉपर्टी कॉपी करनी हैं.
propertiesसूची, डिफ़ॉल्ट: nullकॉपी की जाने वाली प्रॉपर्टी. अगर इसे शामिल नहीं किया जाता है, तो सभी सामान्य (यानी कि सिस्टम से जुड़ी नहीं) प्रॉपर्टी कॉपी हो जाती हैं.
excludeसूची, डिफ़ॉल्ट: nullसभी प्रॉपर्टी कॉपी करते समय, बाहर रखी जाने वाली प्रॉपर्टी की सूची. अगर प्रॉपर्टी तय की गई हैं, तो इस एट्रिब्यूट की वैल्यू तय नहीं की जानी चाहिए.

उदाहरण

कोड एडिटर (JavaScript)

// Import a Landsat 8 surface reflectance image to sample.
var image = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_038032_20170722')
                // Select the optical bands.
                .select(['SR_B.']);

// Get the image geometry to define the geographical bounds of the sample.
var imageBounds = image.geometry();

// Sample the image at a set of random points; a feature collection is returned.
var pointSampleFc = image.sample(
    {region: imageBounds, scale: 30, numPixels: 5, geometries: true});

// Copy image properties to the FeatureCollection; three options follow.
print('All non-system image properties copied to the FeatureCollection',
      pointSampleFc.copyProperties(image));

print('Selected image properties copied to the FeatureCollection',
      pointSampleFc.copyProperties({
        source: image,
        properties: ['system:time_start', 'SPACECRAFT_ID']
      }));

print('All but selected image properties copied to the FeatureCollection',
      pointSampleFc.copyProperties({
        source: image,
        exclude: ['TIRS_SSM_MODEL', 'TIRS_SSM_POSITION_STATUS']
      }));

Python सेटअप करना

Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के बारे में जानकारी पाने के लिए, Python एनवायरमेंट पेज देखें.

import ee
import geemap.core as geemap

Colab (Python)

# Import a Landsat 8 surface reflectance image to sample.
image = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_038032_20170722').select(
    # Select the optical bands.
    ['SR_B.'])

# Get the image geometry to define the geographical bounds of the sample.
image_bounds = image.geometry()

# Sample the image at a set of random points; a feature collection is returned.
point_sample_fc = image.sample(
    **{'region': image_bounds, 'scale': 30, 'numPixels': 5, 'geometries': True})

# Copy image properties to the FeatureCollection; three options follow.
print('All non-system image properties copied to the FeatureCollection:',
      point_sample_fc.copyProperties(image).getInfo())

print('Selected image properties copied to the FeatureCollection:',
      point_sample_fc.copyProperties(**{
          'source': image,
          'properties': ['system:time_start', 'SPACECRAFT_ID']
          }).getInfo())

print('All but selected image properties copied to the FeatureCollection:',
      point_sample_fc.copyProperties(**{
          'source': image,
          'exclude': ['TIRS_SSM_MODEL', 'TIRS_SSM_POSITION_STATUS']
      }).getInfo())