[gdal-dev] Problems with large raster sizes (WMS/TMS)

Tamas Szekeres szekerest at gmail.com
Thu Nov 12 17:49:34 EST 2009


Folks,

I've been testing with the WMS/TMS driver at large zoom levels
according to the following WMS XML file:

<GDAL_WMS>
    <Service name="TMS">
        <ServerUrl>http://web0.nearmap.com/maps/hl=en&x=${x}&y=${y}&z=${z}&nml=Vert</ServerUrl>
    </Service>
    <DataWindow>
        <UpperLeftX>-20037508.34</UpperLeftX>
        <UpperLeftY>20037508.34</UpperLeftY>
        <LowerRightX>20037508.34</LowerRightX>
        <LowerRightY>-20037508.34</LowerRightY>
        <TileLevel>20</TileLevel>
	<TileCountX>1</TileCountX>
	<TileCountY>1</TileCountY>
        <YOrigin>top</YOrigin>
    </DataWindow>
    <Projection>EPSG:900913</Projection>
    <BlockSizeX>256</BlockSizeX>
    <BlockSizeY>256</BlockSizeY>
    <BandsCount>3</BandsCount>
    <Cache />
</GDAL_WMS>

By setting the TileLevel to 19 everything is working fine. However
when I increase the TileLevel to 20 I always get the following error :
"Out of memory in InitBlockInfo()". This is beacause gdal tries to
pre-allocate the pointers for all tiles in the internal memory cache.

When I switch off the gdal internal memory cache (not too
straightforward but it could be done by overriding
TryGetLockedBlockRef an creating the blocks on the fly from the file
cache) then I can get TileLevel = 20 working. However when I set
TileLevel  to 23 I get : 'Invalid dataset dimensions : -2147483648 x
-2147483648'

IMO this issue is not only related to the GDAL WMS driver itself, it
seems like gdal is not much prepared to handle these large raster
sizes.

Any workaround, opinions?


Best regards,


Tamas


More information about the gdal-dev mailing list