Dane,

Actually I am after out-of-the-box solution, precompiled binaries, Windows 
installer and so, but I may be alone with my wish here.  I can render maps from 
OSM data with demo script generate_image.py, but they are a bit hard to use in 
GIS applications because the map area that is really rendered do not suit the 
LL coordinates that generate_image.py takes as input.  Now I am capturing the 
real coordinates from PostGIS log where SQL requests which are sent by Mapnik 
are recorded.  I cannot program with any language so I must try to be 
innovative in using existing tools.  I am familiar with WMS and that would give 
me just what I want: a possibility to feed in the bounding box and output image 
size (+ perhaps output projection) and get back an image which have exactly 
those extents.  An improved version of generate_image.py would make me just as 
happy.

-Jukka Rahkonen-


-----Alkuperäinen viesti-----
Lähettäjä: Dane Springmeyer [mailto:[EMAIL PROTECTED]
Lähetetty: ti 19.8.2008 20:41
Vastaanottaja: Rahkonen Jukka
Kopio: Mapnik users mailing-list
Aihe: Re: [Mapnik-users] [Mapnik-devel] Mapnik WMS setup
 
Jukka,

Yes, the Mapnik WMS server is an OGC server that meets the 1.1.1 and  
1.30 spec.

You are asking about http://trac.mapnik.org/wiki/OgcServer right?

The link I posted is just a sample configuration for the Ogcserver.

To generate reprojected output you just need to specify the  
'allowedepsgcodes=YOUR_DESIRED_EPSG_CODE' in the ogcserver.conf and  
then configure OpenLayers or your WMS client to request tiles based on  
that projection. The bbox should be handled fine.

As far as running on windows, if you can compile mapnik and the python  
binding for windows then the WMS server should be able to be  
configured within your apache setup.

Dane




On Aug 19, 2008, at 10:04 AM, Rahkonen Jukka wrote:

> Hi,
>
> Is this a proper WMS server which supports reprojection and returns  
> exactly the area that is requested with bbox?  Will it some day run  
> on Windows platform?
>
> -Jukka Rahkonen-
>
>
> -----Alkuperäinen viesti-----
> Lähettäjä: [EMAIL PROTECTED] puolesta: Dane  
> Springmeyer
> Lähetetty: ti 19.8.2008 19:40
> Vastaanottaja: Dane Springmeyer
> Kopio: Mapnik users mailing-list
> Aihe: Re: [Mapnik-users] [Mapnik-devel] Mapnik WMS setup
>
> Mapnik Users,
>
> Just in case anyone else was having this problem, note that the bug
> with WMS image errors was fixed thanks to Dave's recent changeset 
> (http://trac.mapnik.org/changeset/
> 714) in svn trunk.
>
> Based on the now working WMS server in trunk I've posted a sample WMS
> setup here:
>
> http://mapnik-utils.googlecode.com/svn/trunk/serverside/wms/
>
> I've yet to get the GetFeatureInfo working properly (in terms of
> unicode decoding issues), but I'll post separately on that.
>
> Cheers,
>
> Dane
>
>
> On Apr 15, 2008, at 9:04 PM, Dane Springmeyer wrote:
>
>> 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-devel mailing list
>> [EMAIL PROTECTED]
>> https://lists.berlios.de/mailman/listinfo/mapnik-devel
>
>




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

Reply via email to