[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mapserver-users
Subject:    Re: [mapserver-users] styling based on attribute for MapServer derived MVTiles
From:       "Lime, Steve D (MNIT)" <steve.lime () state ! mn ! us>
Date:       2019-02-09 14:55:08
Message-ID: DM5PR0901MB2310255A1572F43B238C7D8CDA6A0 () DM5PR0901MB2310 ! namprd09 ! prod ! outlook ! com
[Download RAW message or body]

You can specify a type in the gml metadata and that will impact how the conversion is \
done in the mvt encoding. Something like:

   gml_mapcolor7_type integer

Otherwise things are treated as strings...

—Steve
________________________________
From: karsten <karsten@terragis.net>
Sent: Tuesday, February 5, 2019 3:01:51 PM
To: mapserver-users@lists.osgeo.org
Cc: Lime, Steve D (MNIT)
Subject: RE: [mapserver-users] styling based on attribute for MapServer derived \
MVTiles

Great, Thanks Steve
I added  "gml_include_items" "mapcolor7"
to the Metadata block and got it working.
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. 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.

Cheers
Karsten

1.)
----------------------------
{
    "id": "country-fill",
    "type": "fill",
    "source": "compass",
    "source-layer": "allcountries",
    "paint": {
      "fill-color": {
        "property": "mapcolor7",
        "stops": [
            [1, "#fdaf6b"],
            [2, "#fdc663"],
            [3, "#fae364"],
            [4, "#d3e46f"],
            [5, "#aadb78"],
            [6, "#a3cec5"],
            [7, "#ceb5cf"]
        ]
      }
    }
}

2.)
----------------------------
{
    "id": "country-fill",
    "type": "fill",
    "source": "compass",
    "source-layer": "allcountries",
    "paint": {
      "fill-color": {
        "property": "mapcolor7",
        "type": "categorical",
        "stops": [
            ["1", "#fdaf6b"],
            ["2", "#fdc663"],
            ["3", "#fae364"],
            ["4", "#d3e46f"],
            ["5", "#aadb78"],
            ["6", "#a3cec5"],
            ["7", "#ceb5cf"]
        ]
      }
    }
}

________________________________
From: Lime, Steve D (MNIT) [mailto:steve.lime@state.mn.us]
Sent: Tuesday, February 05, 2019 21:15
To: karsten; mapserver-users@lists.osgeo.org
Subject: RE: [mapserver-users] styling based on attribute for MapServer derived \
MVTiles


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:



“gml_include_items”    “mapcolor7”



Added to the allcountries layer. The mvt-demo does this for most layers…



--Steve



From: mapserver-users [mailto:mapserver-users-bounces@lists.osgeo.org] On Behalf Of \
                karsten
Sent: Monday, February 04, 2019 4:33 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] styling based on attribute for MapServer derived MVTiles



Dear All,



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 https://github.com/sdlime/mvt-demo<https://na01.safelinks.protection.outlook \
.com/?url=https%3A%2F%2Fgithub.com%2Fsdlime%2Fmvt-demo&data=02%7C01%7Csteve.lime%40sta \
te.mn.us%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0 \
%7C636849973214573577&sdata=5L4SwL6sPn9%2BFDEQbvM1%2BKzCQ6KtXdc6OACIm4afEDc%3D&reserved=0> \
).

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 http://blog.sourcepole.ch/2018/09/06/the-tale-of-a-vector-tile-benchmark/< \
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.sourcepole.ch%2F2 \
018%2F09%2F06%2Fthe-tale-of-a-vector-tile-benchmark%2F&data=02%7C01%7Csteve.lime%40sta \
te.mn.us%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0 \
%7C636849973214583591&sdata=x0OMGP7hH2SvVQysWctAAAlzU5kML4sxg1m9ZHj3yNM%3D&reserved=0> \
) .



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.

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 https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/countries_ \
mvt.png<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F \
karstenv%2Fmvt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fcountries_mvt.png&data=02%7C01% \
7Csteve.lime%40state.mn.us%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b8 \
9c2159828c%7C0%7C0%7C636849973214593596&sdata=sCT0dCxsOVV8WK61g86riyFrnHwMUW3kDTq1FncEYIk%3D&reserved=0>




