I'm having trouble to change the projection using the GEE.
I have the following code:
var countries = ee.FeatureCollection("FAO/GAUL_SIMPLIFIED_500m/2015/level0");
var belgium = countries.filter(ee.Filter.eq('ADM0_NAME', 'Belgium'));
print(belgium) // Belgium is a Feature Collection
Map.addLayer(belgium);
Map.centerObject(belgium);
Then I calculate its area under the default reference system (WGS84):
var areaBelgium = belgium.geometry().area().divide(1e6).round();
print('Area in WGS84 (km2) - WGS84 - EPSG 4326:', areaBelgium);
I've been trying to do the same area calculation but using a Projected Coordinate System instead (Lambert EPSG:31370). For that goal, I've been using .transform() and .map(). Nonetheless, I don't get any results:
var lambert = ee.Projection('EPSG:31370');
// Define a function to apply the projection to each feature
var transformLambert = function(feature) {
return feature.transform(lambert);
};
// Map the transform function to the Feature Collection
var belgiumLambert = belgium.map(transformLambert);
var areaBelgiumLambert = belgiumLambert.geometry().area().divide(1e6).round();
print('Area in EPSG 31370 - Lambert:', areaBelgiumLambert);
I would like to calculate the area in Lambert EPSG 31370. Does anybody know what's wrong with this reprojection?