[Tilecache] Memory Error with gdal datasource

Matt Bartolome mattxbart at gmail.com
Tue Nov 25 15:10:28 EST 2008


Ok, I got mapnik to render an image of the geotiff but when I try to
seed the layer using TileCache it bombs on the first attempt at
rendering a tile. I'm not sure what the difference would be in doing
the mapnik hello world example and the way tilecache is doing it
through tilecache_seed.py. They are almost identical except the bit in
TileCache's Mapnik.py that return the image data instead of
render_to_file like I have below. I've tried setting shhmax higher
than the 32mb default on my system but it still bombs. Ugh.

from mapnik import *

def test_mapnik():

    mapfile = 'mapnik-config/62851963.xml'
    map_output = 'hello_world_using_xml_config.png'
    m = Map(600, 600)
    load_map(m, mapfile)
    bbox = Envelope(Coord(6124093,1761898.25),
Coord(6637898,2175848.75))#san diego county
    m.zoom_to_box(bbox)
    render_to_file(m, map_output)

def test_tilecache():
    from TileCache import Client, Layer
    from TileCache.Service import Service
    service = Service.load("tilecache.cfg")
    Client.seed(service, service.layers["62851963"], levels=(0,14),
bbox=[6124093,1761898.25,6637898,2175848.75])


if __name__ == "__main__":

    test_mapnik()
    test_tilecache()


My tilecache.cfg is:

[cache]
base = /mnt/data-store/cache
type = Disk

[62851963]
type = Mapnik
layers = 62851963
mapfile = mapnik-config/62851963.xml
srs = EPSG:2230
debug = false

end of the strace I'm getting:

munmap(0x2aaab92d2000, 4096)            = 0
open("/usr/lib/python2.5/site-packages/TileCache-2.04-py2.5.egg/TileCache/Layers/Mapnik.py",
O_RDONLY) = 3
write(2, "  File \"/usr/lib/python2.5/site-"..., 118  File
"/usr/lib/python2.5/site-packages/TileCache-2.04-py2.5.egg/TileCache/Layers/Mapnik.py",
line 67, in renderTile
) = 118
fstat(3, {st_mode=S_IFREG|0755, st_size=3268, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2aaab92d2000
read(3, "# BSD Licensed, Copyright (c) 20"..., 4096) = 3268
write(2, "    ", 4    )                     = 4
write(2, "mapnik.render(m, im)\n", 21mapnik.render(m, im)
)  = 21
close(3)                                = 0
munmap(0x2aaab92d2000, 4096)            = 0
write(2, "MemoryError", 11MemoryError)             = 11
write(2, "\n", 1
)                       = 1
rt_sigaction(SIGINT, {SIG_DFL}, {0x2aaaaada4ac0, [], SA_RESTORER,
0x2aaaab03c540}, 8) = 0
close(4)                                = 0
munmap(0x2aaab92d1000, 4096)            = 0
munmap(0x2aaab765e000, 2268016)         = 0
munmap(0x2aaab7452000, 2144656)         = 0
munmap(0x2aaab7233000, 2223816)         = 0
munmap(0x2aaab7025000, 2153024)         = 0
exit_group(1)                           = ?


-Matt

On Mon, Nov 24, 2008 at 5:52 PM, Matt Bartolome <mattxbart at gmail.com> wrote:
> I've built an x64 instance of fedora8 on amazon's EC2 cloud with yum
> packages and the latest svn version of mapnik. I don't have any issues
> rendering vector data with the shape or postgis datasources but today
> ran into a "MemoryError" while rendering a ~290MB GeoTIFF with the
> gdal datasource.
>
> I can render the same geotiff on my 32bit RHEL5 setup without any issues.
>
> Any help or info would be much appreciated. I read Dane's messages
> from a while back about the mr. sid files and the same sort of error
> but didn't see any solution.
>
> Thanks,
> -Matt
>



More information about the Tilecache mailing list