[postgis-users] what if my table contain multipolygon

Paragon Corporation lr at pcorp.us
Sun Oct 11 13:45:05 PDT 2009


Oops didn't see this question.  
 
If you have multipolygons use ST_Dump instead.  So something like
 
SELECT gid As poly_id, path[1] As ring_num, n As point_id, ST_PointN(geom,n)
As the_geom 

 

FROM (SELECT gid, (ST_Dump( ST_Boundary(the_geom) ) ).*

    FROM sometable) 

 As foo

CROSS JOIN generate_series(1, 10000) As n WHERE n < ST_NPoints(geom)

 

 

NOTE: the ST_Dump will give you 2 fields geom, and path which is an array


  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Randall,
Eric
Sent: Sunday, October 11, 2009 10:53 AM
To: postgis-users at postgis.refractions.net
Subject: Re: [postgis-users] what if my table contain multipolygon


  
Then maybe use ST_geometryn to get a single polygon such as
 
select generate_series(1, ST_npoints(geom)-1) as point_id ,
ST_pointn(ST_exteriorring(ST_geometryn(geom,1)),generate_series(1,
ST_npoints(geom)-1)) as geom from polygontable
 
 
-Eric
 
 

-----
From: eehab hamzeh [mailto:eehab40 at hotmail.com]
Sent: Sunday, October 11, 2009 9:33 AM
To: Randall, Eric
Subject: what if my table contain multipolygon



thanks eric for your replay

What if my table contain multipolygon 
how can i adjust the sql statement

select generate_series(1, ST_npoints(geom)-1) as point_id ,
ST_pointn(ST_exteriorring(geom),generate_series(1, ST_npoints(geom)-1)) as
geom from polygontable .

Kind regards







  _____  

Windows Live: Friends get your Flickr, Yelp, and Digg updates when they
e-mail
<http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/so
cial-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_3:092010
> you. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20091011/af5bede5/attachment.html>


More information about the postgis-users mailing list