<div dir="ltr"><div class="gmail_extra"><div>Hi Even,</div><div>That worked great.</div><div>It figures that I'd tried about 6 different permutations, including a few without "-hidenodata"; but none of them was the right one it seems.</div>
<div><br></div><div>It's no problem recreating the tifs as they're small test tifs that takes a few seconds to process.</div><div><br></div><div>Many thanks!<br>Jonathan</div><br><div class="gmail_quote">On 3 December 2013 16:02, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Selon Jonathan Moules <<a href="mailto:jonathanmoules@warwickshire.gov.uk">jonathanmoules@warwickshire.gov.uk</a>>:<br>
<div class="im"><br>
> Hi List,<br>
> I have a question about setting a value as "noData" in GeoTIFFs.<br>
><br>
> I'm creating a Geotiff with this two stage process (mosaicing a lot of<br>
> tiles together):<br>
><br>
> gdalbuildvrt -hidenodata -srcnodata 255 -vrtnodata 255 -input_file_list<br>
> >> tiff_list.txt 255.vrt<br>
> ><br>
> ><br>
> >> gdal_translate -of GTiff -co TILED=YES -co BIGTIFF=YES -co COMPRESS=JPEG<br>
> >> -co JPEG_QUALITY=80 -co BLOCKXSIZE=512 -co BLOCKYSIZE=512 -co<br>
> >> PHOTOMETRIC=YCBCR 255.vrt 255mask.tif<br>
> ><br>
> ><br>
> The resultant image is fine, but when I access it, both via ArcGIS and QGIS<br>
> it says that there is no noData value set.<br>
<br>
</div>Yes, and gdalinfo on 255mask.tif would report the same too. The reason is the<br>
"-hidenodata" flag in the gdalbuildvrt. Remove it and it should work as<br>
expected.<br>
<br>
You don't need to rebuild your 255mask.tif. Just try :<br>
<br>
python gdal_edit.py -a_nodata 255 255mask.tif (cf<br>
<a href="http://www.gdal.org/gdal_edit.html" target="_blank">http://www.gdal.org/gdal_edit.html</a>)<br>
<div class="im"><br>
><br>
> I've tried reading into it and came across this -<br>
> <a href="http://www.gdal.org/frmt_gtiff.html" target="_blank">http://www.gdal.org/frmt_gtiff.html</a> - but it requires a deeper level of the<br>
> GeoTIFF library than I have to make much sense of it.<br>
><br>
> I did see "GDAL_TIFF_INTERNAL_MASK" and tried to set it to true (using -co<br>
> and --config), but GDAL just complained about it not being a valid<br>
> configuration option.<br>
<br>
</div>Masks are more unusual and difficult to master.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Can GeoTiffs have a noData value in them that applications will see and<br>
> honour? If so, can I set it in GDAL?<br>
> It's not critically important, more nice-to-have and also trying to<br>
> understand the format better<br>
><br>
> Thanks,<br>
> Jonathan<br>
><br>
</div></div><span class="HOEnZb"><font color="#888888">> --<br>
> This transmission is intended for the named addressee(s) only and may<br>
> contain sensitive or protectively marked material up to RESTRICTED and<br>
> should be handled accordingly. Unless you are the named addressee (or<br>
> authorised to receive it for the addressee) you may not copy or use it, or<br>
> disclose it to anyone else. If you have received this transmission in error<br>
> please notify the sender immediately. All email traffic sent to or from us,<br>
> including without limitation all GCSX traffic, may be subject to recording<br>
> and/or monitoring in accordance with relevant legislation.<br>
><br>
<br>
<br>
</font></span></blockquote></div><br></div></div>
<br>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.</span>