<div dir="ltr">how to use the mapserver to link the map</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 7, 2015 at 12:53 PM,  <span dir="ltr"><<a href="mailto:mapserver-users-request@lists.osgeo.org" target="_blank">mapserver-users-request@lists.osgeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send mapserver-users mailing list submissions to<br>
        <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:mapserver-users-request@lists.osgeo.org">mapserver-users-request@lists.osgeo.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:mapserver-users-owner@lists.osgeo.org">mapserver-users-owner@lists.osgeo.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of mapserver-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re: WMS request fails when spaces are encoded as plus symbol<br>
      in query part of URL (Moen, Paul T.)<br>
   2. (no subject) (sowmiya san)<br>
   3. Re: (no subject) (J?rg Thomsen)<br>
   4. mapserver (devi ka)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 6 Jul 2015 19:12:16 +0000<br>
From: "Moen, Paul T." <<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a>><br>
To: "Lime, Steve D (MNIT)" <<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a>>,<br>
        "<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>" <<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
Subject: Re: [mapserver-users] WMS request fails when spaces are<br>
        encoded as plus symbol in query part of URL<br>
Message-ID: <<a href="mailto:D1C0397E.2751F%25pmoen@nd.gov">D1C0397E.2751F%pmoen@nd.gov</a>><br>
Content-Type: text/plain; charset="windows-1252"<br>
<br>
An update.<br>
<br>
ESRI has decided not to follow the standard and has closed the bug, NIM104744, we submitted about not decoding a plus symbol ?+? to a space.  Their solution is for everyone else to encode all spaces as %20 and to ignore <a href="http://tools.ietf.org/html/rfc3986" rel="noreferrer" target="_blank">http://tools.ietf.org/html/rfc3986</a>.  They have closed the bug and listed it as a known limit.<br>
<br>
<a href="http://support.esri.com/en/bugs/nimbus/TklNMTA0NzQ0" rel="noreferrer" target="_blank">http://support.esri.com/en/bugs/nimbus/TklNMTA0NzQ0</a><br>
<br>
So, in order for Mapserver to consume ESRI WMS services, with spaces in the name, the spaces have to be encoded as %20.<br>
<br>
I see Mapserver 7.0 still encodes spaces to a ?+?, so I thought people should know if they intend to consume any ESRI WMS layers with spaces in the name.<br>
<br>
From: Paul Moen <<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a><mailto:<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a>>><br>
Date: Wednesday, August 20, 2014 at 9:43 AM<br>
To: "Lime, Steve D (MNIT)" <<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a><mailto:<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a>>>, "<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>>" <<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>>><br>
Subject: Re: [mapserver-users] WMS request fails when spaces are encoded as plus symbol in query part of URL<br>
<br>
Steve,<br>
<br>
You are right about the outcome of 1 and 2.  1 encodes the % and 2 throws the following error.<br>
<br>
msBuildWMSLayerURLBase(): One of wms_onlineresource, wms_server_version, wms_name metadata is missing in layer USGS DRG 250k Topo Maps.  Please either provide a valid CONNECTION URL, or provide those values in the layer's metadata.\n\n<br>
<br>
I found the function as you said and<br>
I removed the<br>
<br>
 if (*i == ' ')<br>
      *j = '+';<br>
    else<br>
