I'm working to get the WMS server running on Ubuntu with svn r.694.

I've run into OGCexceptions as the ogcserver can't find the default style. Also, since it seems that the default style is optional, I tried removing it. But then I get a WMS error that the image/png parameter is unknown. Same error if I try with image/jpeg.

I may be doing something wrong in either my script setup or my URL string. If so, I'm hoping that someone can point out what needs fixing.

However, I have a hunch that at least in terms of the image error, that this changeset may have broken the python bindings ability to render images via wms: http://trac.mapnik.org/changeset/618 Could it be that on in mapnik_image.cpp this code needs to be amended to take into account the image string 'image/png' or PIL_TYPE_MAPPING 'PNG' coming from the WMS?

if (format == "png") save_as_png(ss,im.data());
else if (format == "png256") save_as_png256(ss,im.data());
else if (format == "jpeg") save_as_jpeg(ss,85,im.data());

Anyway...configuration and errors below...

Thanks,
Dane


-----------------------

I'm using mod_fcgi which points to mapnikserv.py at 
http://www.salishseamap.net/mapnik/mapnikserv.py
Then mapnikserv.py points to ogcserver.conf which points to world_wms.py

### mapnikserv.py ###

#!/usr/bin/python

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

class WMSHandler(Handler):
    configpath = '/home/dane/wms/ogcserver.conf'

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


### ogcserver.conf ###
module=world_wms
epsg=4326


### world_wms.py ###

#!/usr/bin/python

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('#f2eff9')))
    rl.symbols.append(LineSymbolizer(Color('steelblue'),.1))
    sty.rules.append( rl )
    self.register_style('s', sty)

    lyr = Layer('world','+init=epsg:4326')
    lyr.title = 'World Borders'
    lyr.abstract = 'World Test'
    lyr.queryable = True
    lyr.datasource = Shapefile(file='/home/dane/wms/world_borders')
    lyr.styles.append('s') # Note: tried with and without this line

    self.register_layer(lyr,'s')
    self.finalize()


...then since everything seems to be working and no errors appear in the apache logs I try these urls:

### wms test url ###
http://www.salishseamap.net/mapnik/mapnikserv.py?VERSION=1.1.1&REQUEST=GetMap&LAYERS=world&FORMAT=image/png&SRS=EPSG:4326&STYLES=s&BBOX=-180,-90,180,90&EXCEPTIONS=application/vnd.ogc.se_xml&width=600&height=300

### apache logs ###

[Tue Apr 15 21:57:56 2008] [notice] FastCGI: process manager initialized (pid 4006) [Tue Apr 15 21:57:56 2008] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads. [Tue Apr 15 21:57:56 2008] [notice] mod_python: using mutex_directory / tmp [Tue Apr 15 21:57:56 2008] [notice] Apache/2.2.4 (Ubuntu) DAV/2 SVN/ 1.4.4 mod_fastcgi/2.4.2 mod_ssl/2.2.4 OpenSSL/0.9.8e mod_python/3.3.1 Python/2.5.1 mod_wsgi/2.0c5-TRUNK configured -- resuming normal operations
registered datasource : raster
registered datasource : shape
registered datasource : gdal
registered datasource : postgis
size = 2
file=/home/dane/wms/world_borders
type=shape
Envelope(-180,-90,180,83.62359600000001)
file_length=3332172
shape_type=5
datasource=0x81b2088 type=1


### WMS response ###
OGCException: ('Invalid style "s" requested for layer "world".', 'StyleNotDefined')



then I tried this url....

### wms test url with layer parameter blank ###

http://www.salishseamap.net/mapnik/mapnikserv.py?VERSION=1.1.1&REQUEST=GetMap&LAYERS=world&FORMAT=image/png&SRS=EPSG:4326&STYLES=&BBOX=-180,-90,180,90&EXCEPTIONS=application/vnd.ogc.se_xml&width=600&height=300

### apache logs ###

size = 2
file=/home/dane/wms/world_borders
type=shape
Envelope(-180,-90,180,83.62359600000001)
file_length=3332172
shape_type=5
datasource=0x8399f30 type=1
scale=0.6
start map processing bbox=Envelope(-180,-90,180,90)
scale denominator = 2.38542e+08
start layer processing : world
datasource = 0x8399f30
ENCODING = utf-8
 total shapes read=3784
ENCODING = utf-8
 total shapes read=3784
end layer processing
end map processing
2.47 s


### WMS response ###
RuntimeError: unknown format: image/png





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

Reply via email to