[postgis-users] help on converting points to polygon.

Nathan Gerber ngerber999 at gmail.com
Mon Sep 13 05:18:33 PDT 2010


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 <nicholas.domnic.i at gmail.com>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
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100913/31dd80e8/attachment.html>


More information about the postgis-users mailing list