My complete style JSON is at \
https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ms_ne_simple.json<http \
s://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkarstenv%2Fm \
vt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fms_ne_simple.json&data=02%7C01%7Csteve.lime \
%40state.mn.us%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b89c2159828c%7 \
C0%7C0%7C636849973214593596&sdata=rW0SwiqaGZDf1P%2FhVw4677fS69GIdjaQnk5G2cKLWow%3D&reserved=0>


and the corresponding map file is here \
https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ne.map<https://na01.sa \
felinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkarstenv%2Fmvt-benchmar \
k%2Fblob%2Fmaster%2FMapServer%2Fne.map&data=02%7C01%7Csteve.lime%40state.mn.us%7C8cad8 \
9d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C636849973214603601&sdata=N4PGCLEg6xD8VMz6bA%2BnaQPFDyITriOP5V40S4AGt%2FA%3D&reserved=0>




Would anyone know what I need to change in order to render the countries with \
different colors according to the 'mapcolor7' attribute ?

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 ...



Thanks

Karsten



--------------------------------------------

{
    "id": "country-fill",
    "type": "fill",
    "source": "compass",
    "source-layer": "allcountries",
    "paint": {
      "fill-color": {
        "property": "mapcolor7",
        "stops": [
            [1, "#fdaf6b"],
            [2, "#fdc663"],
            [3, "#fae364"],
            [4, "#d3e46f"],
            [5, "#aadb78"],
            [6, "#a3cec5"],
            [7, "#ceb5cf"]
        ]
      }
    }
},{
    "id": "country-italy",
    "type": "fill",
    "source": "compass",
    "source-layer": "italy",
    "paint": {
      "fill-color": "#fdc663"
      }
  }



