0

I want to export a strip image in GEE, and the image I want to export looks like: enter image description here

The export code is:

    Export.image.toDrive({
      image: img,
      description: descp,
      scale: 30,
      folder: folder,
      fileFormat: 'TFRecord',
      region: img.geometry(),
      formatOptions: {
        'patchDimensions': [256, 256],
        maxFileSize: 104857600,
        compressed: true,
      },
      skipEmptyTiles: true,
    });

However, when I read the exported tfrecord files, I still get a lot of image patches which are full of zero values. So I'm wondering how can I avoid this kind of situation?

1 Answer 1

0

Regardless of your roi shape the export happens with the bounding box of your roi with everything outside given value of masked value, 0 in most cases. In case of exporting to TFRecords exports it even adds a few padding to make all the patches consistent so that you don't end up with a 256x10 patch somewhere around the edges. So, its done to follow the data standard and is not something that should be "avoided". This actually ensures that your data remains geo-referenced as TFRecords (and TIFs as well) are actually just matrix of data with the coordinate information on another file (or in metadata for geo-tifs).

1
  • I see. Thank you for your reply. =)
    – Mr_C
    Commented Aug 13, 2019 at 12:47

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.