[MapProxy] Unicode support in layer names?
Rahkonen Jukka (MML)
jukka.rahkonen at maanmittauslaitos.fi
Tue Mar 24 05:28:52 PDT 2015
Hi Anders,
Oliver was referring to source name in MapProxy configuration. In your old mail you told you are using
layers:
- name: Other-objects
title: Other objects
sources: ['wms_trans:Øvrige_objekter']
Oliver was suggesting to use simple name 'wms_trans' for source and define the layer name of the remote server inside source definition
>layers:
> - name: Other-objects
> title: Other objects
> sources: ['wms_trans']
>
>sources:
> wms_trans:
> req:
> layers: Øvrige_objekter
> url: ...
Did you try this?
Layer name in WMS service can be any string. However, in other OGC services rules are more strict (Feature type names in WFS and coverage identifiers in WCS 2.x). If you ever configure your own server, use only names that are good as NCName http://stackoverflow.com/questions/1631396/what-is-an-xsncname-type-and-when-should-it-be-used. You can always use titles and abstracts for humans and reserve names for computers.
-Jukka Rahkonen-
Anders Sparre Jakobsen wrote:
>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
_______________________________________________
MapProxy mailing list
MapProxy at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapproxy
More information about the MapProxy
mailing list