[postgis-users] Inserting geometry

RIBOT, Nicolas nicolas.ribot at astrium.eads.net
Mon Jan 31 09:24:18 PST 2005


> 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
-------------- next part --------------
---------------------------------------------------------

CE COURRIER ELECTRONIQUE EST A USAGE STRICTEMENT INFORMATIF ET NE SAURAIT ENGAGER DE QUELQUE MANIERE QUE CE SOIT EADS ASTRIUM SAS, NI SES FILIALES.

SI UNE ERREUR DE TRANSMISSION OU UNE ADRESSE ERRONEE A MAL DIRIGE CE COURRIER, MERCI D'EN INFORMER L'EXPEDITEUR EN LUI FAISANT UNE REPONSE PAR COURRIER ELECTRONIQUE DES RECEPTION. SI VOUS N'ETES PAS LE DESTINATAIRE DE CE COURRIER, VOUS NE DEVEZ PAS L'UTILISER, LE CONSERVER, EN FAIRE ETAT, LE DISTRIBUER, LE COPIER, L'IMPRIMER OU EN REVELER LE CONTENU A UNE TIERCE PARTIE.



This email is for information only and will not bind EADS Astrium SAS in any contract or obligation, nor its subsidiaries.

If you have received it in error, please notify the sender by return email. If you are not the addressee of this email, you must not use, keep, disseminate, copy, print or otherwise deal with it.

---------------------------------------------------------


More information about the postgis-users mailing list