0

I am working on a vegetation type classification using random forest and Sentinel-2 imagery, and I would like to export my final output map (GeoTIFF) which contains 7 classes and some masked areas with no value. However, when exporting the data to my gee assets with the pyramiding policies set to MODE and comparing the output to the original map, I find lots of discrepancies. Also, when I downloaded the output map to my computer I noticed that the masked areas were joined with the first class.

Am I exporting it wrong? Does anyone know what is happening and how I could fix that?

I basically have a trained classifier that I apply on a sentinel-2 mosaic with multiple bands and export it like this:

var trainedClassifier = ee.Classifier.smileRandomForest(100).train({
  features: trainingSample,
  classProperty: label,
  inputProperties: bands
});    

var imgClassified = INPUT_IMAGE.classify(trainedClassifier).updateMask(tree_mask); 

var exportParams = {
  image: imgClassified,
  description: 'RF_my_map',
  assetId: 'users/myuserID/name',
  scale: 10,
  region: geometry,
  maxPixels: 2000000000
};
Export.image.toAsset(exportParams);
2
  • It would be nice if you could post your code (and a shared link from GEE) so others can track (and replicate) your error by following the steps you conducted in order to export the results.
    – Nikos
    Commented Aug 29, 2023 at 10:28
  • @Nikos Thanks for your reply! I updated my post with some snippets of my code
    – leeng
    Commented Aug 29, 2023 at 10:46

1 Answer 1

0

That code does not contain anything specifying the pyramiding policy. You need to add:

pyramidingPolicy: {".default": "mode"},

to the export.

1
  • Thanks for your reply! I added this line but it does not change anything to the result. The exported map still looks a bit different. I tried all different pyramiding policies.
    – leeng
    Commented Sep 4, 2023 at 10:12

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.