Hi Tommoso,

Glad you are closer.


On Sep 23, 2008, at 2:51 PM, tommaso wrote:

> thanks Dave,

Dane actually.

> 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/)
>

okay.

> 2) I got a error "could not import rawdata",

So that means you are running mapnik 0.5.0 or lower right?

You should clear out the files you've made local modifications to and  
just re compile mapnik from SVN Head.

That would be easier than trying to patch the code problems yourself  
(which the rawdata one is just one of several).

>
>
> 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)
>

I think this is a problem with your attempt to patch.

>
> - The apache error.log says (there are no errors, right?):
>
> registered datasource : postgis
> [..snip..]
> [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
>
>


Yup, no errors because it successfully rendered an image of an error  
(to fit the WMS spec). Kind of odd, but useful.


> - 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
>
>    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

That will not work because it must be run in a server instance.

I'd upgrade your mapnik on svn and then try again (and post back).

Cheers,

Dane



>
>
> 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