[MapProxy] Space in Layername

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[MapProxy] Space in Layername

Jäger, Frank (KRZ)
Hallo,
YAML: How to code a Space in  the layername?

sources: ["wms_src:the layer"]
sources: ["wms_src:the%20layer"]
sources: ["wms_src:the+layer"]
sources: ["wms_src:the_layer"]
sources: ["wms_src:the\ layer"]

  .. don't work.

MapProxy 1.4

Frank

_______________________________________________
MapProxy mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapproxy

smime.p7s (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] Space in Layername

Rahkonen Jukka (Tike)
Hi,

If you can control the WMS server, remove apaces because they are not allowed in WMS layer names
http://www.schemacentral.com/sc/xsd/t-xsd_QName.html
http://stackoverflow.com/questions/1631396/what-is-an-xsncname-type-and-when-should-it-be-used

However, if you can't control the server I hope you will find a workaround.

-Jukka Rahkonen-

Jäger, Frank (KRZ) wrote:
 

> Hallo,
> YAML: How to code a Space in  the layername?
>
> sources: ["wms_src:the layer"]
> sources: ["wms_src:the%20layer"]
> sources: ["wms_src:the+layer"]
> sources: ["wms_src:the_layer"]
> sources: ["wms_src:the\ layer"]
>
>   .. don't work.
>
> MapProxy 1.4
>
> Frank
_______________________________________________
MapProxy mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapproxy
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] Space in Layername

Oliver Tonnhofer-5
In reply to this post by Jäger, Frank (KRZ)
Hi,

On 10.12.2013, at 15:00, Jäger, Frank (KRZ) wrote:
> YAML: How to code a Space in  the layername?
>
> sources: ["wms_src:the layer"]

That should work. I tested it with MapProxy 1.6 and it made requests with proper URL encoding (i.e. "&layers=the+layer").
What URL do you see in the source requests logs or serve-develop output)?


Regards,
Oliver

--
Oliver Tonnhofer    | Omniscale GmbH & Co KG    | http://omniscale.com
http://mapproxy.org | https://github.com/olt    | @oltonn







_______________________________________________
MapProxy mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapproxy
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] Space in Layername

Jäger, Frank (KRZ)
> -----Ursprüngliche Nachricht-----
> Von: Oliver Tonnhofer [mailto:[hidden email]]
> Betreff: Re: [MapProxy] Space in Layername


> On 10.12.2013, at 15:00, Jäger, Frank (KRZ) wrote:
> > YAML: How to code a Space in  the layername?
> > sources: ["wms_src:the layer"]
>
> That should work. I tested it with MapProxy 1.6 and it made requests with
> proper URL encoding (i.e. "&layers=the+layer").
> What URL do you see in the source requests logs or serve-develop output)?
>
> Regards,
> Oliver
Maybe the problem is the WMS-Server. It's an ArcGIS 9 and - no - it's not under my control.

GetMap says: "Could not get any sources: no image returned from source WMS"

wms Feature Info answers:

<ServiceException code="LayerNotDefined">
Parameter 'layer(s)' contains unacceptable value: Umringe+Kreis
</ServiceException>

The '+' is there but has to be removed on servers side to fit the Layer-Name.

Frank
_______________________________________________
MapProxy mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapproxy

smime.p7s (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] Space in Layername

Rahkonen Jukka (Tike)
Hi,

I fear I was wrong with the acceptable layer names.

Typename in WFS 1.0.0 and 1.1.0 is of type QName and does not allow spaces
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd
However, layer names in WMS are of type string and spaces are OK
http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd

I have thought for years that OGC standards behave similarly with layer names and typenames but obviously they do not.

Thus ArcGIS server has acceptable layer names and the trouble is only in how to make MapProxy to pass them correctly. I hope this Mapserver thread gives some ideas for you.

http://osgeo-org.1560.x6.nabble.com/cascading-wms-and-layer-names-encoding-td5058504.html


-Jukka Rahkonen-


Jäger, Frank (KRZ) wrote:

>
> > -----Ursprüngliche Nachricht-----
> > Von: Oliver Tonnhofer [mailto:[hidden email]]
> > Betreff: Re: [MapProxy] Space in Layername
>
>
> > On 10.12.2013, at 15:00, Jäger, Frank (KRZ) wrote:
> > > YAML: How to code a Space in  the layername?
> > > sources: ["wms_src:the layer"]
> >
> > That should work. I tested it with MapProxy 1.6 and it made requests
> > with proper URL encoding (i.e. "&layers=the+layer").
> > What URL do you see in the source requests logs or serve-develop output)?
> >
> > Regards,
> > Oliver
>
> Maybe the problem is the WMS-Server. It's an ArcGIS 9 and - no - it's not under
> my control.
>
> GetMap says: "Could not get any sources: no image returned from source WMS"
>
> wms Feature Info answers:
>
> <ServiceException code="LayerNotDefined"> Parameter 'layer(s)' contains
> unacceptable value: Umringe+Kreis </ServiceException>
>
> The '+' is there but has to be removed on servers side to fit the Layer-Name.
>
> Frank
_______________________________________________
MapProxy mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapproxy
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] Space in Layername

Oliver Tonnhofer-5

On 11.12.2013, at 14:32, Rahkonen Jukka wrote:
> I fear I was wrong with the acceptable layer names.
>
> Typename in WFS 1.0.0 and 1.1.0 is of type QName and does not allow spaces
> http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd
> However, layer names in WMS are of type string and spaces are OK
> http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd
>
> I have thought for years that OGC standards behave similarly with layer names and typenames but obviously they do not.

Yeah, unfortunately the OGC only mentions "machine readable" and a programmer automatically thinks of identifiers as in variable/function names (alphanumerical with underscore), but the spec does not restrict the name to any characters.


> Thus ArcGIS server has acceptable layer names and the trouble is only in how to make MapProxy to pass them correctly. I hope this Mapserver thread gives some ideas for you.

I do think that MapProxy handles this right. But I might be wrong.

WMS query parameters are sent in an HTTP GET request as application/x-www-form-urlencoded data and this defines that spaces should be encoded as "+". WMS 1.1.0 clearly stated that ```[...] the space character (" ") is an exception, and shall be encoded as a plus sign ("+"). A server shall be prepared to decode any character encoded in this manner.```
WMS 1.1.1 only refers to the RFC 2396, but this RFC does not define the encoding of the query part.
WMS 1.3.0 made it clear again that "The server shall be prepared to decode any character escaped in this manner, and to decode the “+” character as a space."

So ArcGIS should handle a request for `...&layers=Umringe+Kreis&...` as a request for the layer "Umringe Kreis".


> http://osgeo-org.1560.x6.nabble.com/cascading-wms-and-layer-names-encoding-td5058504.html


Form the last mail:

>
> 2) mapfile encoding the layers list works fine
> [...]
> the original wms server logs this (iis):
>
> LAYERS=Albufeiras%25201ria%2cRegadio%2520EFMA%2520simples%2cAdu%25C3%25A7%25C3%25A3o%2520simples


This looks like it's encoded twice. It's hard to believe that IIS/ArcGIS are really expecting that and I don't know where they could have interpreted that in the spec. Any ArcGIS experts around?


Regards,
Oliver

--
Oliver Tonnhofer    | Omniscale GmbH & Co KG    | http://omniscale.com
http://mapproxy.org | https://github.com/olt    | @oltonn







_______________________________________________
MapProxy mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapproxy