ee.Feature

ویژگی ها را می توان از یکی از آرگومان های زیر به اضافه یک فرهنگ لغت اختیاری خصوصیات ساخت:

- هندسه ee.

- هندسه GeoJSON.

- یک ویژگی GeoJSON.

- یک شی محاسبه‌شده: اگر ویژگی‌ها مشخص شده باشند به‌عنوان یک هندسه و اگر مشخص نشده‌اند به عنوان یک ویژگی دوباره تفسیر می‌شود.

استفاده برمی گرداند
ee.Feature(geometry, properties ) ویژگی
استدلال تایپ کنید جزئیات
geometry ComputedObject|ویژگی|هندسه|شیء یک هندسه یا ویژگی.
properties شیء، اختیاری فرهنگ لغت ویژگی های ابرداده. اگر اولین پارامتر یک ویژگی (به جای هندسه) باشد، استفاده نشده است.

نمونه ها

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

// Create the simplest possible feature.
print(ee.Feature(null));  // Empty feature

// Demonstrate how to set a feature's id.
print(ee.Feature(null, {'id': 'yada'}).id());  // null
print(ee.Feature(null, {'system:index': 'abc123'}).id());  // abc123

// The simplest possible feature with a geometry.
var feature = ee.Feature(ee.Geometry.Point([-114.318, 38.985]));
Map.addLayer(feature);
Map.centerObject(feature, 10);

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

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

import ee
import geemap.core as geemap

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

# Create the simplest possible feature.
display(ee.Feature(None))  # Empty feature

# Demonstrate how to set a feature's id.
display(ee.Feature(None, {'id': 'yada'}).id())  # None
display(ee.Feature(None, {'system:index': 'abc123'}).id())  # abc123

# The simplest possible feature with a geometry.
feature = ee.Feature(ee.Geometry.Point([-114.318, 38.985]))
m = geemap.Map()
m.add_layer(feature)
m.center_object(feature, 10)
m