3

I'm trying to transfer the Modis_Sinusoidal projection to the WGS84 projection in the Google Earth Engine. But I failed. I want to know how to solve it.

var bp = ee.FeatureCollection("users/miaohu828/bankment_polygon"),
    modisLandcover = ee.ImageCollection("MODIS/006/MCD12Q1");    
Map.setCenter(116.05380098858659, 30.63744097417238, 6);
var filtered2018 = modisLandcover.filter(
ee.Filter.date('2018-01-01', '2018-12-31'))
var landcover2018 = ee.Image(filtered2018.first())
var classified2018 = landcover2018.select('LC_Type1')
// The input image has a SR-ORG:6974 (sinusoidal) projection.
// Operations *before* the reproject call will be done in the projection
// specified by reproject().  The output results in another reprojection.
var reprojected = classified2018
    .unitScale(-2000, 10000)
    .reproject('EPSG:4326', null, 500);
    var visParams = {min: 1, max: 17};
1
  • What happened when you ran the code that you have presented?
    – PolyGeo
    Commented May 23, 2021 at 12:11

1 Answer 1

4

I didn't understand what you want to achieve, but if you change min and max value in visParams something appears on the map.

var bp = ee.FeatureCollection("users/miaohu828/bankment_polygon");
var modisLandcover = ee.ImageCollection("MODIS/006/MCD12Q1");    
var filtered2018 = modisLandcover.filter(ee.Filter.date('2018-01-01', '2018-12-31'))
var landcover2018 = ee.Image(filtered2018.first())
var classified2018 = landcover2018.select('LC_Type1')
var reprojected = classified2018
    .unitScale(-2000, 10000)
    .reproject('EPSG:4326', null, 500);
var visParams = {min: 0.1665, max: 0.1681};

Map.setCenter(116.0538, 30.6374, 6);
Map.addLayer(reprojected, visParams, "Reprojected")
Map.addLayer(bp, {}, "bankment_polygon");

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.