[postgis-users] Inserting geometry

TECHER Jean David davidtecher at yahoo.fr
Mon Jan 31 09:20:24 PST 2005


U forgot teh double parenthses for POLYGON => POLYGON((... ...))

it is

(GeomFromText('POLYGON((-141.089 36.393 -52.089 89.785)',4326)));

and not

(GeomFromText('POLYGON(-141.089 36.393 -52.089 89.785)',4326));

and furthermore your geometries requires more points (>3 not 1)

----------------------------------------------------------------
TECHER Jean David
Responsable Informatique 01MAP
e-mail: davidtecher at yahoo.fr
Bureau: 04 67 45 60 27
Portable: 06 85 37 36 75
site perso : http://techer.pascal.free.fr/postgis/
site pro: http://www.01map.com/download/
K-S:"The greatest trick the devil pulled off was convincing people he didn't
exist"
------------------------------------------------------------
----- Original Message -----
From: "Kralidis,Tom [Burlington]" <Tom.Kralidis at ec.gc.ca>
To: <postgis-users at postgis.refractions.net>
Sent: Monday, January 31, 2005 6:15 PM
Subject: [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?
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list