

// [START earthengine__apidocs__ee_geometry_rectangle_intersects]
// Define a Rectangle object.
var rectangle = ee.Geometry.Rectangle(-122.09, 37.42, -122.08, 37.43);

// Define other inputs.
var inputGeom = ee.Geometry.BBox(-122.085, 37.415, -122.075, 37.425);

// Apply the intersects method to the Rectangle object.
var rectangleIntersects = rectangle.intersects({'right': inputGeom, 'maxError': 1});

// Print the result to the console.
print('rectangle.intersects(...) =', rectangleIntersects);

// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(rectangle,
             {'color': 'black'},
             'Geometry [black]: rectangle');
Map.addLayer(inputGeom,
             {'color': 'blue'},
             'Parameter [blue]: inputGeom');
// [END earthengine__apidocs__ee_geometry_rectangle_intersects]