use of shp2tile and ogrtindex

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Thu Aug 9 15:09:36 EDT 2007


Antonio wrote:
> Hi Stephen,
> yes I was using shp2tile to tile raster.
> So I tried with gdaltindex and it works.
> but how I can generate tiles using gdal?
> I need some command like shp2tile applied to the raster shapefile.
> I am not able to find any gdal command that do that.
> 
> Ciao Antonio

Antonio,

There is no single command that will do that today. I think what most 
people do is write a script to chop regular tiles out of the source 
tile. The script could be simple and just iterate over the extents of 
the source image(s) and chop tile out of that. It would call gdalwrap or 
maybe gdal_translate to do the actual chopping of the raster into 
smaller tiles. The script would just generate a sequence of commands 
that would then do the work.

-Steve W


> Stephen Woodbridge wrote:
>> Antonio wrote:
>>> Hi,
>>> I am using shp2tile to split my huge shapefile , after that I use 
>>> ogrtindex to generate the tileindex.
>>> So in my map file in the layer definition I set the keyword TILEINDEX 
>>> at this new tilendex shape just generated.
>>> This work fine for the layer with TYPE POLYGON but doesn't work with 
>>> RASTER layer.
>>> Some one could tell me why?
>>>
>>> thanks
>>>
>>> Antonio
>>>
>> I hope you are not trying to use shp2tile to tile rasters! :-0
>> As the name implies Shape 2 tiles is not the same as raster 2 tiles. 
>> gdal has tools that will let you do the equivalent to rasters. Also 
>> you need to use gdaltindex to build you tileindex for rasters.
>>
>> -Steve
> 



More information about the mapserver-users mailing list