[postgis-users] A simple GeomFromText

Kevin Neufeld kneufeld at refractions.net
Wed Oct 31 13:57:35 PDT 2007


There's no comma in the WKT representation of a POINT.
Try this:

UPDATE asistentes SET geometria=GeometryFromText('POINT(1 1)', 4326) WHERE gid=3;

Cheers,

-------------
Kevin Neufeld
Software Developer
Refractions Research Inc.
300-1207 Douglas St.
Victoria, B.C., V8W 2E7

Phone: (250) 383-3022
Email: kneufeld at refractions.net



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
>   



More information about the postgis-users mailing list