ScaleHint in GetCapabilities resquest
Bart van den Eijnden
bartvde at GMAIL.COM
Mon Oct 22 04:21:07 PDT 2007
Hi Yves,
Mapserver's default resolution is 72 dpi, that should explain your
difference.
However I would encourage you to change this in the MAP file if you are
running an OGC service, you should use:
MAP
..
RESOLUTION 90.714
..
instead according to the OGC.
Best regards,
Bart
On 10/22/07, Jacolin Yves <yjacolin at free.fr> wrote:
>
> Le Friday 19 October 2007 16:24:03 Daniel Morissette, vous avez écrit:
> > Jacolin Yves wrote:
> > > Hi list,
> > >
> > > After a GetCapabilities resquest on a mapserver server, I find this
> line
> > > inside my xml file:
> > > <ScaleHint min="9.97805696859274" max="249.451424214819" />
> > >
> > > In my mapfile, I defined min et max scale values with:
> > > MINSCALE 20000
> > > MAXSCALE 500000
> > >
> > > How can I convert the scaleHint value to the mapfile value? In other
> > > words, what does scaleHint values means?
> >
> > WMS defines the scalehint values as the ground distance in meters of the
> > southwest to northeast diagonal of the central pixel of a map. ScaleHint
> > values are the min and max recommended values of that diagonal. (See WMS
> > 1.1.0 sect. 7.1.5.4)
> >
> > It is calculated in msWMSPrintScaleHint() in MapServer's mapwms.c:
> >
> > diag = sqrt(2.0);
> >
> > if (minscaledenom > 0)
> > scalehintmin =
> > diag*(minscaledenom/resolution)/msInchesPerUnit(MS_METERS,0);
> > if (maxscaledenom > 0)
> > scalehintmax =
> > diag*(maxscaledenom/resolution)/msInchesPerUnit(MS_METERS,0);
> >
> >
> > The use of inchesPerUnit conversion is because resolution is in pixels
> > per inch, and we need the result in meters.
> >
> > I'll leave it as an exercise to you to figure out the reverse conversion
> > (scalehint -> scaledenom). ;)
> >
> > Daniel
>
> Daniel,
>
> Does the default resolution of a map is 75 dpi?
>
> The reversion conversion should be : minScale =
> (ScaleHint/diag)*resolution
> with diag = sqrt(2.0);
> resolution in pixel/m -> 2.54 E-02 pixel/inch (equal to dpi?)
>
> so minScale = (9.97805696859274/sqrt(2.0))*75/2.54*100
> minScale = 20 833 (instead of 20 000)
> maxScale = 520 833 (500 000)
>
> Does this differences are normal?
>
> Thanks,
>
> Y.
> --
> Yves Jacolin
> ---
> http://softlibre.gloobe.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20071022/266503ea/attachment.htm>
More information about the MapServer-users
mailing list