<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="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 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.MsoEnvelopeAddress, li.MsoEnvelopeAddress, div.MsoEnvelopeAddress
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:144.0pt;
        margin-bottom:.0001pt;
        mso-element:frame;
        font-size:12.0pt;
        font-family:Verdana;}
p.MsoEnvelopeReturn, li.MsoEnvelopeReturn, div.MsoEnvelopeReturn
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:Verdana;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:Verdana;
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
/* List Definitions */
@list l0
        {mso-list-id:571282661;
        mso-list-type:hybrid;
        mso-list-template-ids:616959696 134807569 134807577 134807579 134807567 134807577 134807579 134807567 134807577 134807579;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1
        {mso-list-id:1497764146;
        mso-list-type:hybrid;
        mso-list-template-ids:774770132 134807569 134807577 134807579 134807567 134807577 134807579 134807567 134807577 134807579;}
@list l1:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050" />
</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-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'>I’m planning on creating a tool for the centralised
storage and retrieval of QGIS vector layer styling. What I would like to do is whenever
PostGIS/Shape file layers are loaded into any project, the associated QGIS styling
information stored in a database is automatically set for that layer. This
would be particularly useful for accessing consistent styling for data sources in
multiple user environments.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'>My initial thought is to create a python plug-in
that does two things:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 face=Verdana><span lang=EN-NZ style='font-size:10.0pt;font-family:Verdana'><span
style='mso-list:Ignore'>1)<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'> </span></font></span></span></font><![endif]><font
size=2 face=Verdana><span lang=EN-NZ style='font-size:10.0pt;font-family:Verdana'>Stores
QML styling information and a layer identifier into a database for any selected
vector layer. This database could be a PostgreSQL instance or the QGIS Sqlite
DB.<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 face=Verdana><span lang=EN-NZ style='font-size:10.0pt;font-family:Verdana'><span
style='mso-list:Ignore'>2)<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'> </span></font></span></span></font><![endif]><font
size=2 face=Verdana><span lang=EN-NZ style='font-size:10.0pt;font-family:Verdana'>On
the load of a layer its identifier is matched in the database and will automatically
have its styling set.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'>A small enhancement would be to apply a stored
style to any given vector layer. I’m also planning on storing and
retrieving styling information for v1 and v2 renderers.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'>At this point, I have three questions:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2'><![if !supportLists]><font
size=2 face=Verdana><span lang=EN-NZ style='font-size:10.0pt;font-family:Verdana'><span
style='mso-list:Ignore'>1)<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'> </span></font></span></span></font><![endif]><font
size=2 face=Verdana><span lang=EN-NZ style='font-size:10.0pt;font-family:Verdana'>What
is the best layer identifier to use for storage in the database? I currently
have a set PostGIS layers are not unique across the whole database (i.e. some
tables with same name in difference schemas), so this could be an issue when
using the layer name. I thought about using the datasource URI, but that does
not look very useful for PostGIS layers as the table schema is only populated when
not in the PostgreSQL user’s schema search path.<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2'><![if !supportLists]><font
size=2 face=Verdana><span lang=EN-NZ style='font-size:10.0pt;font-family:Verdana'><span
style='mso-list:Ignore'>2)<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'> </span></font></span></span></font><![endif]><font
size=2 face=Verdana><span lang=EN-NZ style='font-size:10.0pt;font-family:Verdana'>Is
the best way to set the layer styling information on load by subscribing to the
QgsMapLayerRegistry layerWasAdded signal? Does this event occur before the
layer is first rendered?<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2'><![if !supportLists]><font
size=2 face=Verdana><span lang=EN-NZ style='font-size:10.0pt;font-family:Verdana'><span
style='mso-list:Ignore'>3)<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'> </span></font></span></span></font><![endif]><font
size=2 face=Verdana><span lang=EN-NZ style='font-size:10.0pt;font-family:Verdana'>I
guess I’m going to have issues with the QML styling XML changing between QGIS
versions. What is the best way to deal with this?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'>Thanks<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-NZ style='font-size:
10.0pt;font-family:Verdana'>Jeremy<o:p></o:p></span></font></p>
</div>
<DIV>
<HR>
<DIV>This message contains information, which is confidential and may be subject
to legal privilege. <BR>If you are not the intended recipient, you must not
peruse, use, disseminate, distribute or copy this message.<BR>If you have
received this message in error, please notify us immediately (Phone 0800 665 463
or <A href="mailto:sinfo@linz.govt.nz">info@linz.govt.nz</A> ) and destroy the
original message.</DIV>
<DIV>LINZ accepts no responsibility for changes to this email, or for any
attachments, after its transmission from LINZ.</DIV>
<DIV> </DIV>
<DIV><STRONG>Thank you.</STRONG> <BR></DIV>
<HR>
</DIV>
</body>
</html>