ee.ImageCollection.filterDate
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
میانبر برای فیلتر کردن مجموعه بر اساس محدوده تاریخ. شروع و پایان ممکن است تاریخ، اعداد (از 1970-01-01T00:00:00Z به صورت میلی ثانیه تفسیر شده) یا رشته ها (مانند '1996-01-01T08:00') باشد. بر اساس 'system:time_start'.
این معادل this.filter(ee.Filter.date(...)); برای سایر گزینه های فیلتر تاریخ، نوع ee.Filter را ببینید.
مجموعه فیلتر شده را برمی گرداند.
استفاده | برمی گرداند | ImageCollection. filterDate (start, end ) | مجموعه |
استدلال | تایپ کنید | جزئیات | این: collection | مجموعه | نمونه مجموعه |
start | تاریخ|شماره|رشته | تاریخ شروع (شامل). |
end | تاریخ|شماره|رشته، اختیاری | تاریخ پایان (انحصاری). اختیاری. اگر مشخص نشده باشد، یک محدوده 1 میلی ثانیه ای ایجاد می شود که از "شروع" شروع می شود. |
نمونه ها
ویرایشگر کد (جاوا اسکریپت)
// A Landsat 8 TOA image collection intersecting a specific point.
var col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
.filterBounds(ee.Geometry.Point(-90.70, 34.71));
// Filter the collection by date using date strings.
print('2020 images', col.filterDate('2020', '2021'));
print('July images, 2020', col.filterDate('2020-07', '2020-08'));
print('Early July images, 2020', col.filterDate('2020-07-01', '2020-07-10'));
print('Include time (13 hours, July 7, 2020)',
col.filterDate('2020-07-05T06:34:46', '2020-07-05T19:34:46'));
// Use milliseconds since Unix epoch.
print('Milliseconds inputs', col.filterDate(1593967014062, 1595349419611));
// Use ee.Date objects.
print('ee.Date inputs', col.filterDate(ee.Date('2020'), ee.Date('2021')));
// Use an ee.DateRange object.
var dateRange = ee.DateRange('2020-07-01', '2020-07-10');
print('ee.DateRange input', col.filterDate(dateRange));
راه اندازی پایتون
برای اطلاعات در مورد API پایتون و استفاده از geemap
برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.
import ee
import geemap.core as geemap
کولب (پایتون)
# A Landsat 8 TOA image collection intersecting a specific point.
col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA').filterBounds(
ee.Geometry.Point(-90.70, 34.71))
# Filter the collection by date using date strings.
print('2020 images:', col.filterDate('2020', '2021').getInfo())
print('July images, 2020:', col.filterDate('2020-07', '2020-08').getInfo())
print('Early July images, 2020:',
col.filterDate('2020-07-01', '2020-07-10').getInfo())
print('Include time (13 hours, July 7, 2020):',
col.filterDate('2020-07-05T06:34:46', '2020-07-05T19:34:46').getInfo())
# Use milliseconds since Unix epoch.
print('Milliseconds inputs:',
col.filterDate(1593967014062, 1595349419611).getInfo())
# Use ee.Date objects.
print('ee.Date inputs',
col.filterDate(ee.Date('2020'), ee.Date('2021')).getInfo())
# Use an ee.DateRange object.
date_range = ee.DateRange('2020-07-01', '2020-07-10')
print('ee.DateRange input', col.filterDate(date_range).getInfo())
،
میانبر برای فیلتر کردن مجموعه بر اساس محدوده تاریخ. شروع و پایان ممکن است تاریخ، اعداد (از 1970-01-01T00:00:00Z به صورت میلی ثانیه تفسیر شده) یا رشته ها (مانند '1996-01-01T08:00') باشد. بر اساس 'system:time_start'.
این معادل this.filter(ee.Filter.date(...)); برای سایر گزینه های فیلتر تاریخ، نوع ee.Filter را ببینید.
مجموعه فیلتر شده را برمی گرداند.
استفاده | برمی گرداند | ImageCollection. filterDate (start, end ) | مجموعه |
استدلال | تایپ کنید | جزئیات | این: collection | مجموعه | نمونه مجموعه |
start | تاریخ|شماره|رشته | تاریخ شروع (شامل). |
end | تاریخ|شماره|رشته، اختیاری | تاریخ پایان (انحصاری). اختیاری. اگر مشخص نشده باشد، یک محدوده 1 میلی ثانیه ای ایجاد می شود که از "شروع" شروع می شود. |
نمونه ها
ویرایشگر کد (جاوا اسکریپت)
// A Landsat 8 TOA image collection intersecting a specific point.
var col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
.filterBounds(ee.Geometry.Point(-90.70, 34.71));
// Filter the collection by date using date strings.
print('2020 images', col.filterDate('2020', '2021'));
print('July images, 2020', col.filterDate('2020-07', '2020-08'));
print('Early July images, 2020', col.filterDate('2020-07-01', '2020-07-10'));
print('Include time (13 hours, July 7, 2020)',
col.filterDate('2020-07-05T06:34:46', '2020-07-05T19:34:46'));
// Use milliseconds since Unix epoch.
print('Milliseconds inputs', col.filterDate(1593967014062, 1595349419611));
// Use ee.Date objects.
print('ee.Date inputs', col.filterDate(ee.Date('2020'), ee.Date('2021')));
// Use an ee.DateRange object.
var dateRange = ee.DateRange('2020-07-01', '2020-07-10');
print('ee.DateRange input', col.filterDate(dateRange));
راه اندازی پایتون
برای اطلاعات در مورد API پایتون و استفاده از geemap
برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.
import ee
import geemap.core as geemap
کولب (پایتون)
# A Landsat 8 TOA image collection intersecting a specific point.
col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA').filterBounds(
ee.Geometry.Point(-90.70, 34.71))
# Filter the collection by date using date strings.
print('2020 images:', col.filterDate('2020', '2021').getInfo())
print('July images, 2020:', col.filterDate('2020-07', '2020-08').getInfo())
print('Early July images, 2020:',
col.filterDate('2020-07-01', '2020-07-10').getInfo())
print('Include time (13 hours, July 7, 2020):',
col.filterDate('2020-07-05T06:34:46', '2020-07-05T19:34:46').getInfo())
# Use milliseconds since Unix epoch.
print('Milliseconds inputs:',
col.filterDate(1593967014062, 1595349419611).getInfo())
# Use ee.Date objects.
print('ee.Date inputs',
col.filterDate(ee.Date('2020'), ee.Date('2021')).getInfo())
# Use an ee.DateRange object.
date_range = ee.DateRange('2020-07-01', '2020-07-10')
print('ee.DateRange input', col.filterDate(date_range).getInfo())
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003eImageCollection.filterDate()\u003c/code\u003e allows you to filter an image collection by a specific date range using start and end dates.\u003c/p\u003e\n"],["\u003cp\u003eStart and end dates can be specified as Dates, numbers (milliseconds since 1970-01-01T00:00:00Z), or date strings (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS).\u003c/p\u003e\n"],["\u003cp\u003eThe filter is based on the \u003ccode\u003esystem:time_start\u003c/code\u003e property of images within the collection.\u003c/p\u003e\n"],["\u003cp\u003eIf the end date is not provided, a 1-millisecond range starting at the start date is used for filtering.\u003c/p\u003e\n"],["\u003cp\u003eThis function is a shortcut to using \u003ccode\u003eee.Filter.date()\u003c/code\u003e and returns the filtered collection.\u003c/p\u003e\n"]]],["The `filterDate` method filters an ImageCollection by a date range, based on 'system:time_start'. It accepts start and optional end dates as Dates, numbers (milliseconds since 1970), or strings. If no end date is provided, a 1-millisecond range from the start is used. This function returns a filtered collection. Examples demonstrate usage with various input formats, including date strings, milliseconds, `ee.Date` objects, and `ee.DateRange` objects in both JavaScript and Python.\n"],null,["# ee.ImageCollection.filterDate\n\n\u003cbr /\u003e\n\nShortcut to filter a collection by a date range. The start and end may be Dates, numbers (interpreted as milliseconds since 1970-01-01T00:00:00Z), or strings (such as '1996-01-01T08:00'). Based on 'system:time_start'.\n\n\u003cbr /\u003e\n\nThis is equivalent to this.filter(ee.Filter.date(...)); see the ee.Filter type for other date filtering options.\n\nReturns the filtered collection.\n\n| Usage | Returns |\n|----------------------------------------------|------------|\n| ImageCollection.filterDate`(start, `*end*`)` | Collection |\n\n| Argument | Type | Details |\n|--------------------|--------------------------------|-------------------------------------------------------------------------------------------------------------|\n| this: `collection` | Collection | The Collection instance. |\n| `start` | Date\\|Number\\|String | The start date (inclusive). |\n| `end` | Date\\|Number\\|String, optional | The end date (exclusive). Optional. If not specified, a 1-millisecond range starting at 'start' is created. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// A Landsat 8 TOA image collection intersecting a specific point.\nvar col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')\n .filterBounds(ee.Geometry.Point(-90.70, 34.71));\n\n// Filter the collection by date using date strings.\nprint('2020 images', col.filterDate('2020', '2021'));\nprint('July images, 2020', col.filterDate('2020-07', '2020-08'));\nprint('Early July images, 2020', col.filterDate('2020-07-01', '2020-07-10'));\nprint('Include time (13 hours, July 7, 2020)',\n col.filterDate('2020-07-05T06:34:46', '2020-07-05T19:34:46'));\n\n// Use milliseconds since Unix epoch.\nprint('Milliseconds inputs', col.filterDate(1593967014062, 1595349419611));\n\n// Use ee.Date objects.\nprint('ee.Date inputs', col.filterDate(ee.Date('2020'), ee.Date('2021')));\n\n// Use an ee.DateRange object.\nvar dateRange = ee.DateRange('2020-07-01', '2020-07-10');\nprint('ee.DateRange input', col.filterDate(dateRange));\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# A Landsat 8 TOA image collection intersecting a specific point.\ncol = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA').filterBounds(\n ee.Geometry.Point(-90.70, 34.71))\n\n# Filter the collection by date using date strings.\nprint('2020 images:', col.filterDate('2020', '2021').getInfo())\nprint('July images, 2020:', col.filterDate('2020-07', '2020-08').getInfo())\nprint('Early July images, 2020:',\n col.filterDate('2020-07-01', '2020-07-10').getInfo())\nprint('Include time (13 hours, July 7, 2020):',\n col.filterDate('2020-07-05T06:34:46', '2020-07-05T19:34:46').getInfo())\n\n# Use milliseconds since Unix epoch.\nprint('Milliseconds inputs:',\n col.filterDate(1593967014062, 1595349419611).getInfo())\n\n# Use ee.Date objects.\nprint('ee.Date inputs',\n col.filterDate(ee.Date('2020'), ee.Date('2021')).getInfo())\n\n# Use an ee.DateRange object.\ndate_range = ee.DateRange('2020-07-01', '2020-07-10')\nprint('ee.DateRange input', col.filterDate(date_range).getInfo())\n```"]]