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.
ee.Feature
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Özellikler, aşağıdaki bağımsız değişkenlerden biri ve isteğe bağlı bir özellik sözlüğü kullanılarak oluşturulabilir:
- An ee.Geometry.
- GeoJSON Geometrisi.
- GeoJSON özelliği.
- Hesaplanan bir nesne: Özellikler belirtilmişse geometri, belirtilmemişse özellik olarak yeniden yorumlanır.
Kullanım | İadeler |
---|
ee.Feature(geometry, properties) | Özellik |
Bağımsız Değişken | Tür | Ayrıntılar |
---|
geometry | ComputedObject|Feature|Geometry|Object | Geometri veya özellik. |
properties | Nesne, isteğe bağlı | Meta veri özelliklerinin sözlüğü. İlk parametre bir geometri yerine bir özellikse bu parametre kullanılmaz. |
Örnekler
Kod Düzenleyici (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 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 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
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-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eee.Feature\u003c/code\u003e objects represent geographic features with geometry and properties, and can be constructed from geometries, GeoJSON, or computed objects.\u003c/p\u003e\n"],["\u003cp\u003eFeatures can have an optional dictionary of properties to store metadata.\u003c/p\u003e\n"],["\u003cp\u003eFeature IDs are determined by the \u003ccode\u003esystem:index\u003c/code\u003e property, if present, or by the \u003ccode\u003eid\u003c/code\u003e property as a fallback.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eee.Feature\u003c/code\u003e constructor provides a flexible way to create features with or without geometries and associated properties within Earth Engine.\u003c/p\u003e\n"],["\u003cp\u003eSimple features can be visualized on a map using \u003ccode\u003eMap.addLayer\u003c/code\u003e and \u003ccode\u003eMap.centerObject\u003c/code\u003e in JavaScript or similar functions in Python using \u003ccode\u003egeemap\u003c/code\u003e.\u003c/p\u003e\n"]]],["Features are created using a geometry (ee.Geometry, GeoJSON Geometry, or GeoJSON Feature) or a computed object, along with an optional dictionary of properties. `ee.Feature(geometry, properties)` creates a Feature. The `geometry` argument can be a geometry or another feature. The optional `properties` argument is a metadata dictionary; it's unused if the first argument is already a feature. A feature can be created without a geometry and an `id` or a `system:index` can be set.\n"],null,["# ee.Feature\n\n\u003cbr /\u003e\n\nFeatures can be constructed from one of the following arguments plus an optional dictionary of properties:\n\n\u003cbr /\u003e\n\n- An ee.Geometry.\n\n- A GeoJSON Geometry.\n\n- A GeoJSON Feature.\n\n- A computed object: reinterpreted as a geometry if properties are specified, and as a feature if they aren't.\n\n| Usage | Returns |\n|----------------------------------------|---------|\n| `ee.Feature(geometry, `*properties*`)` | Feature |\n\n| Argument | Type | Details |\n|--------------|-------------------------------------------|-------------------------------------------------------------------------------------------------------------------|\n| `geometry` | ComputedObject\\|Feature\\|Geometry\\|Object | A geometry or feature. |\n| `properties` | Object, optional | A dictionary of metadata properties. If the first parameter is a Feature (instead of a geometry), this is unused. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Create the simplest possible feature.\nprint(ee.Feature(null)); // Empty feature\n\n// Demonstrate how to set a feature's id.\nprint(ee.Feature(null, {'id': 'yada'}).id()); // null\nprint(ee.Feature(null, {'system:index': 'abc123'}).id()); // abc123\n\n// The simplest possible feature with a geometry.\nvar feature = ee.Feature(ee.Geometry.Point([-114.318, 38.985]));\nMap.addLayer(feature);\nMap.centerObject(feature, 10);\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 the simplest possible feature.\ndisplay(ee.Feature(None)) # Empty feature\n\n# Demonstrate how to set a feature's id.\ndisplay(ee.Feature(None, {'id': 'yada'}).id()) # None\ndisplay(ee.Feature(None, {'system:index': 'abc123'}).id()) # abc123\n\n# The simplest possible feature with a geometry.\nfeature = ee.Feature(ee.Geometry.Point([-114.318, 38.985]))\nm = geemap.Map()\nm.add_layer(feature)\nm.center_object(feature, 10)\nm\n```"]]