thanks Dave, I didn't yet succeed but maybe now I'm not far from the
solution...(hope...)
What I did:

1) I tried the examples of Dane
(http://mapnik-utils.googlecode.com/svn/trunk/tutorials/wms/)

2) I got a error "could not import rawdata", so, as suggested in a other
post I removed the references to rawdata in the file common.py:
I removed rawdata from the import and changed the line 286

im = fromstring('RGBA', (params['width'], params['height']),
rawdata(im))

to
 
im = fromstring('RGBA', (params['width'], params['height'])


3) now if I call the wms server from a browser I get a picture, but is a
picture of a error log which says:
file "/usr/lib/python2.5/site-packages/jon/common.py, line 286 in GetMap
im = im = fromstring('RGBA', (params['width'], params['height']))
TypeError; fromstring() takes at least 3 arguments (2 given)


- The apache error.log says (there are no errors, right?):

 registered datasource : postgis
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] registered
datasource : raster
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] registered
datasource : shape
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] size = 2
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1]
file=/home/tommaso/world_borders/world_borders
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] type=shape
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1]
Envelope(-180,-90,180,83.62359600000001)
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1]
file_length=3332172
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] shape_type=5
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1]
datasource=0x81bbce8 type=1
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] scale=0.0439453
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] start map
processing bbox=Envelope(-7.3388671875,33.75,18.5888671875,45)
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] scale denominator
= 1.74713e+07
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] start layer
processing : world
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] datasource =
0x81bbce8
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] ENCODING = utf-8
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] ENCODING = utf-8
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] end layer
processing
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] end map processing
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] 0.07 s
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1] 
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1]  destroyed
singleton 
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1]  destroyed
singleton 
[Tue Sep 23 23:33:50 2008] [error] [client 127.0.0.1]  destroyed
singleton 


- Finally, if I try to run the script /usr/lib/cgi-bin/wms/mapnikwms.py
I get:

$ /usr/lib/cgi-bin/wms/mapnikwms.py 
registered datasource : postgis
registered datasource : raster
registered datasource : shape
size = 2
file=/home/tommaso/world_borders/world_borders
type=shape
Envelope(-180,-90,180,83.62359600000001)
file_length=3332172
shape_type=5
datasource=0x81bc150 type=1
Content-Type: text/xml

<ServiceExceptionReport xmlns="http://www.opengis.net/ogc";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="1.3.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd";>
      <ServiceException>
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/jon/cgi.py", line 514, in
process
    handler.process(self)
  File "/usr/lib/python2.5/site-packages/mapnik/ogcserver/cgiserver.py",
line 57, in process
    onlineresource = 'http://%s:%s%s?' % (req.environ['SERVER_NAME'],
req.environ['SERVER_PORT'], req.environ['SCRIPT_NAME'])
  File "/usr/lib/python2.5/UserDict.py", line 22, in __getitem__
    raise KeyError(key)
KeyError: 'SERVER_NAME'
</ServiceException>
    </ServiceExceptionReport> destroyed singleton 
 destroyed singleton 
 destroyed singleton



cheers,
tommaso





On Tue, 2008-09-23 at 08:08 -0700, Dane Springmeyer wrote:
> 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
> 

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to