[postgis-users] Inserting geometry

Kralidis,Tom [Burlington] Tom.Kralidis at ec.gc.ca
Mon Jan 31 09:29:03 PST 2005


Whoops, thanks for the info.  I was trying to insert as a bbox.  A
GeomFromBbox would be nice :)

> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net] On 
> Behalf Of RIBOT, Nicolas
> Sent: Monday, 31 January, 2005 12:24
> To: 'PostGIS Users Discussion'
> Subject: RE: [postgis-users] Inserting geometry
> 
> 
> > Hi,
> > 
> > I have created a table, and corresponding spatial table as per the 
> > documentation, i.e.:
> > 
> > CREATE TABLE service_endpoints (
> >         service_id integer,
> >         service_type varchar(10),
> >         version varchar(5),
> >         title varchar(500),
> >         abstract varchar(8192),
> >         keywords varchar(8192),
> >         organization varchar(100),
> >         contact_email varchar(50),
> >         onlineresource varchar(255),
> >         endpoint_capabilities varchar(255),
> >         endpoint_getresource varchar(255),
> >         minx decimal(10,5),
> >         miny decimal(10,5),
> >         maxx decimal(10,5),
> >         maxy decimal(10,5),
> >         fees varchar(50),
> >         accessconstraints varchar(50),
> >         creation_date timestamp,
> >         update_date timestamp,
> >         owner_user_id varchar(50),
> >         lang varchar(5),
> >         last_check_time timestamp,
> >         available boolean,
> >         average_response_time_seconds integer
> > )
> > ;
> > 
> > SELECT 
> AddGeometryColumn('service_endpoints','service_endpoints_geom'
> > ,4326,'POL
> > YGON',2);
> > 
> > ...when I try to add basic tabular values, everything works fine.
> > 
> > When I try to add geometry:
> > 
> > INSERT INTO service_endpoints (SERVICE_ENDPOINTS_GEOM) VALUES 
> > (GeomFromText('POLYGON(-141.089 36.393 -52.089 89.785)',4326));
> > 
> > ..I received an error "ERROR: parse error - invalid geometry".
> > 
> > Any idea what I'm doing wrong?
> 
> Hi Tom,
> 
> Check the Polygon syntax: a polygon must have at least 4 
> points. the last point must be the same as the first one 
> (closed polygon). The text you entered is a POINT definition 
> Check the documentation for an example of WKT POLYGON syntax
> 
> Nicolas
> 



More information about the postgis-users mailing list