Hi Yves,<br><br>Mapserver'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> ..<br> RESOLUTION 90.714<br> ..<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> <<a href="mailto:yjacolin@free.fr">
yjacolin@free.fr</a>> 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>> Jacolin Yves wrote:<br>> > Hi list,<br>> ><br>> > After a GetCapabilities resquest on a mapserver server, I find this line<br>> > inside my xml file:<br>> > <ScaleHint min="9.97805696859274
" max="249.451424214819" /><br>> ><br>> > In my mapfile, I defined min et max scale values with:<br>> > MINSCALE 20000<br>> > MAXSCALE 500000<br>> ><br>> > How can I convert the scaleHint value to the mapfile value? In other
<br>> > words, what does scaleHint values means?<br>><br>> WMS defines the scalehint values as the ground distance in meters of the<br>> southwest to northeast diagonal of the central pixel of a map. ScaleHint
<br>> values are the min and max recommended values of that diagonal. (See WMS<br>> 1.1.0 sect. <a href="http://7.1.5.4">7.1.5.4</a>)<br>><br>> It is calculated in msWMSPrintScaleHint() in MapServer's mapwms.c
:<br>><br>> diag = sqrt(2.0);<br>><br>> if (minscaledenom > 0)<br>> scalehintmin =<br>> diag*(minscaledenom/resolution)/msInchesPerUnit(MS_METERS,0);<br>> if (maxscaledenom > 0)<br>
> scalehintmax =<br>> diag*(maxscaledenom/resolution)/msInchesPerUnit(MS_METERS,0);<br>><br>><br>> The use of inchesPerUnit conversion is because resolution is in pixels<br>> per inch, and we need the result in meters.
<br>><br>> I'll leave it as an exercise to you to figure out the reverse conversion<br>> (scalehint -> scaledenom). ;)<br>><br>> 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 -> 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>