Hi Tommaso,
Comments inline...
On Sep 23, 2008, at 3:17 AM, tommaso wrote:
hallo List,
I'trying to set up the Mapnik WMS server on Ubuntu 8.04.
Great, release 0.5.1 and svn trunk should run great on ubuntu 8.04
Mapnik works fine, but I'm getting errors by trying to start the WMS
server.
I followed the tutorial on the Perry Geo Blog:
http://www.perrygeo.net/wordpress/?p=49
First question: is the tutorial still valable? (it is 2 years
old...). Are there someware other documentation?
Yes, that tutorial is still valuable, although their may be aspects of
it that are slightly out of date (see below).
The only official docs for the WMS OGCServer are here:
http://trac.mapnik.org/wiki/OgcServer
http://trac.mapnik.org/browser/trunk/docs/ogcserver/readme.txt
The later of which should have come in your mapnik download.
I also maintain a working set of example setup scripts here:
http://mapnik-utils.googlecode.com/svn/trunk/tutorials/wms/
Hier ist the error message by trying to start the wms script in
the /usr/lib/fcgi-bin directory
[EMAIL PROTECTED]:/usr/lib/fcgi-bin$ ./wms
registered datasource : shape
registered datasource : raster
registered datasource : postgis
size = 2
file=/home/srvadmin/src/mapnik/world_borders/world_borders
type=shape
Envelope(-180,-90,180,83.62359600000001)
file_length=3332172
shape_type=5
datasource=0x838a6d8 type=1
jonpy error: <type 'exceptions.TypeError'> at Tue Sep 23 12:06:42 2008
ignore the above jonpy error...
<type 'exceptions.TypeError'>: register_layer() takes at least 3
arguments (2 given)
This above lack of a second function argument is your culprit.
Matt Perry's tutorial preceded this change:
http://trac.mapnik.org/changeset/284/trunk/bindings/python/mapnik/ogcserver/WMS.py
So, try changing the `self.register_layer(lyr)` line to:
self.register_layer(lyr,'style1') # since the register_layer()
function needs a default style argument.
Hope that helps,
Dane
This is the script /opt/mapnik/worldMapFactory.py
from mapnik.ogcserver.WMS import BaseWMSFactory
from mapnik import *
class WMSFactory(BaseWMSFactory):
def __init__(self):
BaseWMSFactory.__init__(self)
sty = Style()
rl = Rule()
rl.symbols.append(PolygonSymbolizer(Color(248,216,136)))
rl.symbols.append(LineSymbolizer(Color(0,0,0),1))
sty.rules.append( rl )
self.register_style('style1', sty)
lyr = Layer('world')
lyr.datasource = Shapefile(file='/home/srvadmin/src/
mapnik/world_borders/world_borders')
lyr.styles.append('style1')
self.register_layer(lyr)
self.finalize()
Thanks in advance!
tommaso
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users