I am using Google Earth Engine to reduce a raster region to polygon vectors. What I want to achieve is:
- Obtain a set of polygons each of which matches the grid of measurement in the raster dataset. If the raster dataset's measurements are 0.25 x 0.25 degree, I want to break up the region in the map to polygons that align with these 0.25 x 0.25 degree grids.
Here's how I am doing the raster to vector conversion:
// a "geometry" polygon is imported
var raster_features = ee.ImageCollection('ECMWF/ERA5/DAILY')
.select('maximum_2m_air_temperature')
.filterBounds(geometry)
.filterDate('2017-01-01', '2018-12-31');
var mean_features = raster_features.mean().multiply(10000).toInt();
var scale_to_use = mean.projection().nominalScale();
var vector_features = mean_features.reduceToVectors({
reducer : null,
geometry : geometry,
//scale: 28000,
scale: scale_to_use,
crs :mean.projection().getInfo().crs,
//crsTransform :mean_features.projection().getInfo().transform,
geometryType: 'polygon',
labelProperty : 'grid',
eightConnected: false
});
Map.addLayer(vector_features, {}, 'vector_features')
The resolution of ECMWF/ERA5/DAILY dataset is 0.25 arc degrees. I was expecting the length and breadth of the grids returned by reduceToVectors
to be 0.25 deg, but they are 1 deg instead. I want to get polygons in the resolution that the dataset is in, which is 0.25 degree. How do I achieve that?
reopen
button to nominate it for reopening.