I want to create visualizations (static and timelapse) of MODIS etc. with a polar projection (such as WGS 84 / EPSG Alaska Polar Stereographic, as used by ArcticDEM Explorer) in Google Earth Engine.
When I create the animated thumbnail of a MODIS image collection and choose the polar CRS ('EPSG:5936'
), I get a big black hole in the middle of my scene, just like this GDAL example. I tried to clip the MODIS dataset to my ROI but GEE seems to behave oddly if you give it polygons too near to the north pole. For example, the geometry
object below renders both in the console and as an actual clipper as a thin line circling the globe. However, if I define a geometry as a latitudinally thin rectangle, I can get data close the North Pole to render (e.g. if I just clip Greenland I can get all of Greenland). You can see this in action if you increase the latitude of the point to be closer and closer to 90; paradoxically, higher latitudes will be rendered the lower the latitude that is chosen for the point center.
I noted that the ArcticDEM dataset, which comes with the stereographic projection, does not have this issue. So, I tried to reproject MODIS scenes before rendering them in case that was the issue (knowing that reprojection is advised against). But this results in a broken image thumbnail when printed to the console.
var geometry = ee.Geometry.Point([180, 90]).buffer(2500000);
// Display a clipped version of the mosaic.
Map.addLayer(geometry ,{}, "circle");
var arcticDEM = ee.Image('UMN/PGC/ArcticDEM/V3/2m_mosaic');
var collection = ee.ImageCollection("MODIS/006/MOD13Q1")
.filterDate('2018-01-01', '2019-01-01')
.select('NDVI')
//fails if reprojected
//.map(function(image) { return image.reproject('EPSG:5936', null, 250); })
.map(function(image) { return image.clip(geometry); });
// Visualization parameters.
var args = {
crs: 'EPSG:5936', // WGS 84 / EPSG Alaska Polar Stereographic
//crs: 'EPSG:3857', // Maps Mercator
dimensions: '300',
region: geometry,
min: -2000,
max: 8000,
palette: 'black, blanchedalmond, #8FBC8F, #006400',
framesPerSecond: 6,
};
var thumb = ui.Thumbnail({
image: collection,//try arcticDEM, it works!
params: args,
style: {
width: '300px'
}
});
print(thumb);
What's going on? How can I define an ROI that covers the Arctic Circle and actually renders (correctly re-projects?)?