Announcement : On
November 13, 2024 , all users will need to
use a Cloud project in order to access Earth Engine. After this date, continued individual access without a Cloud project will require
an exception .
Send feedback
ee.Feature
Stay organized with collections
Save and categorize content based on your preferences.
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.
Usage Returns ee.Feature(geometry, properties )
Feature
Argument Type Details geometry
ComputedObject|Feature|Geometry|Object A geometry or feature. properties
Object, optional A dictionary of metadata properties. If the first parameter is a Feature (instead of a geometry), this is unused.
Examples
Code Editor (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 setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
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
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2023-10-06 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."]]