Hi,
thanks Alexandre, my server is running now. But we had some troubles to get
him running in conjunction with my special XML-style. There are some
restrictions, which are not comfortable for us. Here a short summary:
1. The WMSFactory from the tracticket didn't worked. We had to change it to
this:
from mapnik.ogcserver.WMS import BaseWMSFactory
from mapnik import *
class WMSFactory (BaseWMSFactory):
def __init__ (self):
BaseWMSFactory.__init__(self)
self.loadXML ( "/mapnik/style.xml")
self.finalize ()
2. Added default styles so that they do not have to be specified each time
in the WMS request.
You have two possibilities:
* if style names = layer names, just do a WMS request as usual.
* if not, you have to specify your styles in the WMS request.
Detail: in /usr/lib/python2.4/site-packages/mapnik/ogcserver/cgiserver.py
def process(self, req):
reqparams = lowerparams(req.params)
if len( reqparams[ "styles" ] ) < 1:
reqparams[ "styles" ] = reqparams[ "layers" ]
.....
3. In the implementation, it was mandatory to have the styles named exactly
like the corresponding layers, which was making the WMS "STYLES" parameter
useless.
Removed the constraint by commenting out 2 lines in
/usr/lib/python2.4/site-packages/mapnik/ogcserver/common.py :
#if reqstyle and reqstyle not in layer.wmsextrastyles:
# raise OGCException('Invalid style "%s" requested for layer
"%s".' % (reqstyle, layername), 'StyleNotDefined')
cheers,
Jürgen
garraud.alexandre wrote:
>
> Hi
>
> I put up something that works but this is not yet integrated, look track
> 129: http://trac.mapnik.org/ticket/129 this can perhaps help you.
>
> Alexandre
>
> spillocaster a écrit :
>> http://en.wikipedia.org/wiki/Moin Moin list ;-),
>>
>> I'm also searching for method to use my XML with the ogcserver. It took a
>> few weeks to define the XML-style. My map is now prerendered with the
>> render-tiles script. Now I want to use the WMS-functionality, but I
>> discovered, that I cannot use my XML-style with the ogcserver.
>>
>> What can I do? Is the translation to python the only way out? Perhaps
>> there
>> is a translator or a patch?
>>
>> thanks,
>> Jürgen
>>
>>
>> Dane Springmeyer wrote:
>>> Alexandre,
>>>
>>> Being able to use the load_map() function within the WMS server would
>>> be excellent. I sense that the majority of the OGC Server was written
>>> before load_map() was exposed in the python bindings, thus that
>>> feature and several others are lacking integration.
>>>
>>> So, AFAICT it could require some modest reworking of the code logic,
>>> but making the OGCServer actually able to use load_map() would be a
>>> good improvement.
>>>
>>> Also, I saw you posted this ticket: http://trac.mapnik.org/ticket/128
>>>
>>> Can you comment on whether your issue is resolved?
>>>
>>> Thanks,
>>>
>>> Dane
>>>
>>>
>>> On Oct 2, 2008, at 8:05 AM, [EMAIL PROTECTED] wrote:
>>>
>>>> Someone he has already established a loading XML data for WMSFactory
>>>> class ?
>>>>
>>>> I would be the equivalent of load_map() but for WMSFactory.
>>>>
>>>>
>>>> Alexandre
>>>>
>>>> _______________________________________________
>>>> Mapnik-users mailing list
>>>> [email protected]
>>>> https://lists.berlios.de/mailman/listinfo/mapnik-users
>>>
>>> _______________________________________________
>>> Mapnik-users mailing list
>>> [email protected]
>>> https://lists.berlios.de/mailman/listinfo/mapnik-users
>>>
>
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users
>
>
--
View this message in context:
http://www.nabble.com/OGCSERVER-AND-XML-tp19781147p20789854.html
Sent from the Mapnik - Users mailing list archive at Nabble.com.
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users