<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 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        mso-believe-normal-left:yes;}
h3
        {mso-style-priority:9;
        mso-style-link:"Heading 3 Char";
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:13.5pt;
        font-family:"Times New Roman","serif";
        font-weight:bold;}
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
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.Heading3Char
        {mso-style-name:"Heading 3 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 3";
        font-weight:bold;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
span.cp
        {mso-style-name:cp;}
span.c
        {mso-style-name:c;}
span.nb
        {mso-style-name:nb;}
span.p
        {mso-style-name:p;}
span.s2
        {mso-style-name:s2;}
span.k
        {mso-style-name:k;}
span.o
        {mso-style-name:o;}
span.nx
        {mso-style-name:nx;}
span.nv
        {mso-style-name:nv;}
span.na
        {mso-style-name:na;}
span.s1
        {mso-style-name:s1;}
.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;}
--></style><![if mso 9]><style>p.MsoNormal
        {margin-left:3.0pt;}
</style><![endif]><!--[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-NZ" link="blue" vlink="purple" style="margin-left:3.0pt;margin-top:3.0pt;margin-right:3.0pt;margin-bottom:.75pt">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi All,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Was great to see some of you at Foss4G. As you might know, I&#8217;m a committer on the MapFish print module and am really interested in excelling the development
 of that. Hopefully I can get some time to do so. To get to the point:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">We use MapServer as our main WMS to build our caches and for printing maps. Currently an SVG is downloaded by the print module and then rendered onto a Graphics2D
 object inside the module and then rendered onto a PDF document with iTextPDF. We would like to make this process a bit slicker and render from PostGIS directly with the help of the style defined inside the map files. An idea inspired by Jesse Eichar was that
 we use GeoTools and include it as a dependency to do the heavy work for us. But does this mean we would need to implement parsing the map files somehow or is there already functionality for that inside GeoTools?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I found this on the MapServer docs (sorry for the HTML email, but I thought it&#8217;s more readable&#8230;
</span><a href="http://mapserver.org/ogc/sld.html">http://mapserver.org/ogc/sld.html</a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">):<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:22.5pt;margin-right:0cm;margin-bottom:7.5pt;margin-left:0cm;background:#C6C6DB">
<span style="font-size:11.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#212224;background:white">PHP/MapScript Example that Generates an SLD from a Mapfile<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:18.0pt"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#3E4349;background:white">The following is a small script that calls the generateSLD() function to create an SLD for a specific layer in a mapfile:<o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0" style="margin-left:6.0pt">
<tbody>
<tr>
<td style="padding:0cm 6.0pt 0cm 6.0pt">
<div style="mso-element:para-border-div;border:solid #C6C9CB 1.0pt;padding:4.0pt 0cm 4.0pt 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">1<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">2<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">3<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">4<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">5<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">6<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">7<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">8<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">9<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">10<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">11<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">12<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">13<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">14<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">15<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">16<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">17<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">18<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">19<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">20<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">21<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">22<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">23<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">24<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">25<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">26<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#AAAAAA">27<o:p></o:p></span></p>
</div>
</td>
<td style="padding:0cm 6.0pt 0cm 6.0pt">
<div style="mso-element:para-border-div;border:solid #C6C9CB 1.0pt;padding:8.0pt 8.0pt 8.0pt 8.0pt;background:white">
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#007020">&lt;?php</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#408090">// define variables</span></i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#007020">define</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">(</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">&quot;MAPFILE&quot;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">,</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">&quot;D:/ms4w/apps/cadastra/map/cadastra.map&quot;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">);</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#007020">define</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">(</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">&quot;MODULE&quot;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">,</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">&quot;php_mapscript.dll&quot;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">);</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#408090">// load the mapscript module</span></i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<b><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#007020">if</span></b><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">(</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#666666">!</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#007020">extension_loaded</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">(</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">&quot;MapScript&quot;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">))</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#007020">dl</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">(MODULE);</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#408090">// open map</span></i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#BB60D5">$oMap</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#666666">=</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">ms_newMapObj(</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">MAPFILE</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">);</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#408090">// get the parcel layer</span></i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#BB60D5">$oLayer</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#666666">=</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#BB60D5">$oMap</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#666666">-&gt;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">getLayerByName</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">(</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">&quot;parcel&quot;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">);</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#408090">// force visibilty of the layer</span></i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#BB60D5">$oLayer</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#666666">-&gt;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">set</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">(</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">'status'</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">,</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">MS_ON);</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#408090">// generate the sld for that layer</span></i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#BB60D5">$SLD</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#666666">=</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#BB60D5">$oLayer</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#666666">-&gt;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">generateSLD</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">();</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#408090">// save sld to a file</span></i><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#BB60D5">$fp</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#666666">=</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#007020">fopen</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">(</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">&quot;parcel-sld.xml&quot;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">,</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#4070A0">&quot;a&quot;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">);</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#007020">fputs</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">(</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#BB60D5">$fp</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">,</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#BB60D5">$SLD</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">
</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">);</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#007020">fclose</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">(</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#BB60D5">$fp</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222">);</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:18.0pt;margin-right:0cm;margin-bottom:18.0pt;margin-left:0cm;mso-line-height-alt:14.4pt;background:white;border:none;padding:0cm">
<span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#007020">?&gt;</span><span style="font-size:14.5pt;font-family:&quot;Courier New&quot;;color:#222222"><o:p></o:p></span></p>
</div>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Is there a way to use this functionality with GeoTools or another Java library?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Thoughts are appreciated.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Tim<o:p></o:p></span></p>
</div>
<br>
<hr>
<font face="Arial" color="Green" size="1">Please consider the environment before printing this email<br>
Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails.<br>
The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz<br>
</font>
</body>
</html>