<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" 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"><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 11.00.9600.19236">
<STYLE>@font-face {
        font-family: Cambria Math;
}
@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Verdana;
}
@page WordSection1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
        FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman",serif; MARGIN: 0in 0in 0pt
}
LI.MsoNormal {
        FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman",serif; MARGIN: 0in 0in 0pt
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman",serif; MARGIN: 0in 0in 0pt
}
A:link {
        TEXT-DECORATION: underline; COLOR: blue; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        TEXT-DECORATION: underline; COLOR: blue; mso-style-priority: 99
}
A:visited {
        TEXT-DECORATION: underline; COLOR: purple; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        TEXT-DECORATION: underline; COLOR: purple; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d; mso-style-type: personal-reply
}
.MsoChpDefault {
        FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.WordSection1 {
        page: WordSection1
}
</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=EN-US link=blue vLink=purple>
<DIV dir=ltr align=left><SPAN class=219225520-05022019><FONT color=#000080 
size=2 face=Arial>Great, Thanks Steve </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=219225520-05022019><FONT color=#000080 
size=2 face=Arial>I added </FONT></SPAN><SPAN 
class=219225520-05022019><FONT color=#000080 size=2 face=Arial> 
"gml_include_items" "mapcolor7"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=219225520-05022019><FONT color=#000080 
size=2 face=Arial>to the Metadata block and got it working. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=219225520-05022019><FONT color=#000080 
size=2 face=Arial>One quirk seems to be that when I am trying to the 
values as integer (from the mapcolor7 column) specifying the style as in 
1.) below did not work. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=219225520-05022019><FONT color=#000080 
size=2 face=Arial>However it I treat them as characters instead, quoted 
them and used "type": "categorical" in the json file for the style as in 
2.) below it is working.</FONT></SPAN></DIV>
<DIV><SPAN class=219225520-05022019><FONT color=#000080 size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=219225520-05022019><FONT color=#000080 size=2 
face=Arial>Cheers</FONT></SPAN></DIV>
<DIV><SPAN class=219225520-05022019><FONT color=#000080 size=2 
face=Arial>Karsten</DIV>
<DIV dir=ltr align=left><BR></DIV></FONT></SPAN>
<DIV><SPAN class=219225520-05022019></SPAN><FONT face=Arial><FONT 
color=#000080><FONT size=2>1<SPAN 
class=219225520-05022019>.)</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=219225520-05022019><SPAN class=219225520-05022019><FONT color=#000080 
size=2 
face=Arial>----------------------------</FONT></SPAN></SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=219225520-05022019>{<BR>    "id": 
"country-fill",<BR>    "type": "fill",<BR>    
"source": "compass",<BR>    "source-layer": 
"allcountries",<BR>    "paint": 
{<BR>      "fill-color": 
{<BR>        "property": 
"mapcolor7",<BR>        "stops": 
[<BR>            [1, 
"#fdaf6b"],<BR>            
[2, 
"#fdc663"],<BR>            
[3, 
"#fae364"],<BR>            
[4, 
"#d3e46f"],<BR>            
[5, 
"#aadb78"],<BR>            
[6, 
"#a3cec5"],<BR>            
[7, "#ceb5cf"]<BR>        
]<BR>      }<BR>    
}<BR>}</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=219225520-05022019></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=219225520-05022019>2.)</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=219225520-05022019><SPAN class=219225520-05022019><FONT color=#000080 
size=2 
face=Arial>----------------------------</FONT></SPAN></SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=219225520-05022019>{<BR>    "id": 
"country-fill",<BR>    "type": "fill",<BR>    
"source": "compass",<BR>    "source-layer": 
"allcountries",<BR>    "paint": 
{<BR>      "fill-color": 
{<BR>        "property": 
"mapcolor7",<BR><STRONG>        "type": 
"categorical",</STRONG><BR>        "stops": 
[<BR>            ["1", 
"#fdaf6b"],<BR>            
["2", 
"#fdc663"],<BR>            
["3", 
"#fae364"],<BR>            
["4", 
"#d3e46f"],<BR>            
["5", 
"#aadb78"],<BR>            
["6", 
"#a3cec5"],<BR>            
["7", "#ceb5cf"]<BR>        
]<BR>      }<BR>    
}<BR>}</SPAN></FONT></FONT></FONT></DIV>
<DIV><BR></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Lime, Steve D (MNIT) 
[mailto:steve.lime@state.mn.us] <BR><B>Sent:</B> Tuesday, February 05, 2019 
21:15<BR><B>To:</B> karsten; mapserver-users@lists.osgeo.org<BR><B>Subject:</B> 
RE: [mapserver-users] styling based on attribute for MapServer derived 
MVTiles<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=WordSection1>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'>I 
believe the default WxS behavior is to expose no attributes. You need to be 
explicit and I don’t see the gml_include_items metadata property in the mapfile 
for the layer allcountries. You’d need something like:<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'>“gml_include_items”    
“mapcolor7”<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'>Added 
to the allcountries layer. The mvt-demo does this for most 
layers…<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'>--Steve<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'><o:p> </o:p></SPAN></P>
<DIV>
<DIV 
style="BORDER-TOP: #e1e1e1 1pt solid; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 0in; PADDING-TOP: 3pt; PADDING-LEFT: 0in; BORDER-LEFT: medium none; PADDING-RIGHT: 0in">
<P class=MsoNormal><B><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif'>From:</SPAN></B><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif'> mapserver-users 
[mailto:mapserver-users-bounces@lists.osgeo.org] <B>On Behalf Of 
</B>karsten<BR><B>Sent:</B> Monday, February 04, 2019 4:33 PM<BR><B>To:</B> 
mapserver-users@lists.osgeo.org<BR><B>Subject:</B> [mapserver-users] styling 
based on attribute for MapServer derived 
MVTiles<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal><o:p> </o:p></P>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>Dear 
All,</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>I 
was working on the configuration of MapServer generated MVT tiles for 
a demo country world map and had success with MS v 7.2 
outputting tiles in MVT format ( all thanks to <A 
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsdlime%2Fmvt-demo&data=02%7C01%7Csteve.lime%40state.mn.us%7C98620848f458446d1e2608d68af0c31b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C636849164006408831&sdata=QYGGj%2FDN87pFfCjzP0CHZBoomTp38zRhupXy2%2BjGyi8%3D&reserved=0">https://github.com/sdlime/mvt-demo</A> ).</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>I am 
trying to work on the client side style for my demo map (using mapbox-gl.js) and 
defined them in a similar way as JSON as in Steve's mvt-demo above. The whole 
thing is later intended to be used in a benchmark for MapServer MVT rendering 
speed versus T-Rex ( see <A 
href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.sourcepole.ch%2F2018%2F09%2F06%2Fthe-tale-of-a-vector-tile-benchmark%2F&data=02%7C01%7Csteve.lime%40state.mn.us%7C98620848f458446d1e2608d68af0c31b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C636849164006418845&sdata=F7kfmr8XBKaraOdKcglqApDt%2BSuWAHSJ7x%2BTI6GJCHw%3D&reserved=0">http://blog.sourcepole.ch/2018/09/06/the-tale-of-a-vector-tile-benchmark/</A> ) .</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>For now I 
am struggling with specifying the correct style syntax for the client 
side and it seem that I missing something as I was not yet able to 
successfully use attribute properties to render Countries as different colors 
based on an attribute field of my PostGIS source.</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>Below is 
the configuration of my 'allcountries' layer. The mapcolor7 filed is an integer 
field (in the input PostGIS source) but my set-up fails to output multiple 
colors , instead I am getting all default black for the country fill color. A 
second layer where I specified only Italy as one Country 'country-italy' to 
show up renders fine -  see <A 
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkarstenv%2Fmvt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fcountries_mvt.png&data=02%7C01%7Csteve.lime%40state.mn.us%7C98620848f458446d1e2608d68af0c31b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C636849164006428858&sdata=1XeorZJ2Tf%2FeYSD2Cs5N3JcvszoU1nplrtrqDMc%2BqXw%3D&reserved=0">https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/countries_mvt.png</A></SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>My 
complete style JSON is at <A 
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkarstenv%2Fmvt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fms_ne_simple.json&data=02%7C01%7Csteve.lime%40state.mn.us%7C98620848f458446d1e2608d68af0c31b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C636849164006438854&sdata=O4%2F91Tdg2%2BCCiHCJr1hvWqc9f4K%2B%2FBa%2FJAW4vBHbY58%3D&reserved=0">https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ms_ne_simple.json</A></SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>and the 
corresponding map file is here <A 
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkarstenv%2Fmvt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fne.map&data=02%7C01%7Csteve.lime%40state.mn.us%7C98620848f458446d1e2608d68af0c31b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C636849164006448867&sdata=CJawtbiFdYOcG2fa1PxgWHHfqV1Hz18tSz71k4N59ws%3D&reserved=0">https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ne.map</A></SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>Would 
anyone know what I need to change in order to render the countries with 
different colors according to the 'mapcolor7' attribute 
?</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>To me it 
seems that somehow the attribute is not available to the 
renderer even though in the MapServer map file I am selecting all fields in 
the sub-query ...</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'> </SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>Thanks</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>Karsten</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>--------------------------------------------</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>{<BR>    
"id": "country-fill",<BR>    "type": 
"fill",<BR>    "source": "compass",<BR>    
"source-layer": "allcountries",<BR>    "paint": 
{<BR>      "fill-color": 
{<BR>        "property": 
"mapcolor7",<BR>        "stops": 
[<BR>            [1, 
"#fdaf6b"],<BR>            
[2, 
"#fdc663"],<BR>            
[3, 
"#fae364"],<BR>            
[4, 
"#d3e46f"],<BR>            
[5, 
"#aadb78"],<BR>            
[6, 
"#a3cec5"],<BR>            
[7, "#ceb5cf"]<BR>        
]<BR>      }<BR>    
}<BR>},{<BR>    "id": "country-italy",<BR>    
"type": "fill",<BR>    "source": "compass",<BR>    
"source-layer": "italy",<BR>    "paint": 
{<BR>      "fill-color": 
"#fdc663"<BR>      }<BR>  
}</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal> <o:p></o:p></P></DIV>
<P class=MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Verdana",sans-serif'>Karsten 
Vennemann<BR></SPAN><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>Terra GIS 
</SPAN><o:p></o:p></P></DIV></BODY></HTML>