<tt><font size=2>Hello all,<br>
 &nbsp; &nbsp;I'm running into an issue reprojecting a single band geotif
in python. <br>
My code works fine on pixel types other than signed byte. &nbsp;What I'm
seeing<br>
is that the interpolation that includes a nodata pixel uses the literal<br>
nodata value (-128 is the nodata but I think this is being interpreted
as<br>
128). &nbsp;In my example I have a grid with values between 0 and 60 and
areas of<br>
nodata. &nbsp;Pixels bordering the nodata areas have values up to 126 in
the<br>
output. &nbsp; I've also tried to recreate this process using gdalwarp
and I<br>
think I'm getting the same problem.<br>
<br>
Thanks for any help or projections. &nbsp;FYI I'm on GDAL 1.8<br>
<br>
Attached are the small test files I'm using. &nbsp;BigSage.tif is the input,<br>
template2.tif has the projection info and extent I'm using for the output,<br>
output.tif is what I'm getting.<br>
</font></tt><a href="http://osgeo-org.1560.n6.nabble.com/file/n4967005/BigSage.tif"><tt><font size=2>http://osgeo-org.1560.n6.nabble.com/file/n4967005/BigSage.tif</font></tt></a><tt><font size=2>
BigSage.tif <br>
</font></tt><a href="http://osgeo-org.1560.n6.nabble.com/file/n4967005/template2.tif"><tt><font size=2>http://osgeo-org.1560.n6.nabble.com/file/n4967005/template2.tif</font></tt></a><tt><font size=2><br>
template2.tif &nbsp;</font></tt><a href="http://osgeo-org.1560.n6.nabble.com/file/n4967005/output.tif"><tt><font size=2>http://osgeo-org.1560.n6.nabble.com/file/n4967005/output.tif</font></tt></a><tt><font size=2><br>
output.tif <br>
<br>
Below is a striped down version of my code:<br>
tifDriver = gdal.GetDriverByName(&quot;GTiff&quot;)<br>
tmpOutDataset = tifDriver.Create(tmpOutput, width, height, 1, gdal.GDT_Byte,<br>
[&quot;PIXELTYPE=SIGNEDBYTE&quot;])<br>
#omited code to set cell size, geotransform, NoData, projection<br>
tmpOutDataset.GetRasterBand(1).PixelType = &quot;SIGNEDBYTE&quot;<br>
tmpOutDataset.GetRasterBand(1).SetMetadata({'PIXELTYPE': 'SIGNEDBYTE'},<br>
'IMAGE_STRUCTURE')<br>
<br>
err = gdal.ReprojectImage(srcDs, tmpOutDataset, sourcesrs.ExportToWkt(),
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;templatesrs.ExportToWkt(),<br>
gdal.GRA_Bilinear)<br>
<br>
<br>
--<br>
View this message in context: </font></tt><a href="http://osgeo-org.1560.n6.nabble.com/python-gdal-gdal-ReprojectImage-not-masking-NoData-in-signed-byte-geotifs-tp4967005.html"><tt><font size=2>http://osgeo-org.1560.n6.nabble.com/python-gdal-gdal-ReprojectImage-not-masking-NoData-in-signed-byte-geotifs-tp4967005.html</font></tt></a><tt><font size=2><br>
Sent from the GDAL - Dev mailing list archive at Nabble.com.</font></tt>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">Colin Talbert<br>
GIS Specialist<br>
US Geological Survey - Fort Collins Science Center<br>
2150 Centre Ave. Bldg. C<br>
Fort Collins, CO 80526<br>
<br>
(970) 226-9425<br>
talbertc@usgs.gov<br>
</font>