Filtering image collection based on footprint using Google Earth Engine

filtergoogle-earth-enginegoogle-earth-engine-javascript-api

I'm trying to filter an image collection by checking whether the footprint of the contained features only consists of 5 vertices. The following code snipped gives me 14 elements, although there should only be one (feature number 8 is the correct one):

var start_date = '2016-08-20';
var end_date = '2016-08-22';
var sentinel3 = ee.ImageCollection('COPERNICUS/S3/OLCI')
                  .filterDate(start_date, end_date)
                  .filterBounds(ee.Geometry.Point(90.4, 21.76))
                  .filterMetadata('timeliness', 'equals', 'NT')
                  .filterMetadata('groundTrackDirection', 'equals', 'descending')

The difference between a "real" result and an artifact is that artifacts have the following property: system:footprint: LinearRing, 5 vertices, where then the vertices are simply to bounds of the whole earth. For a real result, this property looks like this: system:footprint: LinearRing, 19 vertices. I don't know if there are always 19 vertices, but I'm definitely sure that every time there are only 5, I want to filter out this result.

Here are a number of additional filters I already tried:

.filterMetadata('system:footprint:coordinates:0', 'not_equals', [-180,-90])
.filterMetadata('system:footprint:coordinates:0:0', 'greater:than', -180)
.filterMetadata('coordinates:0', 'not_equals', [-180,-90])

Best Answer

You can't get there that way; there's no way to directly access the insides of the footprint from the filter (or the insides of any other property that's not a simple single value). You can filter out the ones that are global by discarding them if they intersect a point somewhere you don't care about, like the south pole:

.filter(ee.Filter.intersects(".geo", ee.Geometry.Point(-180, -90)).not())
Related Question