<div dir="ltr">Hi Kyle<br>It might be a little bit of a detour for reaching your goal, but if you're already using gdal inside python you could use numpy masked arrays to fill in no data values. I do that for that goal. <br>
<br>here is a snippet from my code:<br><br>def ClipPolution(nameOfMask, nameOfPolutionRaster):<br> '''This function takes in two rasters, and returns a cliped raster, <br> with NULL (-9999) values<br> For all points out side of the domain of interest'''<br>
dataset = gdal.Open(nameOfPolutionRaster, GA_ReadOnly)<br> dataSetMask = gdal.Open(nameOfMask, GA_ReadOnly)<br> areaOfPolution = gdal_array.DatasetReadAsArray(dataset)<br> maska = gdal_array.DatasetReadAsArray(dataSetMask)<br>
clip = ma.MaskedArray(areaOfPolution, mask=maska)<br> cclip=ma.filled(clip,value=-9999)<br> WriteRaster('p4masked.asc', cclip)<br> print 'Successfuly Cliped polution Raster...'<br><br>you can find more stuff here:<br>
<br><a href="http://docs.scipy.org/doc/numpy/reference/maskedarray.html">http://docs.scipy.org/doc/numpy/reference/maskedarray.html</a><br><br>Hope it helps some how<br><br>Oz Nahum<br>Graduate Student<br>Center for Applied Geosciences<br>
University of Tuebingen<br><br>-- <br>----<br> Imagine there's no countries<br> It isn't hard to do<br> Nothing to kill or die for<br> And no religion too<br> Imagine all the people<br>
Living life in peace <br><br><br>
</div>