[postgis-users] A simple GeomFromText

Fonseca Hespanha de Oliveira, Joao da J.P.daFonsecaHespanhadeOliveira at tudelft.nl
Wed Nov 14 08:11:29 PST 2007


I am just a newbie into PostGIS, but from the SQL code presented I see some puzzling questions (for me, of course):
1. Although two geometry fields exist in the table, I see constraints just for one of them (geometria);
2. The SRID and other fields in the table refer to a geographical reference system (not projected);
3. Given the statement above, how could a Point with coordinates (1 1) be inserted??!
4. Further, each coordinate should have a space separating the next coordinate in the tuple, not a comma.
 
If PostGIS uses decimal degrees for geographic coordinates, then a typical Point insertion would be:
POINT(2.82806 41.98500)
which is longitude (positive is East) and latitude (positive is North).
 
Regards,
Joao 

________________________________

From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Amrita p
Sent: Wednesday, November 14, 2007 9:51 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] A simple GeomFromText



Because in ur table the constraint is 2 dimension.  U cant store point into ur table. To store point delete the constraint for two dim.


On Thu, 01 Nov 2007 mcompte at sigte.udg.es wrote :
>Hi,
>
>I might have missed something, but I keep looking at it and can't
>understand why the following keeps throwing an 'invalid geometry' error :(
>
>Here's the table:
>
>------------------------
>CREATE TABLE asistentes
>(
>  gid int8 NOT NULL,
>  nombre varchar(150),
>  longitud float8,
>  latitud float8,
>  the_geom geometry,
>  geometria geometry,
>  CONSTRAINT asistentes_pkey PRIMARY KEY (gid),
>  CONSTRAINT enforce_dims_geometria CHECK (ndims(geometria) = 2),
>  CONSTRAINT enforce_geotype_geometria CHECK (geometrytype(geometria) =
>'POINT'::text OR geometria IS NULL),
>  CONSTRAINT enforce_srid_geometria CHECK (srid(geometria) = 4326)
>)
>WITHOUT OIDS;
>ALTER TABLE asistentes OWNER TO postgres;
>------------------------
>
>The table is already populated and then I try updating one of the
>geometries with:
>
>------------------------
>UPDATE asistentes SET geometria=GeometryFromText('POINT(1,1)', 4326) WHERE
>gid=3;
>------------------------
>
>And I get the following Explain comment?
>
>------------------------
>La consulta insertó una fila con OID 0.
>
>ERROR:  parse error - invalid geometry
>------------------------
>
>The spanish line says something like 'the query added one row with OID 0'.
>If anyone could shed some light on this I'd very much appreciate it :)
>
>Marc
>
>_______________________________________________
>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/20071114/9bdf11d9/attachment.html>


More information about the postgis-users mailing list