0

I have a composite image (medianComposite) which is reprojected to CRS:'EPSG 32643'. The layer before projection can be visualized on the map. The projection has changed after reprojecting, but the reprojected layer can't be visualized. The following is the code used.

var s2 = ee.ImageCollection('COPERNICUS/S2_SR');
var geometry = ee.FeatureCollection('projects/ypm-rs-ml/assets/study_area');

var filtered = s2.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 10))
           .filter(ee.Filter.date('2019-01-01', '2019-1-31'))
           .filter(ee.Filter.bounds(geometry));
print('Filetered Collection', filtered, filtered.first().select('B1').projection());

var medianComposite = filtered.median();
print('Median Composite', medianComposite, medianComposite.projection());

var newCRS = 'EPSG:32643';
var medianCompositeReprojected = medianComposite.reproject(newCRS);
print('Median Composite Reprojected', medianCompositeReprojected, 
       medianCompositeReprojected.projection());

var rgbViz = {'min':0.0, 'max':3000, 'bands':['B4', 'B3', 'B2']};

Map.centerObject(filtered, 8);
Map.addLayer(geometry, rgbViz, 'geometry');
Map.addLayer(medianComposite, rgbViz, 'medianComposite');
Map.addLayer(medianCompositeReprojected, rgbViz, 'Median Composite Reprojected');

How do I fix this?

2
  • Is there an actual error message? Commented Dec 26, 2023 at 12:44
  • No error message, just that the layer is not visualized on the map.
    – rekha
    Commented Dec 29, 2023 at 15:12

1 Answer 1

0

Your table isn't shared, so I can't be sure, but most likely you're attempting to use the projection outside of its valid bounds. 'EPSG:32643' is only valid for 72° to 78° longitude.

Another possibility is that you're trying to view the composite at a significantly different zoom level than the scale in the forced reprojection (for EPSG:32643, that's 1m/pixel) and it's just taking forever. You can zoom in to ~1m and see if that makes it finish.

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.