Skip to content

Instantly share code, notes, and snippets.

@mhweber
Created December 6, 2016 16:28
Show Gist options
  • Select an option

  • Save mhweber/d3291ee6f28e5bf2d89b002f50192f17 to your computer and use it in GitHub Desktop.

Select an option

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
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