[Mapserver-users] potential problem with layer names containi ng spaces
Daniel Morissette
morissette at dmsolutions.ca
Wed Nov 19 10:49:00 PST 2003
Tom Kralidis [Burlington] wrote:
> bartvde at xs4all.nl wrote:
>>
>>I have encountered a potential problem with layer names
>>containing spaces. This will lead to invalid GML responses
>>when requesting GetFeatureInfo in the GML format.
>>
>>What would be a good solution to overcome this?
>>
>
>
> This can also be painful to parse for some who wish to process
> GetFeatureInfo responses.
>
> Suggest to abstract the GetFeatureInfo reponse construct to not include data
> as element names and / or attributes, yet values of said.
>
> i.e.
>
> <Layer name="Groningen kust vlakken 2002">
> <Feature>
> ...
> </Feature>
> </Layer>
>
> ..Tom
>
>
But this is not valid GML, is it? We are talking about the GML response
format. Does GML (or WFS) provide a way to support spaces in feature
type names?
>
>
>>>a. when parsing the mapfile make sure no spaces are contained
>>>in layer names (or is this too rigorous for applications not
>>>using GML?)
>>>
>>>b. when generating the GML for GetFeatureInfo check the layer
>>>names or check if the generated GML is valid and well-formed?
>>>If the GML is not valid or not well-formed it is better to
>>>generate a WMS Exception I guess than generating invalid GML.
>>>
Replacing spaces with underscores in the layer names as we start
processing a WMS request might work but could cause confusion too.
Another important note is that this change would have to apply to the
GetCapabilities and GetMap requests as well.
Perhaps we should just add a test and a <!-- WARNING --> comment in the
Capabilities if any layer contains spaces (the same way we produce
warnings for other potential problems). Then it's up to the person
setting up the server to make sure their layer names don't contain spaces.
I think the WARNING would be the best route. If you agree then please
file a bug and I can easily add this in version 4.1
Daniel
--
------------------------------------------------------------
Daniel Morissette morissette at dmsolutions.ca
DM Solutions Group http://www.dmsolutions.ca/
------------------------------------------------------------
More information about the MapServer-users
mailing list