Skip to content

Pixel values in the masked area change from 'masked' to 0 during image export using geemap.ee_export_image_to_drive() #1857

Closed Answered by jdbcode
DKchenliyuan asked this question in Q&A
Discussion options

You must be logged in to vote

You should be able to use the formatOptions.noData option to set the nodata value in GeoTIFF exports.

Based on your example, you'd do something like this:

# unmask the masked pixels - set to -9999 in this example
nodata = -9999
test_int = test_int.unmask(nodata)

geemap.ee_export_image_to_drive(friction_motorized_reproj, \
                                description = 'test_int', \
                                region = roi, \
                                crs = export_projection, scale = export_projection.nominalScale(), \
                                maxPixels = 1e13, \
                                formatOptions = {"noData": nodata})  # <---- add this to set noData!

Here is a …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jdbcode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants