0

I want to load a sentinel 2 scene for a specific date (24 June 2018) over a specific area of interest given by these coordinates 1: [130.887,-12.669] 2: [130.887,-12.927] 3: [131.156,-12.927] 4: [131.156,-12.669].

How do I go about this?

Code I m using is

// Load sent 2 data, filter by date and bounds. 
var collection = ee.ImageCollection('sent2') 
.filterDate('2018-04-25', '2018-06-5') 
.filterBounds(ee.Geometry.Point((130.887, -12.669), (130.887, -12.927), (131.156, -12.927), (131.156, -12.669))
  • Hi Mary, here is the answer: developers.google.com/earth-engine/ic_filtering – Rodrigo E. Principe Apr 3 at 10:36
  • Hi Rodrigo - I m still not quite sure it doesn't show me any image - I need an image for June 24 2018 from sentinel-2 within the following location (coordinates) 1: [130.887,-12.669] 2: [130.887,-12.927] 3: [131.156,-12.927] 4: [131.156,-12.669]- would be super appreciative if you could show me in a code how to write to find it . for some reason I receive nothing. Problem with the filer date command is that if filters out a specific date range – Mary Apr 3 at 10:54
  • OK, update the question and post the code you've tried and why it isn't working, what you see and what you expect – Rodrigo E. Principe Apr 3 at 11:01
  • // Load sent 2 data, filter by date and bounds. var collection = ee.ImageCollection('sent2') .filterDate('2018-04-25', '2018-06-5') .filterBounds(ee.Geometry.Point((130.887, -12.669), (130.887, -12.927), (131.156, -12.927), (131.156, -12.669)); – Mary Apr 3 at 11:07
  • It didn't like my code at all I think the last line specifying geometry has a cross alltogether – Mary Apr 3 at 11:08
0

You are trying to construct a point using many pairs of coordinates (lon, lat). Maybe you want a Polygon:

var polygon = ee.Geometry.Polygon([[130.887, -12.669], [130.887, -12.927],[131.156, -12.927], [131.156, -12.669]])
Map.addLayer(polygon)
Map.centerObject(polygon)

// Then, filter collection
// Load sent 2 data, filter by date and bounds. 
var collection = ee.ImageCollection('COPERNICUS/S2') 
                   .filterDate('2018-04-25', '2018-06-5') 
                   .filterBounds(polygon)
print(collection)
  • Awesome thanks soso much Rodrigo! this was the big problem for me I somehow couldn't get the polygon loaded but just pasted your code and it worked :) saved my day! – Mary Apr 3 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.