[mapserver-users] WMS call with layer names containing a space.

Jeff McKenna jmckenna at gatewaygeomatics.com
Thu Feb 4 09:19:31 PST 2016


I was just reading a recent discussion on this, might be the same 
discussion 
(http://osgeo-org.1560.x6.nabble.com/Allowing-spaces-in-layer-names-WMS-WFS-td5213960.html).

Bob can you file a little test case for this (tiny mapfile, commands to 
use to test), as a new ticket on the MapServer tracker? 
https://github.com/mapserver/mapserver/issues  I can't find an existing 
ticket, so we might as well record one.

-jeff



-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/



On 2016-02-04 12:51 PM, TC Haddad wrote:
> This came up last year and I don't know if it was ever resolved:
>
> https://lists.osgeo.org/pipermail/mapserver-users/2014-August/076870.html
>
> https://lists.osgeo.org/pipermail/mapserver-users/2014-August/076886.html
>
>
> On Thu, Feb 4, 2016 at 8:44 AM, Basques, Bob (CI-StPaul)
> <bob.basques at ci.stpaul.mn.us <mailto:bob.basques at ci.stpaul.mn.us>> wrote:
>
>     I was hoping there might be some tricky way of fooling MapServer by
>     encoding, etc.
>
>     bobb
>
>
>>     On Feb 4, 2016, at 10:39 AM, TC Haddad <tchaddad at gmail.com
>>     <mailto:tchaddad at gmail.com>> wrote:
>>
>>
>>     When querying the TIGER server directly from a browser, the first
>>     and third styles of request both work, while the option with the
>>     "+" does not. So those are the 2 options the server will accept.
>>
>>     I guess Mapserver prefers no space in a name, or a "+" to
>>     designate space, so you might be stuck.
>>
>>     As a best practice, they really should have the version with a
>>     space in the Title rather than the Name, but you can't fix that
>>     from your end.
>>
>>     On Thu, Feb 4, 2016 at 7:50 AM, Basques, Bob (CI-StPaul)
>>     <bob.basques at ci.stpaul.mn.us <mailto:bob.basques at ci.stpaul.mn.us>>
>>     wrote:
>>
>>         All,
>>
>>         I’m trying to use this WMS:
>>
>>         http://tigerweb.geo.census.gov/arcgis/services/TIGERweb/tigerWMS_ACS2015/MapServer/WMSServer?
>>
>>         Specifically, two layers, “Census Tracts” and “Census Tracts
>>         Labels”
>>
>>         I can open the service in just about everything, except
>>         Mapserver as a WMS client.  I’m assuming the problem is in how
>>         MapServer is sending it’s request.
>>
>>
>>         I must be missing something obvious.
>>
>>
>>         Thanks.
>>
>>         bobb
>>
>>
>>         Call1:
>>
>>         http://gis.ci.stpaul.mn.us/datasets/BOUNDARIES/CENSUS/TRACTS/census_tracts_wms.map?FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=Census
>>         <http://gis.ci.stpaul.mn.us/datasets/BOUNDARIES/CENSUS/TRACTS/census_tracts_wms.map?FORMAT=image/png&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=Census>Tracts&_OLSALT=0.8675355401581306&SRS=EPSG%3A4326&BBOX=-93.239,44.892,-92.977,44.993&WIDTH=1557&HEIGHT=865
>>         <http://gis.ci.stpaul.mn.us/datasets/BOUNDARIES/CENSUS/TRACTS/census_tracts_wms.map?FORMAT=image/png&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=Censu+Tracts&_OLSALT=0.48749308905327293&SRS=EPSG:200068&BBOX=550022.0283237,145619.55953757,593285.9716763,164199.44046243&WIDTH=971&HEIGHT=417>
>>
>>         error:
>>
>>         Parameter ‘layers’ contains unacceptable layer names
>>
>>
>>
>>         Call2 (use “+” for space):
>>
>>         http://gis.ci.stpaul.mn.us/datasets/BOUNDARIES/CENSUS/TRACTS/census_tracts_wms.map?FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=Census+Tracts&_OLSALT=0.8675355401581306&SRS=EPSG%3A4326&BBOX=-93.239,44.892,-92.977,44.993&WIDTH=1557&HEIGHT=865
>>         <http://gis.ci.stpaul.mn.us/datasets/BOUNDARIES/CENSUS/TRACTS/census_tracts_wms.map?FORMAT=image/png&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=Census+Tracts&_OLSALT=0.8675355401581306&SRS=EPSG:4326&BBOX=-93.239,44.892,-92.977,44.993&WIDTH=1557&HEIGHT=865>
>>
>>         error:
>>
>>         Parameter ‘layers’ contains unacceptable layer names
>>
>>
>>
>>         Call3 (URL encoding “%20” ):
>>
>>         http://gis.ci.stpaul.mn.us/datasets/BOUNDARIES/CENSUS/TRACTS/census_tracts_wms.map?FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=Census%20Tracts&_OLSALT=0.8675355401581306&SRS=EPSG%3A4326&BBOX=-93.239,44.892,-92.977,44.993&WIDTH=1557&HEIGHT=865
>>         <http://gis.ci.stpaul.mn.us/datasets/BOUNDARIES/CENSUS/TRACTS/census_tracts_wms.map?FORMAT=image/png&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=Census%20Tracts&_OLSALT=0.8675355401581306&SRS=EPSG:4326&BBOX=-93.239,44.892,-92.977,44.993&WIDTH=1557&HEIGHT=865>
>>
>>
>>         error:
>>
>>         Parameter ‘layers’ contains unacceptable layer names
>>
>>
>>
>>         ##Mapfile
>>
>>         MAP
>>
>>         STATUS ON
>>
>>         LAYER
>>         NAME "Census Tracts"
>>         TYPE RASTER
>>         STATUS DEFAULT
>>
>>         CONNECTION
>>         "http://tigerweb.geo.census.gov/arcgis/services/TIGERweb/tigerWMS_ACS2015/MapServer/WMSServer?"
>>
>>         CONNECTIONTYPE WMS
>>         METADATA
>>         "wms_srs" "EPSG:4326"
>>         "wms_name" "Census Tracts"
>>         "wms_server_version" "1.1.1"
>>         #"wms_server_version" "1.3.0"
>>         "wms_format" "image/png24"
>>
>>         "ows_title" "Census Tracts"
>>         #"gml_include_items" "all"
>>         END
>>         PROJECTION
>>         "init=epsg:4326"
>>         END
>>
>>         TEMPLATE "dummy"
>>         END #layer
>>
>>         ##CONFIG "MS_ERRORFILE" "/tmp/trying2.txt"
>>         ##DEBUG 5
>>
>>         END
>>
>>


More information about the mapserver-users mailing list