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"><<a href="mailto:sfkeller@gmail.com">sfkeller@gmail.com</a>></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=>0,<br>
1=>0.2, 2=>0.32, 3=>0.5, 4=>0.8, 5=1.3, 6=>2, 7=>5, 8=>8 9=>13 10=>20,<br>
11=>32, 12=>50, 13=>50, 14=>80, 15=>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: "481000 38000 0.32",<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'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>