Karsten Vennemann
Terra GIS


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body>
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>
&nbsp;&nbsp; gml_mapcolor7_type integer<br>
<br>
Otherwise things are treated as strings...<br>
<br>
—Steve<br>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" \
style="font-size:11pt" color="#000000"><b>From:</b> karsten \
&lt;karsten@terragis.net&gt;<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>&nbsp;</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" link="blue" vlink="purple">
<div dir="ltr" align="left"><span class="x_219225520-05022019"><font color="#000080" \
size="2" face="Arial">Great, Thanks&nbsp;Steve </font></span></div>
<div dir="ltr" align="left"><span class="x_219225520-05022019"><font color="#000080" \
size="2" face="Arial">I added&nbsp;</font></span><span \
class="x_219225520-05022019"><font color="#000080" size="2" face="Arial"> \
&quot;gml_include_items&quot; &quot;mapcolor7&quot;</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&nbsp;as integer (from the mapcolor7 column) specifying the style as in 1.) \
below&nbsp;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,&nbsp;quoted them \
and used&nbsp;&quot;type&quot;: &quot;categorical&quot; in the json file for the \
style as in 2.) below&nbsp;it is working.</font></span></div> <div><span \
class="x_219225520-05022019"><font color="#000080" size="2" \
face="Arial"></font></span>&nbsp;</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> &nbsp;&nbsp;&nbsp; &quot;id&quot;: \
&quot;country-fill&quot;,<br> &nbsp;&nbsp;&nbsp; &quot;type&quot;: \
&quot;fill&quot;,<br> &nbsp;&nbsp;&nbsp; &quot;source&quot;: &quot;compass&quot;,<br>
&nbsp;&nbsp;&nbsp; &quot;source-layer&quot;: &quot;allcountries&quot;,<br>
&nbsp;&nbsp;&nbsp; &quot;paint&quot;: {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;fill-color&quot;: {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;property&quot;: \
&quot;mapcolor7&quot;,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&quot;stops&quot;: [<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [1, \
&quot;#fdaf6b&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [2, \
&quot;#fdc663&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [3, \
&quot;#fae364&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [4, \
&quot;#d3e46f&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [5, \
&quot;#aadb78&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [6, \
&quot;#a3cec5&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [7, \
&quot;#ceb5cf&quot;]<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<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>&nbsp;</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> &nbsp;&nbsp;&nbsp; &quot;id&quot;: \
&quot;country-fill&quot;,<br> &nbsp;&nbsp;&nbsp; &quot;type&quot;: \
&quot;fill&quot;,<br> &nbsp;&nbsp;&nbsp; &quot;source&quot;: &quot;compass&quot;,<br>
&nbsp;&nbsp;&nbsp; &quot;source-layer&quot;: &quot;allcountries&quot;,<br>
&nbsp;&nbsp;&nbsp; &quot;paint&quot;: {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;fill-color&quot;: {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;property&quot;: \
&quot;mapcolor7&quot;,<br> <strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&quot;type&quot;: &quot;categorical&quot;,</strong><br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;stops&quot;: [<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&quot;1&quot;, \
&quot;#fdaf6b&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&quot;2&quot;, \
&quot;#fdc663&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&quot;3&quot;, \
&quot;#fae364&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&quot;4&quot;, \
&quot;#d3e46f&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&quot;5&quot;, \
&quot;#aadb78&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&quot;6&quot;, \
&quot;#a3cec5&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&quot;7&quot;, \
&quot;#ceb5cf&quot;]<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<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:&quot;Calibri&quot;,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:&quot;Calibri&quot;,sans-serif; color:#1f497d">&nbsp;</span></p> <p \
class="x_MsoNormal"><span style="font-size:11pt; \
font-family:&quot;Calibri&quot;,sans-serif; \
color:#1f497d">“gml_include_items”&nbsp;&nbsp;&nbsp; “mapcolor7”</span></p> <p \
class="x_MsoNormal"><span style="font-size:11pt; \
font-family:&quot;Calibri&quot;,sans-serif; color:#1f497d">&nbsp;</span></p> <p \
class="x_MsoNormal"><span style="font-size:11pt; \
font-family:&quot;Calibri&quot;,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:&quot;Calibri&quot;,sans-serif; color:#1f497d">&nbsp;</span></p> <p \
class="x_MsoNormal"><span style="font-size:11pt; \
font-family:&quot;Calibri&quot;,sans-serif; color:#1f497d">--Steve</span></p> <p \
class="x_MsoNormal"><span style="font-size:11pt; \
font-family:&quot;Calibri&quot;,sans-serif; color:#1f497d">&nbsp;</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:&quot;Calibri&quot;,sans-serif">From:</span></b><span \
style="font-size:11pt; font-family:&quot;Calibri&quot;,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">&nbsp;</p>
<div>
<p class="x_MsoNormal"><span style="font-size:10pt; \
font-family:&quot;Arial&quot;,sans-serif; color:navy">Dear All,</span></p> </div>
<div>
<p class="x_MsoNormal">&nbsp;</p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10pt; \
font-family:&quot;Arial&quot;,sans-serif; color:navy">I was&nbsp;working on the \
configuration of&nbsp;MapServer generated MVT tiles for a demo country world map and \
had&nbsp;success with MS v 7.2 outputting&nbsp;tiles in MVT format ( all  thanks to \
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2 \
Fsdlime%2Fmvt-demo&amp;data=02%7C01%7Csteve.lime%40state.mn.us%7C8cad89d7aa6f4f29f40e0 \
8d68bad2b0d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C636849973214573577&amp;sdata=5L4SwL6sPn9%2BFDEQbvM1%2BKzCQ6KtXdc6OACIm4afEDc%3D&amp;reserved=0" \
originalsrc="https://github.com/sdlime/mvt-demo" \
shash="EBANl031uGVoGUF/Uk5csje3639LkZ2ESFg34QoPT8W7S0SNb9qkZaIaDHIbtqbvBkBhpPVLmu8AKXl \
592Q7Ix3xGjEalvOo/mr4P52nFSyVZT8VBFJC/KV3HVCjBE788EfIaAF5pHFaR&#43;NmV03&#43;9lvER0wbbsArcWhvNkkNRSM=">
 https://github.com/sdlime/mvt-demo</a>&nbsp;).</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10pt; \
font-family:&quot;Arial&quot;,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&amp;data=02%7C01%7Csteve. \
lime%40state.mn.us%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26b89c215982 \
8c%7C0%7C0%7C636849973214583591&amp;sdata=x0OMGP7hH2SvVQysWctAAAlzU5kML4sxg1m9ZHj3yNM%3D&amp;reserved=0" \
originalsrc="http://blog.sourcepole.ch/2018/09/06/the-tale-of-a-vector-tile-benchmark/" \
shash="eA&#43;/TAWc6qlCR8n7cAqyrg1GkfCClqJq4soy3ggU/HyxnyCKnNWCipB80fHnngw/nJhNZLqJ7O2 \
yhEHEae9wM74Asn3DJ4BjhIk0eNPTg1ceOcw7JTqe&#43;AOoXIjU8MlxMsFLVxBcP7sbjaPZdxb3CrdjOc4VYXa9fBKYhQ0pQEM=">
 http://blog.sourcepole.ch/2018/09/06/the-tale-of-a-vector-tile-benchmark/</a>&nbsp;)&nbsp;.</span></p>
 </div>
<div>
<p class="x_MsoNormal">&nbsp;</p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10pt; \
font-family:&quot;Arial&quot;,sans-serif; color:navy">For now I am struggling with \
specifying the correct style syntax for the client side&nbsp;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:&quot;Arial&quot;,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&nbsp;Country 'country-italy' to show up renders fine -&nbsp;&nbsp;see <a \
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fka \
rstenv%2Fmvt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fcountries_mvt.png&amp;data=02%7C0 \
1%7Csteve.lime%40state.mn.us%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26 \
b89c2159828c%7C0%7C0%7C636849973214593596&amp;sdata=sCT0dCxsOVV8WK61g86riyFrnHwMUW3kDTq1FncEYIk%3D&amp;reserved=0" \
originalsrc="https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/countries_mvt.png" \
shash="HNHpT/Xads94y2kjhHgiUpl3X8C9nv3L3IObeFVx0IX1kC9ivwEq4mRcJsg8ixfi&#43;Dcl6PprBuw \
YLfjoJhIxv81RQeIxdEDm6WYmpAuVgJQ&#43;l2JiKKGkhxcx9YG/XCNiYcNS/q/OBWYIjrO&#43;hXpFZ5TglZJYyguzxBhDyyu03w4=">
 https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/countries_mvt.png</a></span></p>
 </div>
<div>
<p class="x_MsoNormal">&nbsp;</p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10pt; \
font-family:&quot;Arial&quot;,sans-serif; color:navy">My complete style JSON is at <a \
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fka \
rstenv%2Fmvt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fms_ne_simple.json&amp;data=02%7C0 \
1%7Csteve.lime%40state.mn.us%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26 \
b89c2159828c%7C0%7C0%7C636849973214593596&amp;sdata=rW0SwiqaGZDf1P%2FhVw4677fS69GIdjaQnk5G2cKLWow%3D&amp;reserved=0" \
originalsrc="https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ms_ne_simple.json" \
shash="dmkE&#43;iznHOVJq1/CubUsnxeRpe/FanMbbg14GgLc5OHZOkxFQiaDzi1b30JhE7QVs9eqynafpqm \
8xNfgYBeIU3knTOhoXCR&#43;Dp2IKVofWIyf5/IZSG1dkl1MxJvpf3/mJzQOQ5&#43;EzUHKlWUivWsupPj0/uzLn0XpozMELqAap0Q=">
 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:&quot;Arial&quot;,sans-serif; color:navy">and the corresponding map file \
is here <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith \
ub.com%2Fkarstenv%2Fmvt-benchmark%2Fblob%2Fmaster%2FMapServer%2Fne.map&amp;data=02%7C0 \
1%7Csteve.lime%40state.mn.us%7C8cad89d7aa6f4f29f40e08d68bad2b0d%7Ceb14b04624c445198f26 \
b89c2159828c%7C0%7C0%7C636849973214603601&amp;sdata=N4PGCLEg6xD8VMz6bA%2BnaQPFDyITriOP5V40S4AGt%2FA%3D&amp;reserved=0" \
originalsrc="https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ne.map" \
shash="yBJbWXGMKdIBxUjLZWYvqyxEDP0D8mF7Qe8ywfLtlXd0kQGV2KfceAj4jp2OqYLDrDYxtx6RUKpBslO \
7YuGYvvwPMXsQJqsdftO8oYHZhZozCcbzKHlHov2p9TPR2dn&#43;sCR47/0U8h8wJR0eh8uXnogLTdXe5CPg&#43;8ThCsVlbjQ=">
 https://github.com/karstenv/mvt-benchmark/blob/master/MapServer/ne.map</a></span></p>
 </div>
<div>
<p class="x_MsoNormal">&nbsp;</p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10pt; \
font-family:&quot;Arial&quot;,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:&quot;Arial&quot;,sans-serif; color:navy">To me it seems that somehow \
the&nbsp;attribute is not&nbsp;available to the renderer&nbsp;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:&quot;Arial&quot;,sans-serif; color:navy">&nbsp;</span></p> </div>
<div>
<p class="x_MsoNormal"><span style="font-size:10pt; \
font-family:&quot;Arial&quot;,sans-serif; color:navy">Thanks</span></p> </div>
<div>
<p class="x_MsoNormal"><span style="font-size:10pt; \
font-family:&quot;Arial&quot;,sans-serif; color:navy">Karsten</span></p> </div>
<div>
<p class="x_MsoNormal">&nbsp;</p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10pt; \
font-family:&quot;Arial&quot;,sans-serif; \
color:navy">--------------------------------------------</span></p> </div>
<div>
<p class="x_MsoNormal"><span style="font-size:10pt; \
font-family:&quot;Arial&quot;,sans-serif; color:navy">{<br> &nbsp;&nbsp;&nbsp; \
&quot;id&quot;: &quot;country-fill&quot;,<br> &nbsp;&nbsp;&nbsp; &quot;type&quot;: \
&quot;fill&quot;,<br> &nbsp;&nbsp;&nbsp; &quot;source&quot;: &quot;compass&quot;,<br>
&nbsp;&nbsp;&nbsp; &quot;source-layer&quot;: &quot;allcountries&quot;,<br>
&nbsp;&nbsp;&nbsp; &quot;paint&quot;: {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;fill-color&quot;: {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;property&quot;: \
&quot;mapcolor7&quot;,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&quot;stops&quot;: [<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [1, \
&quot;#fdaf6b&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [2, \
&quot;#fdc663&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [3, \
&quot;#fae364&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [4, \
&quot;#d3e46f&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [5, \
&quot;#aadb78&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [6, \
&quot;#a3cec5&quot;],<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [7, \
&quot;#ceb5cf&quot;]<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
},{<br>
&nbsp;&nbsp;&nbsp; &quot;id&quot;: &quot;country-italy&quot;,<br>
&nbsp;&nbsp;&nbsp; &quot;type&quot;: &quot;fill&quot;,<br>
&nbsp;&nbsp;&nbsp; &quot;source&quot;: &quot;compass&quot;,<br>
&nbsp;&nbsp;&nbsp; &quot;source-layer&quot;: &quot;italy&quot;,<br>
&nbsp;&nbsp;&nbsp; &quot;paint&quot;: {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;fill-color&quot;: &quot;#fdc663&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp; }</span></p>
</div>
<div>
<p class="x_MsoNormal">&nbsp;</p>
</div>
<p class="x_MsoNormal"><span style="font-size:11pt; \
font-family:&quot;Verdana&quot;,sans-serif">Karsten Vennemann<br> </span><span \
style="font-size:10pt; font-family:&quot;Arial&quot;,sans-serif; color:navy">Terra \
GIS </span></p>
</div>
</div>
</body>
</html>


[Attachment #4 (unknown)]

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic