[OSGeo Africa] Question on PostGIS

Charles Rethman rethman at me.com
Fri Mar 14 23:21:48 PDT 2014


Hi Glen,

Thank you so much for this, it's really helpful! I'm trying it out now with my data.

All the best, Charles.

> On 14 Mar 2014, at 5:54 PM, Glenn Mullett <GMullett at lidwala.com> wrote:
> 
> Hi Charles
> 
> To explode geomteries, you can use st_dump
> 
> e.g.
> 
> select
>     gid,
>     st_geometrytype(the_geom) as orig_geom_type, 
>     st_nrings(the_geom) as orig_geom_number_rings,
>     st_geometrytype((st_dump(the_geom)).geom) as dumped_geom_type,
>     (st_dump(the_geom)).path as dumped_geom_ordinal_num,
>     (st_dump(the_geom)).geom as dumped_geom,
>     main_place
> from static_main_place 
> order by 1,5
> 
> (see my pic below with some comments and the result...)
> 
> <st_dump.png>
> 
> 
> 
> 
> 
> 
> Kind regards,
> Glenn Mullett
> H.O.D. GIS [MSc GIS, Btech Nat. Cons.]
> Lidwala Consulting Engineers
> 
> <lidwala.jpg>P.O. Box 2930, Nelspruit, 1200
> Tel: 0861 LIDWALA / 0861 543 9252
> Fax: 086 766 2829
> Cell: 082 922 3831
> Website: www.lidwala.com
> Mailto: gmullett at lidwala.com
> <thinkbeforeprint.jpg>
> Lidwala Consulting Engineers (SA) (Pty) Ltd email Disclaimer and confidentiality note:
>  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.
>  
>> On 14/03/14 17:04, Charles Rethman wrote:
>> Hello PostGIS experts out there, I have a technical question for you all...
>> 
>> 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.
>> 
>> 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!)
>> 
>> I am using PostGIS 2.1 on postgres 9.3...
>> 
>> Thank you for your time,
>> 
>> Charles Rethman
>> Director, Cape Town Office
>> 
>> Cell: +27 71 6735502
>> Tel: +27 21 6861510
>> Skype: cwrethman
>> PO Box 23507, Claremont, 7735, South Africa
>> 19 Sans Souci Road, Newlands, 7700, Cape Town
>> 
>> 
>> 
> 
> <st_dump.png>
> <lidwala.jpg>
> <thinkbeforeprint.jpg>
> _______________________________________________
> Africa mailing list
> Africa at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/africa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/africa/attachments/20140315/e7dc70db/attachment-0001.html>


More information about the Africa mailing list