[Tilecache] ImageLayer configuration problem
Бојан
crni.bombarder.17.45 at gmail.com
Wed Feb 23 02:18:01 EST 2011
Hello list,I`m a newbie in TileCache and Python and I have a problem in
configuring ImageLayer.
I have Python 2.7 (with PIL) and installed TileCache using this *The 5
minute guide to setting up TileCache on
Windows*<http://oegeo.wordpress.com/2008/03/08/the-5-minute-guide-to-setting-up-tilecache-on-windows/>and
it worked fine with default configuration.
I want to create tiles from image on my disk,but I failed in doing it.I
experimented a lot with various configuration examples I found on `net and
browse through archives,but I still get pink tiles.
Curently,my configuration (I`m only passing things I changed) looks like
this:
[fuf]
type=ImageLayer
file=/fuf/fd.jpg
bbox=0,0,7391,5487
filebounds=0,0,7391,5487
maxresolution=28.87109375 # 7391/256=28.87109375
and in index.htm:
map = new OpenLayers.Map( $('map'), {'maxResolution': 7391/256,
'maxExtent': new OpenLayers.Bounds(0, 0, 7391, 5487)});
layer = new OpenLayers.Layer.WMS( "ImageLayer", "/cgi-bin/tilecache.cgi?",
{layers: 'fuf', format: 'image/png'} );
I get following error message:
An error occurred: integer argument expected, got float
File "C:\Program Files\Apache Software
Foundation\Apache2.2\cgi-bin\TileCache\Service.py", line 343, in cgiHandler
format, image = service.dispatchRequest( params, path_info, req_method,
host )
File "C:\Program Files\Apache Software
Foundation\Apache2.2\cgi-bin\TileCache\Service.py", line 208, in
dispatchRequest
return self.renderTile(tile, params.has_key('FORCE'))
File "C:\Program Files\Apache Software
Foundation\Apache2.2\cgi-bin\TileCache\Service.py", line 138, in renderTile
data = layer.render(tile, force=force)
File "C:\Program Files\Apache Software
Foundation\Apache2.2\cgi-bin\TileCache\Layer.py", line 444, in render
return self.renderTile(tile)
File "C:\Program Files\Apache Software
Foundation\Apache2.2\cgi-bin\TileCache\Layers\Image.py", line 61, in
renderTile
sub = sub.resize(size, scaling)
File "C:\Python27\lib\site-packages\PIL\Image.py", line 1290, in resize
self.load()
File "C:\Python27\lib\site-packages\PIL\Image.py", line 1706, in load
self.im = self.im.crop(self.__crop)
If I change maxresolution=28.87109375 into maxresolution=28 (or
maxresolution=29) in my cfg file i get following error:
An error occurred: can't find resolution index for 14.435547. Available
resolutions are:
[28.0, 14.0, 7.0, 3.5, 1.75, 0.875, 0.4375, 0.21875, 0.109375, 0.0546875,
0.02734375, 0.013671875, 0.0068359375, 0.00341796875, 0.001708984375,
0.0008544921875, 0.00042724609375, 0.000213623046875, 0.0001068115234375,
5.340576171875e-05]
or
An error occurred: can't find resolution index for 14.435547. Available
resolutions are:
[29.0, 14.5, 7.25, 3.625, 1.8125, 0.90625, 0.453125, 0.2265625, 0.11328125,
0.056640625, 0.0283203125, 0.01416015625, 0.007080078125, 0.0035400390625,
0.00177001953125, 0.000885009765625, 0.0004425048828125,
0.00022125244140625, 0.000110626220703125, 5.53131103515625e-05]
Error messages are the same whether I use filebounds in decimal degrees
(37.97,43.956,39.526,45.046) or in pixels (0,0,7391,5487).
Thanks in advance,
Bojan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/tilecache/attachments/20110223/92e8c610/attachment.html
More information about the Tilecache
mailing list