If the transformation is just shifting and scaling you can set the GeoTransform element in the VRT file.<br>You can scale the pixel values using the Offset and Scale elements.<br><br><div class="gmail_quote">On Mon, Jul 25, 2011 at 5:24 PM, 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;">Hi Chaitanya kumar<br>
<br>
Many thanks for the hints. I kow VRT from OGR but was not sure if this<br>
works here too.<br>
<br>
What I'm still wondering is, how to accomplish the transformation.<br>
It's rather a coord. translation process not comparable to warping:<br>
<div class="im"><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>
</div>So I'd like to do some shifting and scaling before XY-coordinates are<br>
output (Z coming from the Colortable).<br>
<br>
Yours, S.<br>
<br>
<br>
2011/7/25 Chaitanya kumar CH <<a href="http://chaitanya.ch" target="_blank">chaitanya.ch</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>>:<br>
<div><div></div><div class="h5">> Stefan,<br>
><br>
> You can convert the integer codes to float values using a VRT file[1] for<br>
> each gif file.<br>
> Create a VRT file with the ColorTable element. Add the SimpleSource to point<br>
> 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<br>
> file. GDAL interprets the elements in it and applies the conversions<br>
> internally. Use it with gdal_translate or gdalwarp (if you want to warp it<br>
> to a new coordinate system) to create an ASCII Grid file.<br>
><br>
> [1]: <a href="http://www.gdal.org/gdal_vrttut.html" target="_blank">http://www.gdal.org/gdal_vrttut.html</a><br>
><br>
> On Mon, Jul 25, 2011 at 12:39 AM, Stefan Keller <<a href="mailto:sfkeller@gmail.com">sfkeller@gmail.com</a>> wrote:<br>
>><br>
>> 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>
><br>
><br>
><br>
> --<br>
> Best regards,<br>
> Chaitanya kumar CH.<br>
><br>
> +91-9494447584<br>
> 17.2416N 80.1426E<br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>