[mapserver-dev] RFC-86: scale dependant DATA substitutions

thomas bonfort thomas.bonfort at gmail.com
Mon Oct 8 11:08:02 PDT 2012


Steve,

starting from

VALUES
      "1000" "1000"
      "10000" "10000"
      "1000000" "1000000"
END

let's change this to:

VALUES
      "1000" "foo"
      "10000" "bar"
      "1000000" "baz"
END

to avoid confusion between keys and values. Now, this should be read as:
- for scale 1000, use "foo"
- for scale 10000, use "bar"
- for scale 1000000, use "baz"

at rendering time, with a current map scale "s", find which is the
closest configured scale to s,
i.e.:

- if s < 1000 use "foo"
- else if 1000<s<10000: if s closer to 1000 than 10000 use "foo", else
use "bar". i.e. the test for s<5500
- etc...

wrapping it all up you get:

0 ... foo ... 5500 ... bar ... 505000 ... baz ....

hope this clarifies things :)

--
thomas

On Mon, Oct 8, 2012 at 7:51 PM, Stephen Woodbridge
<woodbri at swoodbridge.com> wrote:
> On 10/8/2012 11:32 AM, thomas bonfort wrote:
>>
>> On Mon, Oct 8, 2012 at 4:41 PM, Stephen Woodbridge
>> <woodbri at swoodbridge.com> wrote:
>>>
>>> On 10/8/2012 9:02 AM, thomas bonfort wrote:
>>>>
>>>>
>>>> Devs,
>>>>
>>>> Please take a look and comment on
>>>>
>>>> http://mapserver.org/trunk/development/rfc/ms-rfc-86.html
>>>
>>>
>>>
>>> Hi Thomas,
>>>
>>> Thanks, this looks like an excellent implementation to address the need I
>>> identified in bug #3150.
>>>
>>> I'm a little confused with your first example in the RFC, you have:
>>>
>>>    SCALETOKEN
>>>      NAME "foobar"
>>>      VALUES
>>>        "1000" "1000"
>>>        "10000" "10000"
>>>        "1000000" "1000000"
>>>      END
>>>    END
>>>
>>> But the discussion reference 5500, 505000. So that should be cleared up
>>> so
>>> it is more understandable.
>>
>> Steve,
>> what this meant is that given the current requested scale, mapserver
>> will select the closest defined scaletoken. In the example here,
>> 0=>5500 uses the 1000 value
>> 5500=>505000 uses 10000
>> 505000 and up uses 1000000
>>
>> I agree, not very clear... you should only consider the first entry,
>> the second one isn't interpreted and is just used as the replacement
>> for the token
>
>
> My confusion is how to determine the ranges. For example, if:
>
>       0 < scale <=   1000 use    1000
>    1000 < scale <=  10000 use   10000
> 1000000 < scale           use 1000000
>           scale > 1000000 use      ??
>
> So, you define three points in the scale range (ie: 1000, 10000, 1000000) so
> it is not clear what happens above or below these points, especially above
> and below the top and bottom ones. If this is better defined, then maybe
> there is no need for a default case.
>
> You might do something like:
>
>
> VALUES
>      "1000"    "1000"
>     "10000"   "10000"
>    "100000"  "100000"
>   ">100000" "1000000"
> END
>
> So this would interpret the first column as the maxscaledenom to apply the
> token to, with the last one being the default case. I would consider
> removing the number after ">" to make it less ambiguous if someone edited
> the mapfile and you had something like:
>
>
> VALUES
>      "1000"    "1000"
>     "10000"   "10000"
>    "100000"  "100000"
>    "200000"  "200000"  # added this line
>   ">100000" "1000000"  # this is confusing at best, conflicts w "200000"
>         ">" "1000000"  # this is more clear and does not depend
>                        # on the user editing two lines
> END
>
> Do the scales need to be in ascending or descending order or will you sort
> them if they need to be ordered.
>
> Then again, I might be over thinking this.
>
> Thanks,
>   -Steve


More information about the mapserver-dev mailing list