[Mapserver-users] Problem with tileindex. Was: Converting from png to geotiff with gdal

David Monterroso Cabello pyro-x at ixine.com
Mon Jun 23 13:03:14 EDT 2003


Hi all

    Finally i managed to convert  the raster files (in png) to 
georefenced tiff files, i used the world files approach as Richard and 
others pointed out, and now i have a collection of tiff files  each one 
with a .wld file.

    After that if include one of these rectangles as an independent 
raster layer in my mapserver project it just render fine, i can navigate 
and do zooming all around that segment without problems.

    But, if i include the tileindex generated with the gdal utility the 
problems start, first the full map extent is rendered (that covers most 
of the rectangles) and it draws fine, but when i zoom into it, then some 
blank areas appears in the rendered image, if i keep zooming or paning 
these blank areas make bigger or smaller,  it seems like sometimes 
mapserver can't get some of the rectangles, but they are there cause i 
can see them if i pan or zoom out.

These is what i have in my map file:

  # Just ONE rectangle
  LAYER
    NAME "test_trafico"
    STATUS ON
    DATA "mad_443440-4473776_444544-4474880.tiff"
    TILEITEM "Location"
    TYPE RASTER
  END

# The whole tileindex
 LAYER
    NAME "tile_test"
    STATUS ON
    TILEINDEX "index.shp"
    TILEITEM "Location"
    TYPE RASTER
 END


   Have anyone experienced the same behaviour with tileindex?.


Many thanx in advance,

  
David Monterroso Cabello


Richard Greenwood wrote:

> At 09:51 PM 6/9/2003 +0200, you wrote:
>
>> Hi all
>>
>>     I want to include into mapserver a new layer based on a 
>> collection of raster files i have in PNG format, i know the extents 
>> values for each image ( they are named as this: 
>> mad_441600-4478928_442581-4479909.png ), it seems i need to convert 
>> them to tiff (or geotiff?) format so i can include them in my project 
>> and then make an index from them, but i can't just get along the 
>> first step.
>>
>>    I've tried using gdal utilities to convert them from png to a tiff 
>> with the geometry information using this:
>>
>> gdalwarp -s_srs EPSG:23030 -t_srs EPSG:23030 -te 444544 4481872 
>> 445525 4482853 mad_444544-4481872_445525-4482853.png test.tiff
>>
>> But instead of a brand new tiff image this is what i get :
>>
>> ERROR 1: Unable to compute a transformation between pixel/line
>> and georeferenced coordinates for mad_444544-4481872_445525-4482853.png.
>> There is no affine transformation and no GCPs.
>
>
> I would use gdal_translate rather than gdalwarp because you are not 
> trying to change the projection, but that is not your problem.
>
> The coordinates of the image are in the file name, but no software 
> that I am aware of is setup to read the coordinates in such a format. 
> You need to convert the coordinates into a world file (*.wld or 
> *.tfw). The world file is a separate, ASCII file having the same name 
> (but .wld or .tfw extension) as the image file. It containing the 
> coordinates of the upper left image pixel, the X and Y dimensions of 
> each image pixel, and the rotation (must be 0,0).
>
> So for each image you need to create this world file, either by hand 
> or by script.
>
> Rich
>
>
> Richard W. Greenwood, PLS
> Greenwood Mapping, Inc.
> Rich at GreenwoodMap.com
> (307) 733-0203
> http://www.GreenwoodMap.com 






More information about the mapserver-users mailing list