from the function then recompiled.<br>
<br>
char *msEncodeUrlExcept(const char *data, const char except)<br>
{<br>
  char *hex = "0123456789ABCDEF";<br>
  const char *i;<br>
  char  *j, *code;<br>
  int   inc;<br>
  unsigned char ch;<br>
<br>
  for (inc=0, i=data; *i!='\0'; i++)<br>
    if (msEncodeChar(*i))<br>
      inc += 2;<br>
<br>
  code = (char*)msSmallMalloc(strlen(data)+inc+1);<br>
<br>
  for (j=code, i=data; *i!='\0'; i++, j++) {<br>
    if ( except != '\0' && *i == except ) {<br>
      *j = except;<br>
    } else if (msEncodeChar(*i)) {<br>
      ch = *i;<br>
      *j++ = '%';<br>
      *j++ = hex[ch/16];<br>
      *j   = hex[ch%16];<br>
    } else<br>
      *j = *i;<br>
  }<br>
  *j = '\0';<br>
<br>
  return code;<br>
}<br>
<br>
Everything works again after a mapserver recompile, install and finally a restart of apache.  Thanks so much for the path to the solution.<br>
<br>
Paul Moen<br>
<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a><mailto:<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a>><br>
701-328-2434<br>
<br>
<br>
From: <Lime>, "Steve D (MNIT)" <<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a><mailto:<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a>>><br>
Date: Wednesday, August 20, 2014 at 12:41 AM<br>
To: Paul Moen <<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a><mailto:<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a>>>, "<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>>" <<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>>><br>
Subject: RE: [mapserver-users] WMS request fails when spaces are encoded as plus symbol in query part of URL<br>
<br>
Hmmm... Nice backwards compatibility ESRI. The +'s seem to still be quite legal (<a href="http://tools.ietf.org/html/rfc3986" rel="noreferrer" target="_blank">http://tools.ietf.org/html/rfc3986</a> and other references) in the query string (but not the path). I don't have access to test and I'm guessing these ideas won't work but they might be worth a quick try:<br>
<br>
  1) Try encoding the wms_name in the metadata: "wms_name" "Topomap%20DRG%20250k"<br>
  2) Don't set the wms_name in the metadata but add it to the connection: CONNECTION "<a href="http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?LAYERS=Topomap%20DRG%20250k&" rel="noreferrer" target="_blank">http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?LAYERS=Topomap%20DRG%20250k&</a>"<br>
