ee.Feature

特徴は、次のいずれかの引数と、プロパティの省略可能な辞書から構成できます。

  - ee.Geometry。

  - GeoJSON ジオメトリ。

  - GeoJSON Feature。

  - 計算されたオブジェクト: プロパティが指定されている場合はジオメトリとして、指定されていない場合はフィーチャーとして再解釈されます。

用途戻り値
ee.Feature(geometry, properties)機能
引数タイプ詳細
geometryComputedObject|Feature|Geometry|Objectジオメトリまたはフィーチャー。
propertiesオブジェクト、省略可メタデータ プロパティのディクショナリ。最初のパラメータが(ジオメトリではなく)Feature の場合、これは使用されません。

コードエディタ(JavaScript)

// 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);

Python の設定

Python API とインタラクティブな開発での geemap の使用については、 Python 環境のページをご覧ください。

import ee
import geemap.core as geemap

Colab(Python)

# 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