[MapProxy] Unicode support in layer names?

Anders Sparre Jakobsen ansj at hofor.dk
Tue Mar 24 05:13:59 PDT 2015


>Source names are required to be basic strings and so it warns when you use unicode chars in the tagged source name.
>
>Does it work when you specify the layer in the source definition?
>
>
>layers:
> - name: Other-objects
>   title: Other objects
>   sources: ['wms_trans']
>
>sources:
>  wms_trans:
>    req:
>      layers: Øvrige_objekter
>      url: ...
>
>
>
>Regards,
>Oliver


Hi Oliver

Apologies for not responding sooner.
When you say source names are required to be basic strings (I interpret it as English characters only), is this a limitation in Mapproxy or in the WMS specification itself? Do you perhaps know where in the specification this is specified?

When specifying the layer in the source part, I get the following traceback in the log:

2015-03-24 13:02:53,413 - CRITICAL - mapproxy.wsgiapp - fatal error in service for /service SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=723913.95367132953833789,6175639.64273229520767927,724190.26035532343667001,6175835.49541124422103167&SRS=EPSG:25832&WIDTH=1360&HEIGHT=965&LAYERS=Oevrige_Objekter&STYLES=&FORMAT=image/png&TRANSPARENT=TRUE
Traceback (most recent call last):
  File "C:\python27\lib\site-packages\mapproxy\wsgiapp.py", line 166, in __call__
    resp = self.handlers[handler_name].handle(req)
  File "C:\python27\lib\site-packages\mapproxy\service\ows.py", line 38, in handle
    return self.services[service].handle(req)
  File "C:\python27\lib\site-packages\mapproxy\service\base.py", line 30, in handle
    return handler(parsed_req)
  File "C:\python27\lib\site-packages\mapproxy\service\wms.py", line 112, in map
    renderer.render(merger)
  File "C:\python27\lib\site-packages\mapproxy\service\wms.py", line 484, in render
    layer_merger)
  File "C:\python27\lib\site-packages\mapproxy\util\async.py", line 204, in _single_call
    result = func(*args)
  File "C:\python27\lib\site-packages\mapproxy\service\wms.py", line 526, in _render_layer
    layer_img = layer.get_map(self.query)
  File "C:\python27\lib\site-packages\mapproxy\source\wms.py", line 62, in get_map
    resp = self._get_map(query)
  File "C:\python27\lib\site-packages\mapproxy\source\wms.py", line 89, in _get_map
    resp = self.client.retrieve(query, format)
  File "C:\python27\lib\site-packages\mapproxy\client\wms.py", line 55, in retrieve
    url = self._query_url(query, format)
  File "C:\python27\lib\site-packages\mapproxy\client\wms.py", line 80, in _query_url
    return self._query_req(query, format).complete_url
  File "C:\python27\lib\site-packages\mapproxy\request\base.py", line 422, in complete_url
    return self.url + delimiter + self.query_string
  File "C:\python27\lib\site-packages\mapproxy\request\wms\__init__.py", line 168, in query_string
    return self.adapt_params_to_version().query_string
  File "C:\python27\lib\site-packages\mapproxy\request\base.py", line 353, in query_string
    value = ','.join(str(v) for v in values)
  File "C:\python27\lib\site-packages\mapproxy\request\base.py", line 353, in <genexpr>
    value = ','.join(str(v) for v in values)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xd8' in position 0: ordinal not in range(128)

Best regards,
Anders


More information about the MapProxy mailing list