[gdal-dev] Generate a KML-overlay from a Geotiff file

katrin eggert katrineggert1980 at gmail.com
Mon Oct 31 09:59:53 EDT 2011


Hi
I just did what you have told me and I got this error:

usage: Usage: gdal2tiles.py [options] input_file(s) [output]

gdal2tiles.py: error: Please convert this file to RGB/RGBA and run
gdal2tiles on the result.

>From paletted file you can create RGBA file (temp.vrt) by:
gdal_translate -of vrt -expand rgba /home/anrr/NDVI_rescaled2.tif temp.vrt

Any tips?

2011/10/28 Chaitanya kumar CH <chaitanya.ch at gmail.com>

> Kat,
>
> Your input image is of 32-bit float type. Whereas KML tiles are supposed
> to be png format that should be viewable on browsers.
> The corrupted pixels are a result of clipping the float valued pixels to
> the range [0,255].
>
> I suggest scaling the pixel values to byte type using the -scale option in
> gdal_translate.
>
>
> On Fri, Oct 28, 2011 at 7:34 PM, katrin eggert <katrineggert1980 at gmail.com
> > wrote:
>
>> Hi
>> Gdalinfo reproject.tif
>>
>> Driver: GTiff/GeoTIFF
>> Files: reprojected.tif
>> Size is 3700, 3500
>> Coordinate System is:
>> GEOGCS["WGS 84",
>>     DATUM["WGS_1984",
>>         SPHEROID["WGS 84",6378137,298.257223563,
>>             AUTHORITY["EPSG","7030"]],
>>         AUTHORITY["EPSG","6326"]],
>>     PRIMEM["Greenwich",0],
>>     UNIT["degree",0.0174532925199433],
>>     AUTHORITY["EPSG","4326"]]
>> Origin = (34.001088235352334,-19.571332568602660)
>> Pixel Size = (0.000204639356437,-0.000204639356437)
>> Metadata:
>>   AREA_OR_POINT=Area
>> Image Structure Metadata:
>>   INTERLEAVE=BAND
>> Corner Coordinates:
>> Upper Left  (  34.0010882, -19.5713326) ( 34d 0' 3.92"E, 19d34'16.80"S)
>> Lower Left  (  34.0010882, -20.2998487) ( 34d 0' 3.92"E, 20d17'59.46"S)
>> Upper Right (  34.7715554, -19.5713326) ( 34d46'17.60"E, 19d34'16.80"S)
>> Lower Right (  34.7715554, -20.2998487) ( 34d46'17.60"E, 20d17'59.46"S)
>> Center      (  34.3863218, -19.9355906) ( 34d23'10.76"E, 19d56' 8.13"S)
>> Band 1 Block=3765x1 Type=Float32, ColorInterp=Gray
>>
>> and gdal2tile
>> >python gdal2tiles.py -k /home/user/reprojected.tif  /home/user/gdal2tile
>>
>>
>>
>>
>>
>>
>> 2011/10/28 Chaitanya kumar CH <chaitanya.ch at gmail.com>
>>
>>> Kat,
>>>
>>> Please provide the whole command you used and the output of gdalinfo on
>>> your input file.
>>>
>>> On Fri, Oct 28, 2011 at 4:34 PM, katrin eggert <
>>> katrineggert1980 at gmail.com> wrote:
>>>
>>>> Hi
>>>> I have used gdal2tile.py like this
>>>> python gdal2tile.py -k [input] [output] and the tiels that are
>>>> generated are nothing to do with the input image. It has changed the image
>>>> by almost plotting random values pixels.
>>>> Is there any limitation regarding inpu timage (e.g. it must be integer
>>>> or something like this)?
>>>>
>>>> Thanks
>>>> Kat
>>>>
>>>> _______________________________________________
>>>> gdal-dev mailing list
>>>> gdal-dev at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>>>
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Chaitanya kumar CH.
>>>
>>> +91-9494447584
>>> 17.2416N 80.1426E
>>>
>>
>>
>
>
> --
> Best regards,
> Chaitanya kumar CH.
>
> +91-9494447584
> 17.2416N 80.1426E
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20111031/4f35b644/attachment-0001.html


More information about the gdal-dev mailing list