Your table is setup to accept only MULTIPOLYGONs. Either adjust your table constraint to allow regular polygons or convert your polygon to a MULTIPOLYGON.<br clear="all">--<br>Nathan Gerber<br>
<br><br><div class="gmail_quote">On Mon, Sep 13, 2010 at 6:56 AM, Nicholas I <span dir="ltr"><<a href="mailto:nicholas.domnic.i@gmail.com">nicholas.domnic.i@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi, <br><br> I want to create a polygon from the given points and clip the area's within the polygon.<br><br>I just tried with the below one to create a polygon,<br><br>\d test_polygon;<br>                                  Table "public.test_polygon"<br>

  Column  |          Type          |                         Modifiers                          <br>----------+------------------------+------------------------------------------------------------<br> gid      | integer                | not null default nextval('test_polygon_gid_seq'::regclass)<br>

 name     | character varying(254) | <br> the_geom | geometry               | <br>Indexes:<br>    "test_polygon_pkey" PRIMARY KEY, btree (gid)<br>Check constraints:<br>    "enforce_dims_the_geom" CHECK (st_ndims(the_geom) = 2)<br>

    "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL)<br>    "enforce_srid_the_geom" CHECK (st_srid(the_geom) = 4326)<br><br><b>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))'));<br>

</b><br>i get a message saying,<br><br>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))'));<br><b>ERROR:  new row for relation "test_polygon" violates check constraint "enforce_geotype_the_geom"</b><br>

<br><b>Can anyone help me how do i form a polygon with these points.</b><br><br>Thank you<br><font color="#888888">-Nicholas I<br><br>
</font><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br>