I've just started having a play about with the new coveringGrid()
geometry function in Earth Engine but it seems to be exhibiting some strange behaviour.
When I run it for a feature, the result shows up correctly in the map, though when I try to use the result for subsequent operations there are features missing from the grid.
I've attached a link to the script highlighting it, where the black feature is the original shapefile input, the blue feature is the result of the coveringGrid()
function and what is visualised in in the Map in Earth Engine (i.e. the expected result), and the yellow feature is what is subsequently seen by GEE (cribbed by using getInfo()
).
Code sample and link below:
var RGIRegion='03'
var RGIpath='users/Jmleaglacio/RGI7alpha/RGI'+RGIRegion;
var RGIsimplifiedPath='users/Jmleaglacio/RGI7alpha/RGI'+RGIRegion+'_simplified1km';
// The input Feature
var RGIsimplified=ee.Feature(ee.FeatureCollection(RGIsimplifiedPath).first()).aside(print);
Map.addLayer(RGIsimplified)
//There are 22 blue squares, but only 12 are shown by the print statement
var RGIgridInitial=ee.FeatureCollection(ee.FeatureCollection(ee.Feature(RGIsimplified).geometry()
.coveringGrid('EPSG:3857',1000000))).aside(print)
print(RGIgridInitial)
Map.addLayer(RGIgridInitial,{color:'blue'}) //the expected result
Map.addLayer(ee.FeatureCollection(RGIgridInitial.getInfo()),{color:'yellow'}) //the actual result
https://code.earthengine.google.com/7ba22d963850a6134e92bcc50b8d5466