Your table is setup to accept only MULTIPOLYGONs. Either adjust your table constraint to allow regular polygons or convert your polygon to a MULTIPOLYGON. -- Nathan Gerber
On Mon, Sep 13, 2010 at 6:56 AM, Nicholas I <[email protected]>wrote: > Hi, > > I want to create a polygon from the given points and clip the area's > within the polygon. > > I just tried with the below one to create a polygon, > > \d test_polygon; > Table "public.test_polygon" > Column | Type | > Modifiers > > ----------+------------------------+------------------------------------------------------------ > gid | integer | not null default > nextval('test_polygon_gid_seq'::regclass) > name | character varying(254) | > the_geom | geometry | > Indexes: > "test_polygon_pkey" PRIMARY KEY, btree (gid) > Check constraints: > "enforce_dims_the_geom" CHECK (st_ndims(the_geom) = 2) > "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = > 'MULTIPOLYGON'::text OR the_geom IS NULL) > "enforce_srid_the_geom" CHECK (st_srid(the_geom) = 4326) > > *INSERT INTO test_polygon VALUES (3,'test',PolyFromText('POLYGON((78.76708 > 14.04584,81.54662 14.04584,78.78906 11.25531,81.53564 11.25531,78.76708 > 14.04584))')); > * > i get a message saying, > > INSERT INTO test_polygon VALUES (3,'test',PolyFromText('POLYGON((78.76708 > 14.04584,81.54662 14.04584,78.78906 11.25531,81.53564 11.25531,78.76708 > 14.04584))')); > *ERROR: new row for relation "test_polygon" violates check constraint > "enforce_geotype_the_geom"* > > *Can anyone help me how do i form a polygon with these points.* > > Thank you > -Nicholas I > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > >
_______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
