All,<div>I've updated the RFC at [1] to take into account the syntactical remarks that were made.</div><div>A test mapfile showing the proposed syntax can be seen at [2]. I've settled on the syntax that doesn't require explicitly setting a DEFAULT substitution value, i.e.:</div>
<div><br></div><div>scaletoken</div><div> name "%myvariable%"</div><div> values</div><div><div> 0: "foo"</div><div> 1000: "bar"</div><div> 2500: "baz"</div><div> end</div>
<div>end</div><div><br></div><div>which would translate to:</div><div>[0-1000[ : "foo"</div><div>[1000,2500[: "bar"</div><div>[2500-infinity[: "baz"</div></div><div><br></div><div>This implies that the first VALUES entry must be 0 (checked for by the parser), and that the last entry's implicit maxscale is infinity.</div>
<div><br></div><div>In addition to the original RFC, substitutions are also applied for TILEINDEX, TILEITEM, FILTER and FILTERITEM.</div><div><br></div><div>I'll call for a vote on this one soon, unless there's any more discussion around this in the coming days.</div>
<div><br></div><div>cheers,</div><div>thomas</div><div><br></div><div>[1]: <a href="http://mapserver.org/trunk/development/rfc/ms-rfc-86.html">http://mapserver.org/trunk/development/rfc/ms-rfc-86.html</a> . Might take a few hours to propagate, <a href="http://ci.mapserver.org/job/docs62/lastBuild/artifact/build/html/en/development/rfc/ms-rfc-86.html">http://ci.mapserver.org/job/docs62/lastBuild/artifact/build/html/en/development/rfc/ms-rfc-86.html</a> is uptodate.</div>
<div>[2]: <a href="https://github.com/tbonfort/msautotest/blob/fb4c6ac5229a6c4ac7fe7039c218bed26b1273a4/misc/scaletoken.map">https://github.com/tbonfort/msautotest/blob/fb4c6ac5229a6c4ac7fe7039c218bed26b1273a4/misc/scaletoken.map</a></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Oct 16, 2012 at 7:28 PM, Lime, Steve D (DNR) <span dir="ltr"><<a href="mailto:Steve.Lime@state.mn.us" target="_blank">Steve.Lime@state.mn.us</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nuts, missed this. I'm just thinking that attributes are used all over the place so users that change data sources will need to ensure that the same attributes are common across all of them. It's more a documentation thing. Won't be an issue when just altering the where clause in a select statement.<br>
<div class="im HOEnZb"><br>
Steve<br>
<br>
-----Original Message-----<br>
From: thomas bonfort [mailto:<a href="mailto:thomas.bonfort@gmail.com">thomas.bonfort@gmail.com</a>]<br>
</div><div class="HOEnZb"><div class="h5">Sent: Tuesday, October 09, 2012 11:53 AM<br>
To: Lime, Steve D (DNR)<br>
Cc: Smith, Michael ERDC-RDE-CRREL-NH; <a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
Subject: Re: [mapserver-dev] RFC-86: scale dependant DATA substitutions<br>
<br>
> Which brings me to another potential issue. Often items are going to be different for different data sources for labeling, classification and output (templates). This shared data means the underlying layers will have to have the exact same naming conventions.<br>
I'm sorry Steve, gonna need some clarifications here as the data drivers are new for me, I really don't understand what you mean.<br>
<br>
--<br>
thomas<br>
<br>
><br>
> Steve<br>
><br>
> -----Original Message-----<br>
> From: thomas bonfort [mailto:<a href="mailto:thomas.bonfort@gmail.com">thomas.bonfort@gmail.com</a>]<br>
> Sent: Tuesday, October 09, 2012 9:38 AM<br>
> To: Lime, Steve D (DNR)<br>
> Cc: Smith, Michael ERDC-RDE-CRREL-NH; <a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
> Subject: Re: [mapserver-dev] RFC-86: scale dependant DATA<br>
> substitutions<br>
><br>
> On Tue, Oct 9, 2012 at 4:32 AM, Lime, Steve D (DNR) <<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a>> wrote:<br>
>> Interesting... I like it. I think I'd consider defining a default<br>
>> value for the top level, kinda like class expressions work so you'd<br>
>><br>
>> SCALETOKEN<br>
>> NAME "ex1"<br>
>> VALUES<br>
>> 1000 "foo"<br>
>> 5000 "bar"<br>
>> 10000 "baz"<br>
>> END<br>
>> DEFAULT "baf"<br>
>> END<br>
> I can live with that, although I don't really like the DEFAULT part, seems awkward...<br>
><br>
>><br>
>> Using integers for simplification this would translate to:<br>
>><br>
>> 0-1000 => foo<br>
>> 1001-5000 => bar<br>
>> 5001-10000 => baz<br>
>> 10001 and up => baf<br>
>><br>
>> Basically the values always define a range. I need to dig out some layer snippets where I use this approach and see if this covers them. I have a feeling it doesn't, at least for shapefiles. Consider your example 3. With non-RDBMS sources maybe you'd want to replace/augment FILTERs and leave the DATA element alone.<br>
><br>
> I didn't initially want to touch FILTER, and no having looked at the code, even less. The problem with FILTER is that at the time msLayerOpen is called, filter is an expressionObj that I have no idea how to replace/augment. Any idea if this can be easily done?<br>
><br>
> I've started working on the implementation, you can see it here:<br>
> <a href="https://github.com/tbonfort/mapserver/compare/mapserver:master...tbonf" target="_blank">https://github.com/tbonfort/mapserver/compare/mapserver:master...tbonf</a><br>
> ort:rfc86<br>
><br>
> --<br>
> thomas<br>
><br>
>><br>
>> Steve<br>
>><br>
>> ________________________________________<br>
>> From: <a href="mailto:mapserver-dev-bounces@lists.osgeo.org">mapserver-dev-bounces@lists.osgeo.org</a><br>
>> [<a href="mailto:mapserver-dev-bounces@lists.osgeo.org">mapserver-dev-bounces@lists.osgeo.org</a>] on behalf of thomas bonfort<br>
>> [<a href="mailto:thomas.bonfort@gmail.com">thomas.bonfort@gmail.com</a>]<br>
>> Sent: Monday, October 08, 2012 3:26 PM<br>
>> To: Smith, Michael ERDC-RDE-CRREL-NH<br>
>> Cc: <a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
>> Subject: Re: [mapserver-dev] RFC-86: scale dependant DATA<br>
>> substitutions<br>
>><br>
>> (in case this wasn't clear, this still is the commenting/discussion<br>
>> phase, I'm not clutching onto my initial proposal)<br>
>><br>
>> that said:<br>
>><br>
>> - the need for consistency between our already established<br>
>> minscale/maxscale is important<br>
>><br>
>> - I dislike the proposal to need to specify minscale *and* maxscale<br>
>> inside a scaletoken block, as it implies that the user must make sure<br>
>> that the provided intervals are contiguous, which in turn leads to a<br>
>> repetition of bounds, i.e:<br>
>> min1/max1: "foo"<br>
>> max1==min2/max2: "bar"<br>
>> max2==min3/max3: "baz"<br>
>> etc...<br>
>><br>
>> the mapfile syntax and/or parser intelligence to define these would<br>
>> also be clunky.<br>
>><br>
>> - I like Mike's proposal of only defining the max scale, although I'd<br>
>> put it the other way around as we know the minscale is always 0, but<br>
>> we never know the maxscale. The key=>value entries would be<br>
>> minscale=>value, eg:<br>
>><br>
>> 0: "foo"<br>
>> 1000: "bar"<br>
>> 2500: "baz"<br>
>><br>
>> which would translate to:<br>
>> [0-1000[ : "foo"<br>
>> [1000,2500[: "bar"<br>
>> [2500-infinity[: "baz"<br>
>><br>
>> would that work?<br>
>><br>
>> --<br>
>> thomas<br>
>><br>
>><br>
>> On Mon, Oct 8, 2012 at 10:06 PM, Smith, Michael ERDC-RDE-CRREL-NH<br>
>> <<a href="mailto:Michael.Smith@erdc.dren.mil">Michael.Smith@erdc.dren.mil</a>> wrote:<br>
>>> I have to say that I read it more like Steve W did, I thought those<br>
>>> values would be MAXSCALEDENOM values that moved it from one DATA<br>
>>> substitution to another.<br>
>>><br>
>>> Since that is already an accepted keyword and its meaning well<br>
>>> understood, is there a good reason to not use the listed value(s) as MAXSCALEs?<br>
>>><br>
>>> Mike<br>
>>><br>
>>> --<br>
>>> Michael Smith<br>
>>><br>
>>> US Army Corps<br>
>>> Remote Sensing GIS/Center<br>
>>><br>
>>><br>
>>><br>
>>> On 10/8/12 3:40 PM, "thomas bonfort" <<a href="mailto:thomas.bonfort@gmail.com">thomas.bonfort@gmail.com</a>> wrote:<br>
>>><br>
>>>>Steve,<br>
>>>>I understand the confusion, but it depends on how you look at it :)<br>
>>>>Typically in a tiling scenario, you have a fixed list of<br>
>>>>resolutions/zoom-levels (directly translatable to scales), and you<br>
>>>>want to define which table/column/filter to use for a given zoom<br>
>>>>level.<br>
>>>><br>
>>>>if, as how you suggest, the token replacement works with<br>
>>>>minscale/maxscale, then you have two steps to get this working:<br>
>>>> - make sure that your defined min/max scales are contiguous, i.e.<br>
>>>>you are not leaving any scale out<br>
>>>> - from the fixed resolutions, calculate the intermediate min/max<br>
>>>>scales<br>
>>>><br>
>>>>to illustrate, supposing you are tiling at scales<br>
>>>>500,1000,2500,5000,10000,25000,50000,100000, ....<br>
>>>><br>
>>>>with my proposed syntax, you'd use:<br>
>>>><br>
>>>>values<br>
>>>> "500" "foo"<br>
>>>> "1000" "baz"<br>
>>>> "2500" "bar"<br>
>>>> etc..<br>
>>>>end<br>
>>>><br>
>>>>with min/max scales, this would end up as<br>
>>>><br>
>>>>values<br>
>>>> "0/750" "foo"<br>
>>>> "750/1750" "bar"<br>
>>>> "1750/3750" "baz"<br>
>>>> etc...<br>
>>>>end<br>
>>>><br>
>>>>makes sense?<br>
>>>><br>
>>>>--<br>
>>>>thomas<br>
>>>><br>
>>>><br>
>>>>On Mon, Oct 8, 2012 at 9:22 PM, Stephen Woodbridge<br>
>>>><<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>> wrote:<br>
>>>>> Thomas,<br>
>>>>><br>
>>>>> OK, got it, but this is not intuitive because one has to do math<br>
>>>>>to figure out where the breaks will happen. And it is even harder<br>
>>>>>to figure out what numbers I should use if a want a break at X<br>
>>>>>scale, because the number I use in the VALUES affects BOTH the<br>
>>>>>scale above and below the number I change.<br>
>>>>> This also does not follow how the usage of<br>
>>>>>MINSCALEDENOM/MAXSCALEDENOM in the rest of the mapfile.<br>
>>>>><br>
>>>>> I think you have to make the ranges explicit and break on the<br>
>>>>>scale numbers not between them. This means you have to have an<br>
>>>>>extra case in the values like I suggested, which you were probably<br>
>>>>>trying to avoid.<br>
>>>>><br>
>>>>> I think it would be a good idea to get additional input from<br>
>>>>>others on this.<br>
>>>>> I suspect other users will be just as confused but the proposed<br>
>>>>>scheme as I was.<br>
>>>>><br>
>>>>> Thanks,<br>
>>>>> -Steve W<br>
>>>>><br>
>>>>><br>
>>>>> On 10/8/2012 2:08 PM, thomas bonfort wrote:<br>
>>>>>><br>
>>>>>> Steve,<br>
>>>>>><br>
>>>>>> starting from<br>
>>>>>><br>
>>>>>> VALUES<br>
>>>>>> "1000" "1000"<br>
>>>>>> "10000" "10000"<br>
>>>>>> "1000000" "1000000"<br>
>>>>>> END<br>
>>>>>><br>
>>>>>> let's change this to:<br>
>>>>>><br>
>>>>>> VALUES<br>
>>>>>> "1000" "foo"<br>
>>>>>> "10000" "bar"<br>
>>>>>> "1000000" "baz"<br>
>>>>>> END<br>
>>>>>><br>
>>>>>> to avoid confusion between keys and values. Now, this should be<br>
>>>>>>read<br>
>>>>>>as:<br>
>>>>>> - for scale 1000, use "foo"<br>
>>>>>> - for scale 10000, use "bar"<br>
>>>>>> - for scale 1000000, use "baz"<br>
>>>>>><br>
>>>>>> at rendering time, with a current map scale "s", find which is<br>
>>>>>> the closest configured scale to s,<br>
>>>>>> i.e.:<br>
>>>>>><br>
>>>>>> - if s < 1000 use "foo"<br>
>>>>>> - else if 1000<s<10000: if s closer to 1000 than 10000 use "foo",<br>
>>>>>> else use "bar". i.e. the test for s<5500<br>
>>>>>> - etc...<br>
>>>>>><br>
>>>>>> wrapping it all up you get:<br>
>>>>>><br>
>>>>>> 0 ... foo ... 5500 ... bar ... 505000 ... baz ....<br>
>>>>>><br>
>>>>>> hope this clarifies things :)<br>
>>>>>><br>
>>>>>> --<br>
>>>>>> thomas<br>
>>>>>><br>
>>>>>> On Mon, Oct 8, 2012 at 7:51 PM, Stephen Woodbridge<br>
>>>>>> <<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>> wrote:<br>
>>>>>>><br>
>>>>>>> On 10/8/2012 11:32 AM, thomas bonfort wrote:<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> On Mon, Oct 8, 2012 at 4:41 PM, Stephen Woodbridge<br>
>>>>>>>> <<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>> wrote:<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> On 10/8/2012 9:02 AM, thomas bonfort wrote:<br>
>>>>>>>>>><br>
>>>>>>>>>><br>
>>>>>>>>>><br>
>>>>>>>>>> Devs,<br>
>>>>>>>>>><br>
>>>>>>>>>> Please take a look and comment on<br>
>>>>>>>>>><br>
>>>>>>>>>> <a href="http://mapserver.org/trunk/development/rfc/ms-rfc-86.html" target="_blank">http://mapserver.org/trunk/development/rfc/ms-rfc-86.html</a><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> Hi Thomas,<br>
>>>>>>>>><br>
>>>>>>>>> Thanks, this looks like an excellent implementation to address<br>
>>>>>>>>>the need I identified in bug #<a href="tel:3150" value="+333150">3150</a>.<br>
>>>>>>>>><br>
>>>>>>>>> I'm a little confused with your first example in the RFC, you have:<br>
>>>>>>>>><br>
>>>>>>>>> SCALETOKEN<br>
>>>>>>>>> NAME "foobar"<br>
>>>>>>>>> VALUES<br>
>>>>>>>>> "1000" "1000"<br>
>>>>>>>>> "10000" "10000"<br>
>>>>>>>>> "1000000" "1000000"<br>
>>>>>>>>> END<br>
>>>>>>>>> END<br>
>>>>>>>>><br>
>>>>>>>>> But the discussion reference 5500, 505000. So that should be<br>
>>>>>>>>>cleared up so it is more understandable.<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> Steve,<br>
>>>>>>>> what this meant is that given the current requested scale,<br>
>>>>>>>> mapserver will select the closest defined scaletoken. In the<br>
>>>>>>>> example here,<br>
>>>>>>>> 0=>5500 uses the 1000 value<br>
>>>>>>>> 5500=>505000 uses 10000<br>
>>>>>>>> 505000 and up uses 1000000<br>
>>>>>>>><br>
>>>>>>>> I agree, not very clear... you should only consider the first<br>
>>>>>>>> entry, the second one isn't interpreted and is just used as the<br>
>>>>>>>> replacement for the token<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> My confusion is how to determine the ranges. For example, if:<br>
>>>>>>><br>
>>>>>>> 0 < scale <= 1000 use 1000<br>
>>>>>>> 1000 < scale <= 10000 use 10000<br>
>>>>>>> 1000000 < scale use 1000000<br>
>>>>>>> scale > 1000000 use ??<br>
>>>>>>><br>
>>>>>>> So, you define three points in the scale range (ie: 1000, 10000,<br>
>>>>>>>1000000)<br>
>>>>>>> so<br>
>>>>>>> it is not clear what happens above or below these points,<br>
>>>>>>>especially above and below the top and bottom ones. If this is<br>
>>>>>>>better defined, then maybe there is no need for a default case.<br>
>>>>>>><br>
>>>>>>> You might do something like:<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> VALUES<br>
>>>>>>> "1000" "1000"<br>
>>>>>>> "10000" "10000"<br>
>>>>>>> "100000" "100000"<br>
>>>>>>> ">100000" "1000000"<br>
>>>>>>> END<br>
>>>>>>><br>
>>>>>>> So this would interpret the first column as the maxscaledenom to<br>
>>>>>>>apply the token to, with the last one being the default case. I<br>
>>>>>>>would consider removing the number after ">" to make it less<br>
>>>>>>>ambiguous if someone edited the mapfile and you had something<br>
>>>>>>>like:<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> VALUES<br>
>>>>>>> "1000" "1000"<br>
>>>>>>> "10000" "10000"<br>
>>>>>>> "100000" "100000"<br>
>>>>>>> "200000" "200000" # added this line<br>
>>>>>>> ">100000" "1000000" # this is confusing at best, conflicts w<br>
>>>>>>>"200000"<br>
>>>>>>> ">" "1000000" # this is more clear and does not depend<br>
>>>>>>> # on the user editing two lines END<br>
>>>>>>><br>
>>>>>>> Do the scales need to be in ascending or descending order or<br>
>>>>>>> will you sort them if they need to be ordered.<br>
>>>>>>><br>
>>>>>>> Then again, I might be over thinking this.<br>
>>>>>>><br>
>>>>>>> Thanks,<br>
>>>>>>> -Steve<br>
>>>>><br>
>>>>><br>
>>>>_______________________________________________<br>
>>>>mapserver-dev mailing list<br>
>>>><a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
>>>><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
>>><br>
>> _______________________________________________<br>
>> mapserver-dev mailing list<br>
>> <a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
>><br>
>><br>
><br>
<br>
</div></div></blockquote></div><br></div>