<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic WMS GetMap request error with width en height parameters in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/wms-getmap-request-error-with-width-en-height/m-p/606809#M3128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;According to the IOS/OGC WMS 1.3.0&amp;nbsp; specification the width and height parameters of the GetMap function are integers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The ArcGIS Server Web API's are calling this GetMap function with floating point values for width and height.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Some WMS service providers that follow the specification correctly are having trouble with these floating point numbers where integers are expected.&amp;nbsp; Is there a way to make the API's do this request with integers for the width and height parameters in stead of floats ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Aug 2012 06:16:02 GMT</pubDate>
    <dc:creator>martindevos</dc:creator>
    <dc:date>2012-08-07T06:16:02Z</dc:date>
    <item>
      <title>WMS GetMap request error with width en height parameters</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/wms-getmap-request-error-with-width-en-height/m-p/606809#M3128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;According to the IOS/OGC WMS 1.3.0&amp;nbsp; specification the width and height parameters of the GetMap function are integers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The ArcGIS Server Web API's are calling this GetMap function with floating point values for width and height.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Some WMS service providers that follow the specification correctly are having trouble with these floating point numbers where integers are expected.&amp;nbsp; Is there a way to make the API's do this request with integers for the width and height parameters in stead of floats ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 06:16:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/wms-getmap-request-error-with-width-en-height/m-p/606809#M3128</guid>
      <dc:creator>martindevos</dc:creator>
      <dc:date>2012-08-07T06:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: WMS GetMap request error with width en height parameters</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/wms-getmap-request-error-with-width-en-height/m-p/606810#M3129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Interesting since the WmsLayer's GetUrl-method takes &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Consolas;"&gt;height &lt;/SPAN&gt;&lt;SPAN&gt;and &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Consolas;"&gt;width &lt;/SPAN&gt;&lt;SPAN&gt;as a integers and the values are added to the query string from integers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public override void GetUrl(ESRI.ArcGIS.Client.Geometry.Envelope extent, int width, int height,
&amp;nbsp;&amp;nbsp; DynamicMapServiceLayer.OnUrlComplete onComplete)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; int extentWKID = (extent.SpatialReference != null) ? extent.SpatialReference.WKID : 0;
&amp;nbsp;&amp;nbsp; string baseUrl = MapUrl ?? Url;
&amp;nbsp;&amp;nbsp; StringBuilder mapURL = new StringBuilder(baseUrl);


