ee.DateRange.intersection
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แสดงผล DateRange ที่มีจุดทั้งหมดในส่วนที่ทับซ้อนกันของ DateRange นี้กับอีก DateRange หนึ่ง
การใช้งาน | การคืนสินค้า |
---|
DateRange.intersection(other) | DateRange |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ dateRange | DateRange | |
other | DateRange | |
ตัวอย่าง
โปรแกรมแก้ไขโค้ด (JavaScript)
// A series of ee.DateRange objects.
var dateRange1 = ee.DateRange('2017-06-24', '2017-07-24');
var dateRange2 = ee.DateRange('2017-07-01', '2018-08-24');
// Determine the intersection of two ee.DateRange objects.
print('Intersection of dateRange1 and dateRange2',
dateRange1.intersection(dateRange2));
การตั้งค่า Python
ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap
เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า
สภาพแวดล้อม Python
import ee
import geemap.core as geemap
Colab (Python)
# A series of ee.DateRange objects.
date_range_1 = ee.DateRange('2017-06-24', '2017-07-24')
date_range_2 = ee.DateRange('2017-07-01', '2018-08-24')
# Determine the intersection of two ee.DateRange objects.
display(
'Intersection of date_range_1 and date_range_2:',
date_range_1.intersection(date_range_2)
)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003eDateRange.intersection()\u003c/code\u003e returns a new \u003ccode\u003eDateRange\u003c/code\u003e representing the overlapping period between two \u003ccode\u003eDateRange\u003c/code\u003e objects.\u003c/p\u003e\n"],["\u003cp\u003eThis function takes another \u003ccode\u003eDateRange\u003c/code\u003e as an argument and determines the common time span between the two.\u003c/p\u003e\n"],["\u003cp\u003eYou can use this function to identify the period where both date ranges coincide for further analysis or filtering.\u003c/p\u003e\n"],["\u003cp\u003eCode examples are provided in JavaScript, Python, and Colab demonstrating how to use \u003ccode\u003eDateRange.intersection()\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `intersection()` method determines the overlapping period between two `DateRange` objects. It takes another `DateRange` as input (`other`). The method returns a new `DateRange` that represents the shared time interval between the original `DateRange` and the input `DateRange`. For example, intersecting '2017-06-24' to '2017-07-24' with '2017-07-01' to '2018-08-24' yields a DateRange from '2017-07-01' to '2017-07-24'.\n"],null,["# ee.DateRange.intersection\n\nReturns a DateRange that contains all points in the intersection of this DateRange and another.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------|-----------|\n| DateRange.intersection`(other)` | DateRange |\n\n| Argument | Type | Details |\n|-------------------|-----------|---------|\n| this: `dateRange` | DateRange | |\n| `other` | DateRange | |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// A series of ee.DateRange objects.\nvar dateRange1 = ee.DateRange('2017-06-24', '2017-07-24');\nvar dateRange2 = ee.DateRange('2017-07-01', '2018-08-24');\n\n// Determine the intersection of two ee.DateRange objects.\nprint('Intersection of dateRange1 and dateRange2',\n dateRange1.intersection(dateRange2));\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 series of ee.DateRange objects.\ndate_range_1 = ee.DateRange('2017-06-24', '2017-07-24')\ndate_range_2 = ee.DateRange('2017-07-01', '2018-08-24')\n\n# Determine the intersection of two ee.DateRange objects.\ndisplay(\n 'Intersection of date_range_1 and date_range_2:',\n date_range_1.intersection(date_range_2)\n)\n```"]]