hallo List,

I'trying to set up the Mapnik WMS server 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?

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
<type 'exceptions.TypeError'>: register_layer() takes at least 3 arguments
(2 given)
/opt/mapnik/worldMapFactory.py in __init__(self=<worldMapFactory.WMSFactory
instance at 0x834240c>)
   14           self.register_style('style1', sty)
   15                 lyr = Layer('world')
   16                 lyr.datasource =
Shapefile(file='/home/srvadmin/src/mapnik/world_borders/world_borders')
   17                 lyr.styles.append('style1')
   18                 self.register_layer(lyr)
   19                 self.finalize()
   20
self = <worldMapFactory.WMSFactory instance at 0x834240c>,
self.register_layer = <bound method WMSFactory.register_layer of
<worldMapFactory.WMSFactory instance at 0x834240c>>, lyr =
<mapnik._mapnik.Layer object at 0x833ecfc>
/usr/lib/python2.5/site-packages/mapnik/ogcserver/cgiserver.py in
__init__(self=<__main__.WMSHandler object at 0x833dfec>)
   44         except ImportError:
   45             raise ServerConfigurationError('The factory module could
not be loaded.')
   46         if hasattr(mapfactorymodule, 'WMSFactory'):
   47             self.mapfactory = getattr(mapfactorymodule,
'WMSFactory')()
   48         else:
   49             raise ServerConfigurationError('The factory module does
not have a WMSFactory class.')
   50         if conf.has_option('server', 'debug'):
self = <__main__.WMSHandler object at 0x833dfec>, self.mapfactory undefined,
getattr undefined, mapfactorymodule = <module 'worldMapFactory' from
'/opt/mapnik/worldMapFactory.py'>
/usr/lib/python2.5/site-packages/jonpy-0.06-py2.5.egg/jon/cgi.py in
process(self=<jon.cgi.CGIRequest object at 0x831c74c>)
  614     """Read the CGI input and create and run a handler to handle the
request."""
  615     self._init()
  616     try:
  617       handler = self._handler_type()
  618     except:
  619       self.traceback()
  620     else:
handler undefined, self = <jon.cgi.CGIRequest object at 0x831c74c>,
self._handler_type = <class '__main__.WMSHandler'>
Content-Type: text/html; charset=iso-8859-1

<html><head><title>Error</title></head>
<body><h1>Error</h1>
<p>Sorry, an error occurred. Please try again later.</p>
</body></html> destroyed singleton
 destroyed singleton
 destroyed singleton


Hier ist the script I'trying to run

#!/usr/bin/env python

# Your mapnik dir containing the map factory
# must be in the python path!

*import sys
sys.path.append('/opt/*mapnik*')

from mapnik.ogcserver.cgiserver import Handler
import jon.fcgi as fcgi

class WMSHandler(Handler):
    configpath = '/opt/mapnik/ogcserver.conf'

fcgi.Server({fcgi.FCGI_RESPONDER: WMSHandler}).run()



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

Reply via email to