Anuncio: Todos los proyectos no comerciales registrados para usar Earth Engine antes del
15 de abril de 2025 deben
verificar su elegibilidad no comercial para mantener el acceso a Earth Engine.
ee.DateRange.intersection
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Devuelve un objeto DateRange que contiene todos los puntos de la intersección de este objeto DateRange y otro.
Uso | Muestra |
---|
DateRange.intersection(other) | DateRange |
Argumento | Tipo | Detalles |
---|
esta: dateRange | DateRange | |
other | DateRange | |
Ejemplos
Editor de código (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));
Configuración de Python
Consulta la página
Entorno de Python para obtener información sobre la API de Python y el uso de geemap
para el desarrollo interactivo.
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)
)
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-26 (UTC)
[null,null,["Última actualización: 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```"]]