Hi Yves,<br><br>Mapserver&#39;s default resolution is 72 dpi, that should explain your difference.<br><br>However I would encourage you to change this in the MAP file if you are running an OGC service, you should use:<br><br>
MAP<br>&nbsp; ..<br>&nbsp; RESOLUTION 90.714<br>&nbsp; ..<br><br>instead according to the OGC.<br><br>Best regards,<br>Bart<br><br><div><span class="gmail_quote">On 10/22/07, <b class="gmail_sendername">Jacolin Yves</b> &lt;<a href="mailto:yjacolin@free.fr">
yjacolin@free.fr</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Le Friday 19 October 2007 16:24:03 Daniel Morissette, vous avez écrit:
<br>&gt; Jacolin Yves wrote:<br>&gt; &gt; Hi list,<br>&gt; &gt;<br>&gt; &gt; After a GetCapabilities resquest on a mapserver server, I find this line<br>&gt; &gt; inside my xml file:<br>&gt; &gt; &lt;ScaleHint min=&quot;9.97805696859274
&quot; max=&quot;249.451424214819&quot; /&gt;<br>&gt; &gt;<br>&gt; &gt; In my mapfile, I defined min et max scale values with:<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;MINSCALE 20000<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;MAXSCALE 500000<br>&gt; &gt;<br>&gt; &gt; How can I convert the scaleHint value to the mapfile value? In other
<br>&gt; &gt; words, what does scaleHint values means?<br>&gt;<br>&gt; WMS defines the scalehint values as the ground distance in meters of the<br>&gt; southwest to northeast diagonal of the central pixel of a map. ScaleHint
<br>&gt; values are the min and max recommended values of that diagonal. (See WMS<br>&gt; 1.1.0 sect. <a href="http://7.1.5.4">7.1.5.4</a>)<br>&gt;<br>&gt; It is calculated in msWMSPrintScaleHint() in MapServer&#39;s mapwms.c
:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;diag = sqrt(2.0);<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;if (minscaledenom &gt; 0)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scalehintmin =<br>&gt; diag*(minscaledenom/resolution)/msInchesPerUnit(MS_METERS,0);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;if (maxscaledenom &gt; 0)<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scalehintmax =<br>&gt; diag*(maxscaledenom/resolution)/msInchesPerUnit(MS_METERS,0);<br>&gt;<br>&gt;<br>&gt; The use of inchesPerUnit conversion is because resolution is in pixels<br>&gt; per inch, and we need the result in meters.
<br>&gt;<br>&gt; I&#39;ll leave it as an exercise to you to figure out the reverse conversion<br>&gt; (scalehint -&gt; scaledenom). ;)<br>&gt;<br>&gt; Daniel<br><br>Daniel,<br><br>Does the default resolution of a map is 75 dpi?
<br><br>The reversion conversion should be : minScale = (ScaleHint/diag)*resolution<br>with diag = sqrt(2.0);<br>resolution in pixel/m -&gt; 2.54 E-02 pixel/inch (equal to dpi?)<br><br>so minScale = (9.97805696859274/sqrt(
2.0))*75/2.54*100<br>minScale = 20 833 (instead of 20 000)<br>maxScale = 520 833 (500 000)<br><br>Does this differences are normal?<br><br>Thanks,<br><br>Y.<br>--<br>Yves Jacolin<br>---<br><a href="http://softlibre.gloobe.org">
http://softlibre.gloobe.org</a><br></blockquote></div><br>