<br>
I'm betting MapServer will encode the %'s in 1 and throw an error in 2. Otherwise you could hack the MapServer source. Function is called msEncodeUrlExcept() in mapstring.c you can see the section to change starting at line 1138 in git master (<a href="https://github.com/mapserver/mapserver/blob/master/mapstring.c" rel="noreferrer" target="_blank">https://github.com/mapserver/mapserver/blob/master/mapstring.c</a>)<<a href="https://github.com/mapserver/mapserver/blob/master/mapstring.c)" rel="noreferrer" target="_blank">https://github.com/mapserver/mapserver/blob/master/mapstring.c)</a>.><br>
<br>
Maybe it's worth making this change as part of 7.0?<br>
<br>
Steve<br>
<br>
<br>
________________________________<br>
<a href="mailto:From%3Amapserver-users-bounces@lists.osgeo.org">From:mapserver-users-bounces@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>> [<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>>] on behalf of Moen, Paul T. [<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a><mailto:<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a>>]<br>
Sent: Tuesday, August 19, 2014 4:56 PM<br>
To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><mailto:<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
Subject: [mapserver-users] WMS request fails when spaces are encoded as plus symbol in query part of URL<br>
<br>
Hi all,<br>
<br>
We are consuming WMS services hosted by ESRI ArcGIS Server 10.0.  The server was upgraded to ArcGIS Server 10.2.2 and we no longer can access layer names with spaces.<br>
<br>
This is the server?s capabilities.<br>
<a href="http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?request=GetCapabilities&service=WMS" rel="noreferrer" target="_blank">http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?request=GetCapabilities&service=WMS</a><br>
<br>
This is the layer I am using.<br>
<br>
LAYER<br>
# DEBUG 5<br>
CONNECTIONTYPE WMS<br>
CONNECTION "<a href="http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer" rel="noreferrer" target="_blank">http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer</a>?"<br>
METADATA<br>
"wms_name" "Topomap DRG 250k"<br>
"wms_format" "image/png"<br>
"wms_server_version" "1.1.1"<br>
"wms_srs" "EPSG:2266"<br>
END<br>
TYPE RASTER<br>
STATUS OFF<br>
NAME "USGS DRG 250k Topo Maps"<br>
END<br>
<br>
Mapserver encodes this request as follows.  Notice that the layer name, which is ?Topomap DRG 250k?, is encoded with the spaces becoming the ?+? character.<br>
<br>
<a href="http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?LAYERS=Topomap+DRG+250k&REQUEST=map&WMTVER=1.0.0&SERVICE=WMS&FORMAT=image/png&STYLES=&HEIGHT=1146&SRS=EPSG:2266&WIDTH=1271&BBOX=1906240.15992838,596656.333359479,2119730.85012732,789150.692893686&TRANSPARENT=TRUE&EXCEPTIONS=INIMAGE" rel="noreferrer" target="_blank">http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?LAYERS=Topomap+DRG+250k&REQUEST=map&WMTVER=1.0.0&SERVICE=WMS&FORMAT=image/png&STYLES=&HEIGHT=1146&SRS=EPSG:2266&WIDTH=1271&BBOX=1906240.15992838,596656.333359479,2119730.85012732,789150.692893686&TRANSPARENT=TRUE&EXCEPTIONS=INIMAGE</a><br>
<br>
This returns the error in an image that says ?Parameter ?layers? contains unacceptable layer names.?<br>
<br>
When I replace the + in the layer name with %20, LAYERS=Topomap+DRG+250k become LAYERS=Topomap%20DRG%20250k and the request becomes the following.<br>
<br>
<a href="http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?LAYERS=Topomap%20DRG%20250k&REQUEST=map&WMTVER=1.0.0&SERVICE=WMS&FORMAT=image/png&STYLES=&HEIGHT=1146&SRS=EPSG:2266&WIDTH=1271&BBOX=1906240.15992838,596656.333359479,2119730.85012732,789150.692893686&TRANSPARENT=TRUE&EXCEPTIONS=INIMAGE" rel="noreferrer" target="_blank">http://ndgishub.nd.gov/arcgis/services/All_Elevation/MapServer/WMSServer?LAYERS=Topomap%20DRG%20250k&REQUEST=map&WMTVER=1.0.0&SERVICE=WMS&FORMAT=image/png&STYLES=&HEIGHT=1146&SRS=EPSG:2266&WIDTH=1271&BBOX=1906240.15992838,596656.333359479,2119730.85012732,789150.692893686&TRANSPARENT=TRUE&EXCEPTIONS=INIMAGE</a><br>
<br>
That request works.  Obviously, ESRI is no longer decoding + as a space and therefore does not recognize the layer name with spaces.<br>
<br>
Is there any way I can have mapserver encode all characters using percent-encoding, or at least encode spaces as %20 instead of a + character.<br>
<br>
Thanks,<br>
<br>
Paul Moen<br>
<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a><mailto:<a href="mailto:pmoen@nd.gov">pmoen@nd.gov</a>><br>
701-328-2434<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150706/dcfca6fb/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150706/dcfca6fb/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 7 Jul 2015 12:40:29 +0530<br>
From: sowmiya san <<a href="mailto:sowmiyasan48@gmail.com">sowmiyasan48@gmail.com</a>><br>
To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
Subject: [mapserver-users] (no subject)<br>
Message-ID:<br>
        <<a href="mailto:CABWt86KAH0DmqKi3NVVEm31r4ssd2QVgEa1jCh_z%2BKyLTiPaEQ@mail.gmail.com">CABWt86KAH0DmqKi3NVVEm31r4ssd2QVgEa1jCh_z+KyLTiPaEQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
please send mapserver download link<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150707/16524fb5/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150707/16524fb5/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Tue, 07 Jul 2015 09:18:57 +0200<br>
From: J?rg Thomsen <<a href="mailto:jt@mapmedia.de">jt@mapmedia.de</a>><br>
To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
Subject: Re: [mapserver-users] (no subject)<br>
Message-ID: <<a href="mailto:559B7D61.6020404@mapmedia.de">559B7D61.6020404@mapmedia.de</a>><br>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"<br>
<br>
<a href="http://lmgtfy.com/?q=mapserver+download" rel="noreferrer" target="_blank">http://lmgtfy.com/?q=mapserver+download</a><br>
<br>
Am 07.07.2015 09:10, schrieb sowmiya san:<br>
> please send mapserver download link<br>
><br>
><br>
> _______________________________________________<br>
> mapserver-users mailing list<br>
> <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150707/ac4a1063/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150707/ac4a1063/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Tue, 7 Jul 2015 12:53:30 +0530<br>
From: devi ka <<a href="mailto:devika.sak@gmail.com">devika.sak@gmail.com</a>><br>
To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
Subject: [mapserver-users] mapserver<br>
Message-ID:<br>
        <CAOjbuDis3=<a href="mailto:SJO5F2j8BwJuxcUTThzhPd6SL2Y3B-yL%2Be0c3T6g@mail.gmail.com">SJO5F2j8BwJuxcUTThzhPd6SL2Y3B-yL+e0c3T6g@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
hai sir please send mapserver download link address..........<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150707/dfc05fef/attachment.html" rel="noreferrer" target="_blank">http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150707/dfc05fef/attachment.html</a>><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
End of mapserver-users Digest, Vol 90, Issue 4<br>
**********************************************<br>
</blockquote></div><br></div>