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

Stephen Woodbridge woodbri at swoodbridge.com
Mon Oct 8 10:51:00 PDT 2012


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