ee.FeatureCollection.distinct
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
موارد تکراری را از مجموعه حذف می کند. توجه داشته باشید که موارد تکراری با استفاده از یک هش قوی بر روی فرم سریالی خواص انتخاب شده تعیین می شوند.
استفاده | برمی گرداند | FeatureCollection. distinct (properties) | مجموعه ویژگی ها |
استدلال | تایپ کنید | جزئیات | این: collection | مجموعه ویژگی ها | مجموعه ورودی که اشیاء از آن انتخاب خواهند شد. |
properties | شیء | نام دارایی یا فهرستی از نام های دارایی که برای مقایسه استفاده می شود. ویژگی '.geo' را می توان برای مقایسه هندسه اشیا گنجاند. |
نمونه ها
ویرایشگر کد (جاوا اسکریپت)
// 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'));
راه اندازی پایتون
برای اطلاعات در مورد API پایتون و استفاده از geemap
برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.
import ee
import geemap.core as geemap
کولب (پایتون)
# 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())
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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```"]]