4

I need to analyze the area defined by a polygon that I drew (call it 'X') of the images of Modis Terrra. What is the difference between filtering bounds and clipping to define the area of interest?

I'm confused about the following alternatives:

option 1.

var areaofinterest=ee.ImageCollection('NASA/OCEANDATA/MODIS-Aqua/L3SMI');
.filterBounds(X) '

or option 2.

var aux=ee.ImageCollection('NASA/OCEANDATA/MODIS-Aqua/L3SMI')';
var areaofinterest=aux.clip(X)  ;

The main question is: what are the differences between the two methods?

  • When I do option 1 and then Map.AddLayer(areaofinterest) I don't get displayed the area of interest, but the map of the product over the whole world - so I guess something is wrong.
  • When I do option 2 I get the error: aux.clip is not a function in <global>
  • Hi, I see you're new to SO. If you feel an answer solved the problem, please mark it as 'accepted' by clicking the green check mark. This helps keep users focused on answer questions which still don't have accepted answers. – Tyler Erickson Jan 6 at 19:42
9

Clip sets the mask of the image outside the geometry with which you're clipping to zero. Note that clip() is a function on images (NOT image collections). On the other hand, filterBounds() passes elements of the input collection that have geometries intersecting the geometry with which you're clipping. If the images in the collection are global composites (e.g. MODIS images), then filterBounds() won't do anything.

  • Thank you Nicholas, for some reason my question was put on hold as too broad by the community manager, but your answer makes it clearer. I am indeed using MODIS and that might be why I'm not getting anything. If clip() is not a function of image collections - how can I do the clipping for an image collection? – Raimundo Jul 19 '17 at 14:34
  • 4
    imageCollection.map(function(image) { return image.clip(geometry); }); – Nicholas Clinton Jul 19 '17 at 18:22

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.