&amp;nbsp;&amp;nbsp; if (!baseUrl.Contains("?"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; mapURL.Append("?");
&amp;nbsp;&amp;nbsp; else if (!baseUrl.EndsWith("&amp;amp;"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; mapURL.Append("&amp;amp;");
&amp;nbsp;&amp;nbsp; mapURL.Append("SERVICE=WMS&amp;amp;REQUEST=GetMap");
&amp;nbsp;&amp;nbsp; mapURL.AppendFormat("&amp;amp;WIDTH={0}", width);
&amp;nbsp;&amp;nbsp; mapURL.AppendFormat("&amp;amp;HEIGHT={0}", height);
&lt;SPAN style="font-family:Consolas;"&gt;&amp;lt;Snip&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Verdana;"&gt;Did I miss something here? &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:59:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/wms-getmap-request-error-with-width-en-height/m-p/606810#M3129</guid>
      <dc:creator>AnttiKajanus1</dc:creator>
      <dc:date>2021-12-12T01:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: WMS GetMap request error with width en height parameters</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/wms-getmap-request-error-with-width-en-height/m-p/606811#M3130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Interesting since the WmsLayer's GetUrl-method takes &lt;SPAN style="color: #000000; font-family: Consolas;"&gt;height &lt;/SPAN&gt;and &lt;SPAN style="color: #000000; font-family: Consolas;"&gt;width &lt;/SPAN&gt;as a integers and the values are added to the query string from integers&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public override void GetUrl(ESRI.ArcGIS.Client.Geometry.Envelope extent, int width, int height,
&amp;nbsp;&amp;nbsp; DynamicMapServiceLayer.OnUrlComplete onComplete)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; int extentWKID = (extent.SpatialReference != null) ? extent.SpatialReference.WKID : 0;
&amp;nbsp;&amp;nbsp; string baseUrl = MapUrl ?? Url;
&amp;nbsp;&amp;nbsp; StringBuilder mapURL = new StringBuilder(baseUrl);


&amp;nbsp;&amp;nbsp; if (!baseUrl.Contains("?"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; mapURL.Append("?");
&amp;nbsp;&amp;nbsp; else if (!baseUrl.EndsWith("&amp;amp;"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; mapURL.Append("&amp;amp;");
&amp;nbsp;&amp;nbsp; mapURL.Append("SERVICE=WMS&amp;amp;REQUEST=GetMap");
&amp;nbsp;&amp;nbsp; mapURL.AppendFormat("&amp;amp;WIDTH={0}", width);
&amp;nbsp;&amp;nbsp; mapURL.AppendFormat("&amp;amp;HEIGHT={0}", height);
&lt;SPAN style="font-family:Consolas;"&gt;&amp;lt;Snip&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Verdana;"&gt;Did I miss something here? &lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you run the sample from arcgis.com :&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/layers/layers_wms.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/demos/layers/layers_wms.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;then the request that gets generated and sent by the api is :&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://sampleserver1a.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer?SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&amp;amp;STYLES=&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=2&amp;amp;WIDTH=1031.02&amp;amp;HEIGHT=689.02&amp;amp;CRS=EPSG:102100&amp;amp;BBOX=-19284340.42752786,-2025471.5773168755,890534.427527858,11457188.577316876" rel="nofollow noopener noreferrer" target="_blank"&gt;http://sampleserver1a.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer?SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&amp;amp;STYLES=&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=2&amp;amp;WIDTH=1031.02&amp;amp;HEIGHT=689.02&amp;amp;CRS=EPSG:102100&amp;amp;BBOX=-19284340.42752786,-2025471.5773168755,890534.427527858,11457188.577316876&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see, the width and height are not integers (as demanded by the specification).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, the arcgis sample server deals with these decimal numbers, but other service proveders don't.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For instance if i use the api on this service :&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://wms.agiv.be/inspire/wms/administratieve_eenheden?SERVICE=WMS&amp;amp;REQUEST=GetCapabilities&amp;amp;version=1.3.0" rel="nofollow noopener noreferrer" target="_blank"&gt;http://wms.agiv.be/inspire/wms/administratieve_eenheden?SERVICE=WMS&amp;amp;REQUEST=GetCapabilities&amp;amp;version=1.3.0&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;then the generated reques is :&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://wms.agiv.be/inspire/wms/administratieve_eenheden?SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;STYLES=&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=Refgew&amp;amp;WIDTH=1358.02&amp;amp;HEIGHT=754.02&amp;amp;CRS=EPSG:31370&amp;amp;BBOX=21999.999999999956,131704.67297977937,259000.00000000006,263295.32702022063" rel="nofollow noopener noreferrer" target="_blank"&gt;http://wms.agiv.be/inspire/wms/administratieve_eenheden?SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;STYLES=&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=Refgew&amp;amp;WIDTH=1358.02&amp;amp;HEIGHT=754.02&amp;amp;CRS=EPSG:31370&amp;amp;BBOX=21999.999999999956,131704.67297977937,259000.00000000006,263295.32702022063&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;which gives me a blank screen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If i remove the decimal fractions in width and height then i get a correct image.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Guys, Sorry for the above, this problem only occurs in the javascript API (which I use for testing) and not in the WPF API.&amp;nbsp; Sorry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:59:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/wms-getmap-request-error-with-width-en-height/m-p/606811#M3130</guid>
      <dc:creator>martindevos</dc:creator>
      <dc:date>2021-12-12T01:59:47Z</dc:date>
    </item>
  </channel>
</rss>

