お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ee.FeatureCollection.distinct
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
コレクションから重複を削除します。重複は、選択したプロパティのシリアル化された形式に対する強力なハッシュを使用して決定されます。
用途 | 戻り値 |
---|
FeatureCollection.distinct(properties) | FeatureCollection |
引数 | タイプ | 詳細 |
---|
これ: collection | FeatureCollection | オブジェクトが選択される入力コレクション。 |
properties | オブジェクト | 比較に使用するプロパティ名またはプロパティ名のリスト。オブジェクトのジオメトリを比較するために、.geo プロパティを含めることができます。 |
例
コードエディタ(JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
print('FeatureCollection of power plants in Belgium', fc);
// Remove duplicate features according to property values.
print('Distinct based on a single property', fc.distinct('fuel1'));
print('Distinct based on two properties', fc.distinct(['fuel1', 'source']));
print('Distinct based on geometry', fc.distinct('.geo'));
Python の設定
Python API とインタラクティブな開発での geemap
の使用については、
Python 環境のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"')
print('FeatureCollection of power plants in Belgium:', fc.getInfo())
# Remove duplicate features according to property values.
print('Distinct based on a single property:', fc.distinct('fuel1').getInfo())
print('Distinct based on two properties:',
fc.distinct(['fuel1', 'source']).getInfo())
print('Distinct based on geometry', fc.distinct('.geo').getInfo())
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003eThe \u003ccode\u003edistinct()\u003c/code\u003e method removes duplicate features from a FeatureCollection based on specified properties or geometry.\u003c/p\u003e\n"],["\u003cp\u003eDuplicates are identified using a strong hash of the serialized form of the selected properties or '.geo' for geometry.\u003c/p\u003e\n"],["\u003cp\u003eThe method accepts a property name, a list of property names, or '.geo' as input for comparison.\u003c/p\u003e\n"],["\u003cp\u003eIt returns a new FeatureCollection containing only the unique features.\u003c/p\u003e\n"],["\u003cp\u003eThe original FeatureCollection remains unchanged.\u003c/p\u003e\n"]]],["The `distinct` method removes duplicate features from a `FeatureCollection`. Duplicates are identified by comparing the serialized form of specified properties using a strong hash. The `properties` argument defines the comparison criteria, accepting a single property name or a list, including '.geo' for geometry. The method returns a new `FeatureCollection` with the duplicates removed. Examples are provided for both JavaScript and Python, using power plants in Belgium and properties like 'fuel1', 'source' or geometry to remove duplicates.\n"],null,["# ee.FeatureCollection.distinct\n\nRemoves duplicates from a collection. Note that duplicates are determined using a strong hash over the serialized form of the selected properties.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------|-------------------|\n| FeatureCollection.distinct`(properties)` | FeatureCollection |\n\n| Argument | Type | Details |\n|--------------------|-------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| this: `collection` | FeatureCollection | The input collection from which objects will be selected. |\n| `properties` | Object | A property name or a list of property names to use for comparison. The '.geo' property can be included to compare object geometries. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// FeatureCollection of power plants in Belgium.\nvar fc = ee.FeatureCollection('WRI/GPPD/power_plants')\n .filter('country_lg == \"Belgium\"');\nprint('FeatureCollection of power plants in Belgium', fc);\n\n// Remove duplicate features according to property values.\nprint('Distinct based on a single property', fc.distinct('fuel1'));\nprint('Distinct based on two properties', fc.distinct(['fuel1', 'source']));\nprint('Distinct based on geometry', fc.distinct('.geo'));\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# FeatureCollection of power plants in Belgium.\nfc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(\n 'country_lg == \"Belgium\"')\nprint('FeatureCollection of power plants in Belgium:', fc.getInfo())\n\n# Remove duplicate features according to property values.\nprint('Distinct based on a single property:', fc.distinct('fuel1').getInfo())\nprint('Distinct based on two properties:',\n fc.distinct(['fuel1', 'source']).getInfo())\nprint('Distinct based on geometry', fc.distinct('.geo').getInfo())\n```"]]