Stefan,<br><br>You can convert the integer codes to float values using a VRT file[1] for each gif file.<br>Create a VRT file with the ColorTable element. Add the SimpleSource to point to your gif and the SourceBand element as 3 to point to B band.<br>
<br>Once you create a VRT file for the GIF, you can use it like any other raster file. GDAL interprets the elements in it and applies the conversions internally. Use it with gdal_translate or gdalwarp (if you want to warp it to a new coordinate system) to create an ASCII Grid file.<br>
<br>[1]: <a href="http://www.gdal.org/gdal_vrttut.html">http://www.gdal.org/gdal_vrttut.html</a><br><br><div class="gmail_quote">On Mon, Jul 25, 2011 at 12:39 AM, Stefan Keller <span dir="ltr">&lt;<a href="mailto:sfkeller@gmail.com">sfkeller@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I have a raster/grid file transformation and conversion question:<br>
<br>
The input are hunddrets of GIF files which in fact are a grid about<br>
rainfall observations. The files have 8 BitsPerPixel (0..255). The B<br>
channel (integer value) from RGB obviously represents the<br>
precipitation intensity in [mm/h] according to a lookup table (0=&gt;0,<br>
1=&gt;0.2, 2=&gt;0.32, 3=&gt;0.5, 4=&gt;0.8, 5=1.3, 6=&gt;2, 7=&gt;5, 8=&gt;8 9=&gt;13 10=&gt;20,<br>
11=&gt;32, 12=&gt;50, 13=&gt;50, 14=&gt;80, 15=&gt;130).<br>
<br>
The GIF size (= grid size) is 400x400 pixel with a cell size of 1000m.<br>
The following is known about the geolocation (Switzerland,<br>
EPSG:21781/CH1903): xmin: 481000, ymin: 38000 and xmax: 881000, ymax:<br>
438000.<br>
<br>
The target format is ASCII Gridded (XYZ)? or Arc/Info ASCII Grid<br>
(AAIGrid), with e.g. the following on each line: &quot;481000 38000 0.32&quot;,<br>
meaning the transformed coordinates x and y and the float value (as<br>
indicated above in the lookup table).<br>
<br>
I know OGR but I&#39;m new to GDAL: How would you accomplish this task?<br>
<br>
Transforming with gdal_transform then converting with gdal_translate ?<br>
Or do I have to write something myself (perhaps based on gdal2xyz.py)?<br>
<br>
-S.<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>