mapnik/OGCServer

adapt to removal of "abstract" and "title" from layers in Mapnik 2.1.x

Closed this issue · 1 comments

Mapnik 2.1 will drop "abstract" and "title" from layers (and rules): mapnik/mapnik#992.

If this metadata is to be preserved a new mechanism will need to be devised to allow this to be added to layers.

Example map_factory.py:

import os
from ogcserver.WMS import BaseWMSFactory
from mapnik import Style, Layer, Map, load_map

class WMSFactory(BaseWMSFactory):
    def __init__(self):
        import sys
        base_path, tail = os.path.split(__file__)
        configpath = os.path.join(base_path, 'ogcserver.conf')
        file_path = os.path.join(base_path, 'mapfile.xml') 
        BaseWMSFactory.__init__(self, configpath=configpath)
        self.loadXML(file_path)
        self.finalize()

With "test" being the name of the layer, in ogcserver.conf:

[layer_test]
title=Test Layer
abstract=Test Layer description