I am trying to display a ROI (region of interest) on the GEE map. I am getting pretty odd outputs like this:
Code that generated this image is down below:
var geometry = /* color: #d63000 */ee.Geometry.Polygon(
[[[-74.17301042227143, 41.01676815108097],
[-75.15079362539643, 40.93797200093739],
[-74.50260026602143, 40.3084072747414],
[-73.63468034414643, 40.559275861105796]]]);
var landsat = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA")
Map.centerObject(geometry)
var area = ee.FeatureCollection(geometry);
var image = ee.Image((landsat)
.filterBounds(area)
.filterDate('2018-01-01', '2018-12-31')
.select(['B[1-7]'])
.sort('CLOUD_COVER')
.first());
var filteredimage = image
//.clip(area)
Map.addLayer(filteredimage, {bands: ['B4', 'B3', 'B2'], max: 0.5, gamma: 2}, 'Better L8 Image');
If I uncomment the .clip(area)
line, I get only the intersection of these two chunks. But what I want is to show only the red section. And show all of it. From what I understand is the these square pictures are the raw pictures of the satellite. But how can I crop an image out of two or more different satellite images?