<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Corbel;
panose-1:2 11 5 3 2 2 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Seliteteksti Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.SelitetekstiChar
{mso-style-name:"Seliteteksti Char";
mso-style-priority:99;
mso-style-link:Seliteteksti;
font-family:"Tahoma","sans-serif";}
span.Shkpostityyli20
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
p.BalloonText, li.BalloonText, div.BalloonText
{mso-style-name:"Balloon Text";
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.Shkpostityyli23
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1597787794;
mso-list-type:hybrid;
mso-list-template-ids:163609752 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">A Mapserver user here asks if you developers have thought about how to filter if LAYER has no DATA but it takes the contents from another LAYER like in kernel density layers
<a href="http://mapserver.org/development/rfc/ms-rfc-108.html">http://mapserver.org/development/rfc/ms-rfc-108.html</a> or with layers utilizing OGR tileindex?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Does/should filtering work at all on TILEINDEX or on CONNECTIONTYPE-CONNECTION layers if they point to another layer? If it does, what users should write into, let’s say, tileindex layer? It filtering
does not work on tileindex layer, how to prevent users from trying it anyway?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">A real world example follows. I have created yearly orthophoto layers by using “DATA---SELECT---“ at layer level and used that layer as a TILEINDEX. What if I would like to filter further and split
images by year and by contractor? Should I create as many layers as there are unique year-contractor combinations, or can I filter the year 2006 layer further at the next level where it is used as TILEINDEX? I believe that myself I would use whole lot of copy-paste
and make those unique year-contractor layers. How about you? Imagine that you have 15 years and 4 contractors, it makes 60+60 layers in total.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">LAYER #this is the yearly tileindex<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> NAME "spatialite_tileindex_2006"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> STATUS ON<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> TYPE POLYGON<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> CONNECTIONTYPE OGR<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> CONNECTION "xxx.sqlite"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> DATA "select * from xxx where year=2006"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> METADATA<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> "wms_title" "y2006"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> "wms_srs" "EPSG:2393 EPSG:3067 EPSG:4326 EPSG:3857"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> END #METADATA<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">CLASS<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> NAME "y2006"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> STYLE<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> WIDTH 0.91
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> OUTLINECOLOR 0 0 0
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> OPACITY 30<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> COLOR 39 200 55<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> END #STYLE<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> END #CLASS<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> PROJECTION<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> "init=epsg:3067"
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> END #PROJECTION<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">END #LAYER yearly index<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">LAYER #this draws the orthos for the people<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> NAME "orthos_2006"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> STATUS ON<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> TILEINDEX "spatialite_tileindex_2006"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> TILESRS "src_srs"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> #PROCESSING "EXTENT_PRIORITY=WORLDFILE"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> PROCESSING "CLOSE_CONNECTION=DEFER"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">….<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Lime, Steve D wrote:<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">So, when you get into implementation of an RFC you notice things. One thing that has come up is ambiguity around the way native SQL is specified. In older versions of MapServer you’d set FILTER with a string value and
the underlying driver would interpret that as SQL. Easy enough at first glance. RFC 91 aims to enable translation from MapServer expression syntax to native SQL plus handling FILTER merging with query operations. That’s where the ambiguity sets in – it’s not
clear how you define native SQL, even the codebase handled it differently. <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">That ticket aims talks about ways to resolve this ambiguity and you can see the full discussion here: <a href="https://github.com/mapserver/mapserver/issues/5001">https://github.com/mapserver/mapserver/issues/5001</a>.
Ultimately we arrived at a point where we needed to bring the discussion back to the list.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Here’s a summary of potential options:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">Do nothing, live with the ambiguity and resulting code complexity.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">Adopt the current OGR method of prefixing the FILTER string with “WHERE “.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">3.<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">Adopt a new delimiter (e.g. <>) to explicitly define native SQL.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">4.<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">Remove the ability to set native SQL altogether – FILTERs would use MapServer expression syntax only and we rely on translations.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Option 4 sounds drastic but probably gets us the most streamlined code to maintain – merging is much more straight forward. The native SQL in FILTER functionality was added long ago before more complex DATA handling was
implemented. It’s easy to argue that since all of the drivers that support some sort of SQL do so in the DATA definition that there’s no need for native SQL FILTERs at all.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Why now? We’ll we only want to break things at major releases so…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Steve<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="margin-left:10.25pt;border-collapse:collapse">
<thead>
<tr style="height:14.4pt">
<td width="630" colspan="2" valign="top" style="width:378.0pt;padding:2.9pt 5.75pt 2.9pt 5.75pt;height:14.4pt">
<p class="MsoNormal"><b><span style="font-size:8.0pt;text-transform:uppercase;letter-spacing:.2pt">StEVE LIME
<span style="color:#990033">| </span></span></b><span style="font-size:8.0pt;text-transform:uppercase;letter-spacing:1.0pt">DATA & Applications MANAGER</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";text-transform:uppercase;letter-spacing:1.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:7.0pt;text-transform:uppercase;letter-spacing:1.0pt">MN.IT Services
<span style="color:#990033">@ </span>MnDNR</span><span style="font-size:7.0pt;font-family:"Corbel","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-top:1.0pt;line-height:110%"><span style="font-size:7.0pt;line-height:110%">651-259-5473 (w)
<b>|</b> 651-297-4946 (f) <b>|</b> </span><a href="mailto:Your.name@state.mn.us"><span style="font-size:7.0pt;line-height:110%">steve.lime@state.mn.us</span></a><span style="font-size:7.5pt;line-height:110%;font-family:"Corbel","sans-serif";color:#5C83B4;text-transform:uppercase;letter-spacing:1.0pt"><o:p></o:p></span></p>
</td>
</tr>
</thead>
<tbody>
<tr style="height:1.1pt">
<td width="148" valign="bottom" style="width:88.8pt;padding:0cm 0cm 0cm 0cm;height:1.1pt">
<p class="MsoNormal"><a href="http://www.mn.gov/oet"><i><span style="font-size:8.0pt;font-family:"Corbel","sans-serif";color:#5C83B4;letter-spacing:1.0pt;text-decoration:none"><img border="0" width="117" height="42" id="Picture_x0020_5" src="cid:image001.jpg@01CFD817.97B5B870"></span></i></a><i><span style="font-size:8.0pt;font-family:"Corbel","sans-serif";color:#5C83B4;letter-spacing:1.0pt"><o:p></o:p></span></i></p>
</td>
<td width="482" valign="bottom" style="width:289.2pt;padding:0cm 0cm 0cm 0cm;height:1.1pt">
<p class="MsoNormal"><span style="font-size:8.0pt">Information Technology for Minnesota Government
</span><span style="font-size:7.0pt"> <b>|</b> </span><span style="font-size:8.0pt;letter-spacing:1.0pt"> </span><a href="http://www.mn.gov/oet"><span style="font-size:8.0pt">mn.gov/oet</span></a><span style="font-size:8.0pt;color:#5C83B4;letter-spacing:1.0pt"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</div>
</body>
</html>