اطلاعات و فراداده مجموعه ویژگی ها

روش‌های دریافت اطلاعات از فراداده مجموعه ویژگی‌ها مانند مجموعه‌های تصویری است. برای جزئیات بیشتر به بخش ImageCollection Information and Metadata مراجعه کنید.

تجمع فراداده

می توانید از میانبرهای تجمیع برای شمارش تعداد ویژگی ها یا خلاصه کردن یک ویژگی استفاده کنید:

ویرایشگر کد (جاوا اسکریپت)

// Load watersheds from a data table.
var sheds = ee.FeatureCollection('USGS/WBD/2017/HUC06')
  // Filter to the continental US.
  .filterBounds(ee.Geometry.Rectangle(-127.18, 19.39, -62.75, 51.29))
  // Convert 'areasqkm' property from string to number.
  .map(function(feature){
    var num = ee.Number.parse(feature.get('areasqkm'));
    return feature.set('areasqkm', num);
  });

// Display the table and print its first element.
Map.addLayer(sheds, {}, 'watersheds');
print('First watershed', sheds.first());

// Print the number of watersheds.
print('Count:', sheds.size());

// Print stats for an area property.
print('Area stats:', sheds.aggregate_stats('areasqkm'));

راه اندازی پایتون

برای اطلاعات در مورد API پایتون و استفاده از geemap برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.

import ee
import geemap.core as geemap

کولب (پایتون)

# Load watersheds from a data table.
sheds = (
    ee.FeatureCollection('USGS/WBD/2017/HUC06')
    # Filter to the continental US.
    .filterBounds(ee.Geometry.Rectangle(-127.18, 19.39, -62.75, 51.29))
    # Convert 'areasqkm' property from string to number.
    .map(
        lambda feature: feature.set(
            'areasqkm', ee.Number.parse(feature.get('areasqkm'))
        )
    )
)

# Display the table and print its first element.
m = geemap.Map()
m.add_layer(sheds, {}, 'watersheds')
display(m)
display('First watershed:', sheds.first())

# Print the number of watersheds.
display('Count:', sheds.size())

# Print stats for an area property.
display('Area stats:', sheds.aggregate_stats('areasqkm'))

اطلاعات ستون

دانستن نام‌ها و نوع داده‌های ستون‌های FeatureCollection می‌تواند مفید باشد (مثلاً فیلتر کردن یک مجموعه بر اساس ابرداده ). مثال زیر نام ستون ها و انواع داده را برای مجموعه ای از ویژگی های نقطه ای که مناطق محافظت شده را نشان می دهد چاپ می کند.

ویرایشگر کد (جاوا اسکریپت)

// Import a protected areas point feature collection.
var wdpa = ee.FeatureCollection("WCMC/WDPA/current/points");

// Define a function to print metadata column names and datatypes. This function
// is intended to be applied by the `evaluate` method which provides the
// function a client-side dictionary allowing the 'columns' object of the
// feature collection metadata to be subset by dot notation or bracket notation
// (`tableMetadata['columns']`).
function getCols(tableMetadata) {
  print(tableMetadata.columns);
}

// Fetch collection metadata (`.limit(0)`) and apply the
// previously defined function using `evaluate()`. The printed object is a
// dictionary where keys are column names and values are datatypes.
wdpa.limit(0).evaluate(getCols);

راه اندازی پایتون

برای اطلاعات در مورد API پایتون و استفاده از geemap برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.

import ee
import geemap.core as geemap

کولب (پایتون)

# Import a protected areas point feature collection.
wdpa = ee.FeatureCollection('WCMC/WDPA/current/points')

# Fetch collection metadata (`.limit(0)`). The printed object is a
# dictionary where keys are column names and values are datatypes.
wdpa.limit(0).getInfo()['columns']

برای اهداف کلی بیشتر ابزارهای تجمیع FeatureCollection ، صفحه Reducing a FeatureCollection را ببینید.