Created
December 6, 2016 16:28
-
-
Save mhweber/d3291ee6f28e5bf2d89b002f50192f17 to your computer and use it in GitHub Desktop.
Set a specific value as nodata in a geotif using python georasters package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import georasters as gr | |
| data = gr.from_file('myraster.tif') | |
| data.nodata_value | |
| # assuming we want to set 0s to nodata- | |
| data2= gr.GeoRaster( | |
| data.raster, | |
| data.geot, | |
| nodata_value=0, | |
| projection=data.projection, | |
| datatype=data.datatype, | |
| ) | |
| data2.nodata_value | |
| data2.to_tiff('myraster_v2') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment