<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 11.00.9600.19267"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#000080 size=2 face=Arial><SPAN 
class=243133721-11032019>Thanks , will use this from now on.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#000080 size=2 face=Arial><SPAN 
class=243133721-11032019>Cheers</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#000080 size=2 face=Arial><SPAN 
class=243133721-11032019>Karsten</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#000080 size=2 face=Arial><SPAN 
class=243133721-11032019></SPAN></FONT> </DIV><BR>
<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> Saturday, February 09, 2019 
15:55<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>You can specify a type in the gml metadata and that will impact how 
the conversion is done in the mvt encoding. Something like:<BR><BR>   
gml_mapcolor7_type integer<BR><BR>Otherwise things are treated as 
strings...<BR><BR>—Steve<BR>
<HR tabIndex=-1 style="WIDTH: 98%; DISPLAY: inline-block">

<DIV id=divRplyFwdMsg dir=ltr><FONT style="FONT-SIZE: 11pt" color=#000000 
face="Calibri, sans-serif"><B>From:</B> karsten 
<karsten@terragis.net><BR><B>Sent:</B> Tuesday, February 5, 2019 3:01:51 
PM<BR><B>To:</B> mapserver-users@lists.osgeo.org<BR><B>Cc:</B> Lime, Steve D 
(MNIT)<BR><B>Subject:</B> RE: [mapserver-users] styling based on attribute for 
MapServer derived MVTiles</FONT> 
<DIV> </DIV></DIV>
<STYLE>@font-face {
        font-family: Cambria Math;
}
@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Verdana;
}
@page WordSection1 {margin: 1.0in 1.0in 1.0in 1.0in; }
P.x_MsoNormal {
        FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman",serif; MARGIN: 0in 0in 0pt
}
LI.x_MsoNormal {
        FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman",serif; MARGIN: 0in 0in 0pt
}
DIV.x_MsoNormal {
        FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman",serif; MARGIN: 0in 0in 0pt
}
A:link {
        TEXT-DECORATION: underline; COLOR: blue
}
SPAN.x_MsoHyperlink {
        TEXT-DECORATION: underline; COLOR: blue
}
A:visited {
        TEXT-DECORATION: underline; COLOR: purple
}
SPAN.x_MsoHyperlinkFollowed {
        TEXT-DECORATION: underline; COLOR: purple
}
SPAN.x_EmailStyle17 {
        FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d
}
.x_MsoChpDefault {
        FONT-SIZE: 10pt
}
DIV.x_WordSection1 {
        
}
</STYLE>

<DIV lang=EN-US vlink="purple" link="blue">
<DIV dir=ltr align=left><SPAN class=x_219225520-05022019><FONT color=#000080 
size=2 face=Arial>Great, Thanks Steve </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=x_219225520-05022019><FONT color=#000080 
size=2 face=Arial>I added </FONT></SPAN><SPAN 
class=x_219225520-05022019><FONT color=#000080 size=2 face=Arial> 
"gml_include_items" "mapcolor7"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=x_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=x_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=x_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=x_219225520-05022019><FONT color=#000080 size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=x_219225520-05022019><FONT color=#000080 size=2 
face=Arial>Cheers</FONT></SPAN></DIV>
<DIV><SPAN class=x_219225520-05022019><FONT color=#000080 size=2 
face=Arial>Karsten</DIV>
<DIV dir=ltr align=left><BR></DIV></FONT></SPAN>
<DIV><SPAN class=x_219225520-05022019></SPAN><FONT face=Arial><FONT 
color=#000080><FONT size=2>1<SPAN 
class=x_219225520-05022019>.)</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=x_219225520-05022019><SPAN class=x_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=x_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=x_219225520-05022019></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=x_219225520-05022019>2.)</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=x_219225520-05022019><SPAN class=x_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=x_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=x_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=x_WordSection1>
<P class=x_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:</SPAN></P>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'></SPAN> </P>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'>“gml_include_items”    
“mapcolor7”</SPAN></P>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'></SPAN> </P>
<P class=x_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…</SPAN></P>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'></SPAN> </P>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'>--Steve</SPAN></P>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; COLOR: #1f497d'></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=x_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</SPAN></P></DIV></DIV>
<P class=x_MsoNormal> </P>
<DIV>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>Dear 
All,</SPAN></P></DIV>
<DIV>
<P class=x_MsoNormal> </P></DIV>
<DIV>
<P class=x_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%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C636849973214573577&sdata=5L4SwL6sPn9%2BFDEQbvM1%2BKzCQ6KtXdc6OACIm4afEDc%3D&reserved=0" 
shash="EBANl031uGVoGUF/Uk5csje3639LkZ2ESFg34QoPT8W7S0SNb9qkZaIaDHIbtqbvBkBhpPVLmu8AKXl592Q7Ix3xGjEalvOo/mr4P52nFSyVZT8VBFJC/KV3HVCjBE788EfIaAF5pHFaR+NmV03+9lvER0wbbsArcWhvNkkNRSM=" 
originalsrc="https://github.com/sdlime/mvt-demo">https://github.com/sdlime/mvt-demo</A> ).</SPAN></P></DIV>
<DIV>
<P class=x_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%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C636849973214583591&sdata=x0OMGP7hH2SvVQysWctAAAlzU5kML4sxg1m9ZHj3yNM%3D&reserved=0" 
shash="eA+/TAWc6qlCR8n7cAqyrg1GkfCClqJq4soy3ggU/HyxnyCKnNWCipB80fHnngw/nJhNZLqJ7O2yhEHEae9wM74Asn3DJ4BjhIk0eNPTg1ceOcw7JTqe+AOoXIjU8MlxMsFLVxBcP7sbjaPZdxb3CrdjOc4VYXa9fBKYhQ0pQEM=" 
originalsrc="http://blog.sourcepole.ch/2018/09/06/the-tale-of-a-vector-tile-benchmark/">http://blog.sourcepole.ch/2018/09/06/the-tale-of-a-vector-tile-benchmark/</A> ) .</SPAN></P></DIV>
<DIV>
<P class=x_MsoNormal> </P></DIV>
<DIV>
<P class=x_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></P></DIV>
<DIV>
<P class=x_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%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C636849973214593596&sdata=sCT0dCxsOVV8WK61g86riyFrnHwMUW3kDTq1FncEYIk%3D&reserved=0" 
shash="HNHpT/Xads94y2kjhHgiUpl3X8C9nv3L3IObeFVx0IX1kC9ivwEq4mRcJsg8ixfi+Dcl6PprBuwYLfjoJhIxv81RQeIxdEDm6WYmpAuVgJQ+l2JiKKGkhxcx9YG/XCNiYcNS/q/OBWYIjrO+hXpFZ5TglZJYyguzxBhDyyu03w4=" 
originalsrc="https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/countries_mvt.png">https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/countries_mvt.png</A></SPAN></P></DIV>
<DIV>
<P class=x_MsoNormal> </P></DIV>
<DIV>
<P class=x_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%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C636849973214593596&sdata=rW0SwiqaGZDf1P%2FhVw4677fS69GIdjaQnk5G2cKLWow%3D&reserved=0" 
shash="dmkE+iznHOVJq1/CubUsnxeRpe/FanMbbg14GgLc5OHZOkxFQiaDzi1b30JhE7QVs9eqynafpqm8xNfgYBeIU3knTOhoXCR+Dp2IKVofWIyf5/IZSG1dkl1MxJvpf3/mJzQOQ5+EzUHKlWUivWsupPj0/uzLn0XpozMELqAap0Q=" 
originalsrc="https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ms_ne_simple.json">https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ms_ne_simple.json</A></SPAN></P></DIV>
<DIV>
<P class=x_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%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C636849973214603601&sdata=N4PGCLEg6xD8VMz6bA%2BnaQPFDyITriOP5V40S4AGt%2FA%3D&reserved=0" 
shash="yBJbWXGMKdIBxUjLZWYvqyxEDP0D8mF7Qe8ywfLtlXd0kQGV2KfceAj4jp2OqYLDrDYxtx6RUKpBslO7YuGYvvwPMXsQJqsdftO8oYHZhZozCcbzKHlHov2p9TPR2dn+sCR47/0U8h8wJR0eh8uXnogLTdXe5CPg+8ThCsVlbjQ=" 
originalsrc="https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ne.map">https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ne.map</A></SPAN></P></DIV>
<DIV>
<P class=x_MsoNormal> </P></DIV>
<DIV>
<P class=x_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></P></DIV>
<DIV>
<P class=x_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></P></DIV>
<DIV>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'></SPAN> </P></DIV>
<DIV>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>Thanks</SPAN></P></DIV>
<DIV>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>Karsten</SPAN></P></DIV>
<DIV>
<P class=x_MsoNormal> </P></DIV>
<DIV>
<P class=x_MsoNormal><SPAN 
style='FONT-SIZE: 10pt; FONT-FAMILY: "Arial",sans-serif; COLOR: navy'>--------------------------------------------</SPAN></P></DIV>
<DIV>
<P class=x_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></P></DIV>
<DIV>
<P class=x_MsoNormal> </P></DIV>
<P class=x_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></P></DIV></DIV></BODY></HTML>