[gdal-dev] Re: How to use gdal_retile?

Christian Müller christian.mueller at nvoe.at
Mon Sep 1 07:55:58 EDT 2008


First, I can only talk about gdal_retile.py, I wrote this utility some times 
ago. 

1) Starting point is a single georeferenced image or a set of georeferenced 
tiles
2) The output is set of tiles and pyramid tiles
3) the -tileIndex and -tileIndexField  options give you the possibilty to
store the georeferencing information of the generated tiles in a shapefile.
 -tileIndex determines the name of the shape file, -tileIndexField determines 
the name of the attribute in the shape file which stores the name of 
corresponding tile.
This shape file can be used to
  a) check your tiles in a shape file viewer
  b) import your tiles into a db (e.g postgis) and import the shape file
     to store the georeferencing info.
  c) whatever you want ...
Here you can find an example:
http://docs.codehaus.org/display/GEOTOOLS/Image+Mosaicing+Pyramidal+JDBC+Plu 
gin 


I think this does not solve your problem because there is no support for
TMS output. This could be done but would be overlapping with the work of
gdal2tiles.py. As far as I see gdal2tiles.py handles only a single 
inputfile. I think you should try to create a big image using gdal_merge.py 
and afterward try using gdal2tiles.py. 

Perhaps it would be a possibility to merge gdal_retile.py and gdal2tiles.py 
to have one powerfull utility, but this depends on the requirements of the 
communitiy. 

I hope I could help you 

christian 


Myeong Hun Jeong writes: 

> Dear lists.
> I want TMS service with openlayers and raster data.
> I have 136 tif files based on local TM coordination and each file
> is about 250 mega.
> First, I uesed gdal_retile.py
> For instance,
> python gdal_retile.py -v -of png -ps 256 256 -tileIndex index.shp
> -tileIndexField LOCATION -r bilinear -levels 6 -targetDir C:\tmp\raster
> --optfile C:\raster\tilelist.txt
> After finishing this script, I can have genereated png images and move these
> image files to Tomcat.
> Next, how to use these image with openlayers? If I use gdal2tiles.py and
> just one tif image file, I can see map images easily with openlayers.
> I don't know how to set up openlayers when I use gdal_retile.py. 
> 
> Another quesion is that when I run  gdal_retile.py script, I set up
> tileIndex index.shp -tileIndexField LOCATION. What do tileindex and
> tileindexField mean? when I use usually theses index shape file? 
> 
> Last question is that if gdal_retile.py is not a good way to TMS with
> openlayers, How to make hundreds of tif images to tile map image?
> First, python gdal_merge.py -o C:\raster\total.tif -v --optfile
> C:\raster\tilelist.txt
> Next, python gdal2tiles.py -publishurl http://myserver/dir/ -nogooglemaps
> -nokml -v C:\raster\total.tif  C:\tmp
> Is this process correct? 
> 
> Please, give me a good advice.
> Best regards,
> Jeong.
 



More information about the gdal-dev mailing list