WMS ScaleHint precision

Eijnden, B. van den (Bart) b.vdeijnden at AGI.RWS.MINVENW.NL
Mon Jan 30 05:07:46 PST 2006


Hi list,

I am running into ScaleHint precision issues, at least it is my guess this
has to do with precision. It seems to me the values outputted to the WMS
Capabilities don't have enough precision.

My MAP file has 3 layers:

layer1: MINSCALE=250,000 MAXSCALE=5,000,000
layer2: MINSCALE=75,000 MAXSCALE=250,000
layer3: MINSCALE=0 MAXSCALE=75,000

The ScaleHint values are:

layer1: <ScaleHint min="124.726" max="2494.51" />
layer2: <ScaleHint min="37.4177" max="124.726" />
layer3: <ScaleHint min="0" max="37.4177" />

If I do MAXSCALE for layer1 on my calculator I get:
2494,5142421481852288355319843683

My application translates this back to scale values using (taken from
wmsparse.c which is part of Chameleon):

#define INCHES_PER_METER 39.3701

#ifndef M_SQRT2
# define M_SQRT2        1.41421356237309504880  /* sqrt(2) */
#endif

double scaleHintToScaleDenominator( double dScaleHint, double dResolution)
{
    if (dScaleHint <= 0)
        return -1.0;

    if (dResolution <= 0)
        dResolution = 72.0;

    return (dScaleHint * INCHES_PER_METER * dResolution / M_SQRT2);
}

The result is:
layer1: MINSCALE=250000,57705, MAXSCALE=4999991,49705
layer2: MINSCALE=74999,97268,MAXSCALE=250000,57705
layer3: MINSCALE=-1,MAXSCALE=74999,97268

As you can see, especially for layer 1 the results are (way) off.

Where is the problem situated? Can it be fixed by having more precision in
the WMS GetCapabilities for scalehint values?

Thanks in advance.

Best regards,
Bart


Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te 
informeren. Wij adviseren u om bij twijfel over de juistheid of de 
volledigheid van de mail contact met afzender op te nemen.

This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************



More information about the MapServer-users mailing list