[postgis-users] Using exteriorring

strk at refractions.net strk at refractions.net
Fri Feb 18 09:09:44 PST 2005


On Fri, Feb 18, 2005 at 06:03:22PM +0100, Benoit Ogier wrote:
> i tried 2 geometry columns types 
> 
> the input geometry column is from MULTIPOLYGON type 
> the output geometry column is from POLYGON type 
> 
> I tried also with an output column of MULTIPOLYGON type, and with 
> request like : 
> update nt_ownership_ew set the_geom = exteriorring(the_geom) 
> 
> Each time, i got an error like : 
> 
> ERROR:  new row for relation "nt_ownership_ew" violates check constraint "enforce_geotype_the_geom" 
> 

ExteriorRing() returns a LINESTRING, as per OGC specifications.
Output column should be LINESTRING.
I'm sorry I forgot that, so you need another function to store
it as a polygon...

With postgis-1.0 you can use MakePolygon(ExteriorRing(...)).
With postgis-0.x I'm afraid you have no easy way (but other
users might give you better suggestions)

--strk;


> 
> I use PostGIS 0.9.0 with GEOS 2.0.0 and Proj 4.4.8 under PostGres 
> 8.0.0beta1. My OS : Mac OS X 10.3.7. 
> 
> Thanks, 
> 
> BO 
> 
> Le 18 févr. 05, à 17:27, strk at refractions.net a écrit : 
> 
> 
> > On Fri, Feb 18, 2005 at 05:04:19PM +0100, Benoit Ogier wrote: 
> > 
> > > Hi,  
> > > 
> > > I would use the exteriorring function to get the exterior ring of 
> > > multi  
> > > polygons, convert them to a single poly and store result in a new 
> > > field  
> > > of my table "poly_test".  
> > > 
> > > using this sql command :  
> > > update nt_ownership_ew SET the_geom2 = exteriorring(the_geom)  
> > > 
> > > I get :  
> > > 
> > > 
> > > ERROR:  new row for relation "poly_test" violates check constraint "enforce_geotype_the_geom2" 
> > >  
> > > 
> > > 
> > > the_geom is MULTIPOLYGON kind,  
> > > the_geom2 is POLYGON kind,  
> > > 
> > > Questions :  
> > > - Is it the recommanded way to convert multi-polys to single 
> > > polys ?  
> > > - If yes, where is the error ?  
> > > 
> >  
> > You did everything the way you should, just a question, which 
> > geometry type did you specify in the AddGeometryColumn() call  
> > to create the poly_test field ? 
> > 
> > --strk; 
> > 
> > 
> > >  
> > > Thanks,  
> > > 
> > > BO  
> > > 
> > > --   
> > > Benoît Ogier{  
> > > Carte Blanche Conseil  
> > > 47, rue de Lancry  
> > > 75010 Paris  
> > > Tel : +33 1 42 41 21 21  
> > > Fax : +33 1 42 41 70 40  
> > > email : benoit.ogier at cbconseil.com  
> > > };  
> > > --   
> > > 
> > > 
> > > 
> >  
> > 
> > > _______________________________________________ 
> > > postgis-users mailing list 
> > > postgis-users at postgis.refractions.net 
> > > http://postgis.refractions.net/mailman/listinfo/postgis-users 
> > > 
> >  
> > _______________________________________________ 
> > postgis-users mailing list 
> > postgis-users at postgis.refractions.net 
> > http://postgis.refractions.net/mailman/listinfo/postgis-users 
> > 
> > 
> > 
> --  
> Benoît Ogier{ 
> Carte Blanche Conseil 
> 47, rue de Lancry 
> 75010 Paris 
> Tel : +33 1 42 41 21 21 
> Fax : +33 1 42 41 70 40 
> email : benoit.ogier at cbconseil.com 
> }; 
> --  
> 
> 
> 

> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list