<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi Glen,</div><div><br></div><div>Thank you so much for this, it's really helpful! I'm trying it out now with my data.</div><div><br></div><div>All the best, Charles.</div><div><br>On 14 Mar 2014, at 5:54 PM, Glenn Mullett <<a href="mailto:GMullett@lidwala.com">GMullett@lidwala.com</a>> wrote:<br><br></div><blockquote type="cite"><div>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<div class="moz-cite-prefix"><font size="-1">Hi Charles<br>
<br>
To explode geomteries, you can use st_dump<br>
<br>
e.g.<br>
<br>
<font face="Courier New, Courier, monospace">select<br>
gid,<br>
st_geometrytype(the_geom) as orig_geom_type, <br>
st_nrings(the_geom) as orig_geom_number_rings,<br>
st_geometrytype((st_dump(the_geom)).geom) as dumped_geom_type,<br>
(st_dump(the_geom)).path as dumped_geom_ordinal_num,<br>
(st_dump(the_geom)).geom as dumped_geom,<br>
main_place<br>
from static_main_place <br>
order by 1,5<br>
<br>
(see my pic below with some comments and the result...)<br>
</font><br>
<st_dump.png><br>
<br>
<br>
<br>
<br>
<br>
</font>
<div class="moz-signature">
<title></title>
<br>
<div class="moz-signature">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@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:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
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.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</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]-->
<p class="MsoNormal"><span style="color:#595959">Kind regards, <o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:
"Verdana","sans-serif";color:#595959" lang="EN-ZA">Glenn Mullett<o:p></o:p></span></b></p>
<p class="MsoNormal"><i><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:#595959" lang="EN-ZA">H.O.D. GIS [MSc GIS, Btech Nat. Cons.]<o:p></o:p></span></i></p>
<p class="MsoNormal"><b><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:#595959" lang="EN-ZA">Lidwala Consulting Engineers<br>
<br>
</span></b></p>
<div class="MsoNormal" style="text-align:center" align="center"><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#1F497D;
layout-grid-mode:line" lang="EN-ZA">
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal"><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600"
o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"
stroked="f">
<v:stroke joinstyle="miter" />
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0" />
<v:f eqn="sum @0 1 0" />
<v:f eqn="sum 0 0 @1" />
<v:f eqn="prod @2 1 2" />
<v:f eqn="prod @3 21600 pixelWidth" />
<v:f eqn="prod @3 21600 pixelHeight" />
<v:f eqn="sum @0 0 1" />
<v:f eqn="prod @6 1 2" />
<v:f eqn="prod @7 21600 pixelWidth" />
<v:f eqn="sum @8 21600 0" />
<v:f eqn="prod @7 21600 pixelHeight" />
<v:f eqn="sum @10 21600 0" />
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" />
<o:lock v:ext="edit" aspectratio="t" />
</v:shapetype><v:shape id="Picture_x0020_2" o:spid="_x0000_s1026" type="#_x0000_t75"
alt="Lidwala" style='position:absolute;margin-left:1.5pt;margin-top:0;
width:139.5pt;height:92.25pt;z-index:1;visibility:visible;mso-wrap-style:square;
mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;
mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;
mso-position-horizontal-relative:text;mso-position-vertical:absolute;
mso-position-vertical-relative:text'>
<v:imagedata src="lidwala.jpg" o:title="Lidwala" />
<w:wrap type="square"/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--><span style="font-size:8.0pt;
font-family:"Verdana","sans-serif";color:#595959" lang="EN-ZA"><lidwala.jpg>P.O.
Box 2930, Nelspruit, 1200</span><br>
<span style="font-size:8.0pt;font-family:"Verdana","sans-serif";color:#595959" lang="EN-ZA"><o:p></o:p>Tel: 0861 LIDWALA / 0861 543 9252<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Verdana","sans-serif";color:#595959" lang="EN-ZA">Fax: 086 766 2829</span><span style="font-size:10.0pt;
font-family:"Verdana","sans-serif";color:#595959"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Verdana","sans-serif";color:#595959" lang="EN-ZA">Cell:
<b>082 922 3831</b><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Verdana","sans-serif";color:#595959" lang="EN-ZA">Website:
</span><span style="color:#1F497D"><a href="www.lidwala.com"><span style="font-size:8.0pt;font-family:
"Verdana","sans-serif";color:#595959" lang="EN-ZA">www.lidwala.com</span></a></span><span style="font-size:8.0pt;font-family:"Verdana","sans-serif";color:#595959" lang="EN-ZA"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Verdana","sans-serif";color:#595959" lang="EN-ZA">Mailto:
</span><span style="color:#1F497D"><a href="mailto:mgmullett@lidwala.com"><b><span style="font-size:8.0pt;
font-family:"Verdana","sans-serif";color:#595959" lang="EN-ZA">gmullett@lidwala.com</span></b></a></span><span style="font-size:8.0pt;font-family:"Verdana","sans-serif";color:#595959">
<span lang="EN-ZA"><o:p></o:p></span></span></p>
<div class="MsoNormal" style="text-align:center" align="center"><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#1F497D;
layout-grid-mode:line" lang="EN-ZA">
<hr size="2" width="100%" align="center">
</span></div>
<thinkbeforeprint.jpg>
<div class="MsoNormal" style="text-align:center" align="center"><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#1F497D;
layout-grid-mode:line" lang="EN-ZA">
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal"><b><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#7F7F7F;layout-grid-mode:line" lang="EN-ZA">Lidwala Consulting Engineers (SA) (Pty) Ltd email Disclaimer and confidentiality note:<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#7F7F7F;layout-grid-mode:line" lang="EN-ZA"> This e-mail, its attachments and any rights attaching hereto are, unless the content clearly indicates otherwise, the property
of Lidwala Consulting Engineers (SA) (Pty) Ltd and its subsidiaries. It is confidential, private and intended for only the addressee. Should you not be the addressee and receive this e-mail by mistake, kindly notify the sender, and delete this e-mail immediately.
Do not disclose or use it in any way. Views and opinions expressed in this e-mail are those of the sender unless clearly stated as those of Lidwala Consulting Engineers (SA) (Pty) Ltd. Lidwala Consulting Engineers (SA) (Pty) Ltd accepts no liability for
any loss or damages howsoever incurred, or suffered, resulting or arising, from the use of this email or its attachments. Lidwala Consulting Engineers (SA) (Pty) Ltd does not warrant the integrity of this e-mail nor that it is free of errors, viruses, interception
or interference.<o:p></o:p></span></p>
<div class="MsoNormal" style="text-align:center" align="center"><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#1F497D;
layout-grid-mode:line" lang="EN-ZA">
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
On 14/03/14 17:04, Charles Rethman wrote:<br>
</div>
<blockquote cite="mid:BBC2E039-9C96-4DB8-B622-599E8AD6EA2F@me.com" type="cite">
<div>Hello PostGIS experts out there, I have a technical question for you all...</div>
<div><br>
</div>
<div>I need to effect 'clips' in PostGIS and I have tried using ST_Difference. I got very messy outputs and then I read in the PostGis Manual the the function doesn't work with Collections. In importing my shape file data into PostGIS, I created multi-polygon
geometries--so I presume that is why the ST_Difference function won't give me sensible results.</div>
<div><br>
</div>
<div>Is there a function or a way in PostGIS of converting multi-polygons into single polygons (a kind of 'explode' function) so that I don't have to re-import all my shape files (I really HATE those old shape files!)</div>
<div><br>
</div>
<div>I am using PostGIS 2.1 on postgres 9.3...</div>
<div><br>
</div>
<div>Thank you for your time,</div>
<div><br>
<div>
<div style="color: rgb(0, 0, 0); font-family: 'Gill Sans';
font-size: 15px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space;">
<div style="color: rgb(0, 0, 0); font-variant: normal;
letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; widows: auto; word-spacing:
0px; -webkit-text-stroke-width: 0px; word-wrap:
break-word; -webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;">
<span style="color: rgb(0, 0, 0); font-variant: normal;
letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
float: none; display: inline !important;">Charles
Rethman</span><br style="color: rgb(0, 0, 0);
font-variant: normal; letter-spacing: normal;
line-height: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space:
normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px;">
<span style="color: rgb(0, 0, 0); font-variant: normal;
letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
float: none; display: inline !important;"><font face="GillSans-Light">Director,<span class="Apple-converted-space"> </span></font><font face="GillSans-LightItalic"><i>Cape
Town Office</i></font></span><br style="color: rgb(0, 0, 0); font-variant: normal;
letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;">
</div>
<div style="font-family: 'Gill Sans'; font-weight: normal;
font-style: normal; font-size: 13px; color: rgb(0, 0, 0);
font-variant: normal; letter-spacing: normal; line-height:
normal; orphans: auto; text-align: start; text-indent:
0px; text-transform: none; white-space: normal; widows:
auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;
word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space;">
<span style="color: rgb(0, 0, 0); font-family: 'Gill
Sans'; font-size: 13px; font-style: normal;
font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
float: none; display: inline !important;"><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-variant: normal;
letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; widows: auto; word-spacing:
0px; -webkit-text-stroke-width: 0px; word-wrap:
break-word; -webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;">
<font color="#77787a">Cell: +27 71 6735502</font></div>
<div style="color: rgb(0, 0, 0); font-variant: normal;
letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; widows: auto; word-spacing:
0px; -webkit-text-stroke-width: 0px; word-wrap:
break-word; -webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;">
<font color="#77787a">Tel: +27 21 6861510</font></div>
<div style="color: rgb(0, 0, 0); font-variant: normal;
letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; widows: auto; word-spacing:
0px; -webkit-text-stroke-width: 0px; word-wrap:
break-word; -webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;">
<font color="#77787a">Skype: cwrethman</font></div>
<div style="color: rgb(0, 0, 0); font-variant: normal;
letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; widows: auto; word-spacing:
0px; -webkit-text-stroke-width: 0px; word-wrap:
break-word; -webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;">
<font color="#77787a">PO Box 23507, Claremont, 7735, South Africa</font></div>
<div style="color: rgb(0, 0, 0); font-variant: normal;
letter-spacing: normal; line-height: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; widows: auto; word-spacing:
0px; -webkit-text-stroke-width: 0px; word-wrap:
break-word; -webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;">
<font color="#77787a">19 Sans Souci Road, Newlands, 7700, Cape Town</font></div>
</div>
<br style="color: rgb(0, 0, 0); font-family: 'Gill Sans';
font-size: 15px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<div style="color: rgb(0, 0, 0); font-family: 'Gill Sans';
font-size: 15px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<span><a moz-do-not-send="true" href="http://www.wahenga.co.za"><br class="Apple-interchange-newline">
<span><img moz-do-not-send="true" apple-inline="yes" id="C198D6FF-5B40-4120-99E6-0090775CAE69" apple-width="yes" apple-height="yes" src="cid:"></span></a></span></div>
</div>
</div>
</blockquote>
<br>
</div></blockquote><blockquote type="cite"><div><st_dump.png></div></blockquote><blockquote type="cite"><div><lidwala.jpg></div></blockquote><blockquote type="cite"><div><thinkbeforeprint.jpg></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Africa mailing list</span><br><span><a href="mailto:Africa@lists.osgeo.org">Africa@lists.osgeo.org</a></span><br><span><a href="http://lists.osgeo.org/mailman/listinfo/africa">http://lists.osgeo.org/mailman/listinfo/africa</a></span></div></blockquote></body></html>