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

Nicholas I nicholas.domnic.i at gmail.com
Mon Sep 13 03:56:38 PDT 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100913/7755394a/attachment.html>


More information about the postgis-users mailing list