Duyuru:
15 Nisan 2025'ten önce Earth Engine'i kullanmak için kaydedilen tüm ticari olmayan projelerin Earth Engine erişimini sürdürmek için
ticari olmayan uygunluğu doğrulaması gerekir.
Özelliğe Genel Bakış
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Earth Engine'da Feature
, GeoJSON özelliği olarak tanımlanır. Daha açık belirtmek gerekirse, Feature
, Geometry
nesnesi (veya null) depolayan bir geometry
özelliğine ve diğer özelliklerin sözlüğünü depolayan bir properties
özelliğine sahip bir nesnedir.
Özellik nesneleri oluşturma
Feature
oluşturmak için oluşturucuya bir Geometry
ve (isteğe bağlı olarak) diğer özelliklerin sözlüğünü sağlayın. Örneğin:
Kod Düzenleyici (JavaScript)
// Create an ee.Geometry.
var polygon = ee.Geometry.Polygon([
[[-35, -10], [35, -10], [35, 10], [-35, 10], [-35, -10]]
]);
// Create a Feature from the Geometry.
var polyFeature = ee.Feature(polygon, {foo: 42, bar: 'tart'});
Python kurulumu
Python API'si ve etkileşimli geliştirme için geemap
kullanımı hakkında bilgi edinmek üzere
Python Ortamı sayfasına bakın.
import ee
import geemap.core as geemap
Colab (Python)
# Create an ee.Geometry.
polygon = ee.Geometry.Polygon(
[[[-35, -10], [35, -10], [35, 10], [-35, 10], [-35, -10]]]
)
# Create a Feature from the Geometry.
poly_feature = ee.Feature(polygon, {'foo': 42, 'bar': 'tart'})
Geometry
'te olduğu gibi, Feature
da incelenip görselleştirilmesi için basılabilir veya haritaya eklenebilir:
Kod Düzenleyici (JavaScript)
print(polyFeature);
Map.addLayer(polyFeature, {}, 'feature');
Python kurulumu
Python API'si ve etkileşimli geliştirme için geemap
kullanımı hakkında bilgi edinmek üzere
Python Ortamı sayfasına bakın.
import ee
import geemap.core as geemap
Colab (Python)
display(poly_feature)
m = geemap.Map()
m.add_layer(poly_feature, {}, 'feature')
display(m)
Feature
'lerin Geometry
içermesi gerekmez ve bunlar yalnızca bir mülk sözlüğünü sarmalayabilir. Örneğin:
Kod Düzenleyici (JavaScript)
// Create a dictionary of properties, some of which may be computed values.
var dict = {foo: ee.Number(8).add(88), bar: 'nihao'};
// Create a null geometry feature with the dictionary of properties.
var nowhereFeature = ee.Feature(null, dict);
Python kurulumu
Python API'si ve etkileşimli geliştirme için geemap
kullanımı hakkında bilgi edinmek üzere
Python Ortamı sayfasına bakın.
import ee
import geemap.core as geemap
Colab (Python)
# Create a dictionary of properties, some of which may be computed values.
dic = {'foo': ee.Number(8).add(88), 'bar': 'nihao'}
# Create a null geometry feature with the dictionary of properties.
nowhere_feature = ee.Feature(None, dic)
Bu örnekte, Feature
parametresine sağlanan sözlüğün hesaplanmış bir değer içerdiğini unutmayın. Bu şekilde özellik oluşturmak, uzun süren hesaplamaları Dictionary
sonucuyla (ör. image.reduceRegion()
) dışa aktarmak için kullanışlıdır. Ayrıntılar için FeatureCollections ve Tablo Verilerini İçe Aktarma veya Dışa Aktarma kılavuzlarına bakın.
Her Feature
, geometry
mülkünde depolanan bir birincil Geometry
'e sahiptir. Diğer mülklerde ek geometriler depolanabilir.
Birincil Geometry
'yi almak, işlemi uygulamak ve sonucu yeni birincil Geometry
olarak ayarlamak için Feature
'da kesişim ve arabellek gibi Geometry
yöntemleri de mevcuttur.
Sonuç, yöntemin çağrıldığı Feature
'nin diğer tüm özelliklerini korur. Feature
'nin geometri dışı özelliklerini alma ve ayarlama yöntemleri de vardır. Örneğin:
Kod Düzenleyici (JavaScript)
// Make a feature and set some properties.
var feature = ee.Feature(ee.Geometry.Point([-122.22599, 37.17605]))
.set('genus', 'Sequoia').set('species', 'sempervirens');
// Get a property from the feature.
var species = feature.get('species');
print(species);
// Set a new property.
feature = feature.set('presence', 1);
// Overwrite the old properties with a new dictionary.
var newDict = {genus: 'Brachyramphus', species: 'marmoratus'};
var feature = feature.set(newDict);
// Check the result.
print(feature);
Python kurulumu
Python API'si ve etkileşimli geliştirme için geemap
kullanımı hakkında bilgi edinmek üzere
Python Ortamı sayfasına bakın.
import ee
import geemap.core as geemap
Colab (Python)
# Make a feature and set some properties.
feature = (
ee.Feature(ee.Geometry.Point([-122.22599, 37.17605]))
.set('genus', 'Sequoia')
.set('species', 'sempervirens')
)
# Get a property from the feature.
species = feature.get('species')
display(species)
# Set a new property.
feature = feature.set('presence', 1)
# Overwrite the old properties with a new dictionary.
new_dic = {'genus': 'Brachyramphus', 'species': 'marmoratus'}
feature = feature.set(new_dic)
# Check the result.
display(feature)
Önceki örnekte, özelliklerin anahtar/değer çifti veya sözlük ile ayarlanabileceğini unutmayın. Ayrıca, feature.set()
'ün mevcut özelliklerinin üzerine yazdığını unutmayın.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-25 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-25 UTC."],[[["\u003cp\u003eIn Earth Engine, a \u003ccode\u003eFeature\u003c/code\u003e is a GeoJSON Feature containing a \u003ccode\u003egeometry\u003c/code\u003e and \u003ccode\u003eproperties\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFeature\u003c/code\u003e objects can be created using a \u003ccode\u003eGeometry\u003c/code\u003e and an optional dictionary of properties.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFeature\u003c/code\u003e objects can be visualized on the map and printed for inspection.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFeature\u003c/code\u003e objects can have their properties set, retrieved, and overwritten using \u003ccode\u003eset()\u003c/code\u003e and \u003ccode\u003eget()\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Feature Overview\n\nA `Feature` in Earth Engine is defined as a GeoJSON Feature. Specifically,\na `Feature` is an object with a `geometry` property storing a\n`Geometry` object (or null) and a `properties` property storing a\ndictionary of other properties.\n\nCreating Feature objects\n------------------------\n\nTo create a `Feature`, provide the constructor with a `Geometry`\nand (optionally) a dictionary of other properties. For example:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Create an ee.Geometry.\nvar polygon = ee.Geometry.Polygon([\n [[-35, -10], [35, -10], [35, 10], [-35, 10], [-35, -10]]\n]);\n\n// Create a Feature from the Geometry.\nvar polyFeature = ee.Feature(polygon, {foo: 42, bar: 'tart'});\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# Create an ee.Geometry.\npolygon = ee.Geometry.Polygon(\n [[[-35, -10], [35, -10], [35, 10], [-35, 10], [-35, -10]]]\n)\n\n# Create a Feature from the Geometry.\npoly_feature = ee.Feature(polygon, {'foo': 42, 'bar': 'tart'})\n```\n\nAs with a `Geometry`, a `Feature` may be printed or added to the\nmap for inspection and visualization:\n\n### Code Editor (JavaScript)\n\n```javascript\nprint(polyFeature);\nMap.addLayer(polyFeature, {}, 'feature');\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\ndisplay(poly_feature)\nm = geemap.Map()\nm.add_layer(poly_feature, {}, 'feature')\ndisplay(m)\n```\n\nA `Feature` need not have a `Geometry` and may simply wrap a\ndictionary of properties. For example:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Create a dictionary of properties, some of which may be computed values.\nvar dict = {foo: ee.Number(8).add(88), bar: 'nihao'};\n\n// Create a null geometry feature with the dictionary of properties.\nvar nowhereFeature = ee.Feature(null, dict);\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# Create a dictionary of properties, some of which may be computed values.\ndic = {'foo': ee.Number(8).add(88), 'bar': 'nihao'}\n\n# Create a null geometry feature with the dictionary of properties.\nnowhere_feature = ee.Feature(None, dic)\n```\n\nIn this example, note that the dictionary supplied to the `Feature` contains a\ncomputed value. Creating features in this manner is useful for exporting long-running\ncomputations with a `Dictionary` result (e.g. `image.reduceRegion()`).\nSee the [FeatureCollections](/earth-engine/guides/feature_collections) and\n[Importing Table Data](/earth-engine/guides/table_upload) or [Exporting](/earth-engine/guides/exporting) guides for\ndetails.\n\nEach `Feature` has one primary `Geometry` stored in the\n`geometry` property. Additional geometries may be stored in other properties.\n`Geometry` methods such as intersection and buffer also exist on\n`Feature` as a convenience for getting the primary `Geometry`,\napplying the operation, and setting the result as the new primary `Geometry`.\nThe result will retain all the other properties of the `Feature` on which\nthe method is called. There are also methods for getting and setting the non-geometry\nproperties of the `Feature`. For example:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Make a feature and set some properties.\nvar feature = ee.Feature(ee.Geometry.Point([-122.22599, 37.17605]))\n .set('genus', 'Sequoia').set('species', 'sempervirens');\n\n// Get a property from the feature.\nvar species = feature.get('species');\nprint(species);\n\n// Set a new property.\nfeature = feature.set('presence', 1);\n\n// Overwrite the old properties with a new dictionary.\nvar newDict = {genus: 'Brachyramphus', species: 'marmoratus'};\nvar feature = feature.set(newDict);\n\n// Check the result.\nprint(feature);\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# Make a feature and set some properties.\nfeature = (\n ee.Feature(ee.Geometry.Point([-122.22599, 37.17605]))\n .set('genus', 'Sequoia')\n .set('species', 'sempervirens')\n)\n\n# Get a property from the feature.\nspecies = feature.get('species')\ndisplay(species)\n\n# Set a new property.\nfeature = feature.set('presence', 1)\n\n# Overwrite the old properties with a new dictionary.\nnew_dic = {'genus': 'Brachyramphus', 'species': 'marmoratus'}\nfeature = feature.set(new_dic)\n\n# Check the result.\ndisplay(feature)\n```\n\nIn the previous example, note that properties can be set with either a key-value pair,\nor with a dictionary. Also note that `feature.set()`\noverwrites existing properties."]]