ee.Feature

Features can be constructed from one of the following arguments plus an optional dictionary of properties:

  - An ee.Geometry.

  - A GeoJSON Geometry.

  - A GeoJSON Feature.

  - A computed object: reinterpreted as a geometry if properties are specified, and as a feature if they aren't.

UsageReturns
ee.Feature(geometry, properties)Feature
ArgumentTypeDetails
geometryComputedObject|Feature|Geometry|Object

A geometry or feature.

propertiesObject, optional

A dictionary of metadata properties. If the first parameter is a Feature (instead of a geometry), this is unused.

Examples

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

# Your example goes here!