pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem with GeomFromText('POINT(...
2+ messages / 2 participants
[nested] [flat]

* Problem with GeomFromText('POINT(...
@ 2008-04-28 07:34  J Fran <jllfnpg@hotmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: J Fran @ 2008-04-28 07:34 UTC (permalink / raw)
  To: pgsql-admin


I'm trying upate a group of records. In the table I have 1 field geometry and 2 fields ineteger with long. and lat. everyone. I try to update the field geometry with point(long lat).
 
I use this update with numbers and this is ok.UPDATE public."Contenedor" SET ubicacion = GeomFromText('POINT(1.9845 49.8543)', 4326) but when i change the number by a field this is not ok. : UPDATE public."Contenedor" SET ubicacion = GeomFromText('POINT(public.Contenedor.long 49.8543)', 4326)  I have this error.
ERROR: parse error - invalid geometry Estado SQL:XX000 Contexto:SQL function "geomfromtext" statement 1 Everyone can tell ma some solution please.
 
Thank you.
 
 

_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE=

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Problem with GeomFromText('POINT(...
@ 2008-04-28 07:55  Brian Modra <epailty@googlemail.com>
  parent: J Fran <jllfnpg@hotmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Brian Modra @ 2008-04-28 07:55 UTC (permalink / raw)
  To: J Fran <jllfnpg@hotmail.com>; +Cc: pgsql-admin

The "long" column isn't being referenced the way you've written this,
because its inside of a quoted string.
You need to construct the string
GeomFromText('POINT(' || public.Contenedor.long || ' 49.8543)', 4326)

2008/4/28 J Fran <jllfnpg@hotmail.com>:
>
>  I'm trying upate a group of records. In the table I have 1 field geometry
> and 2 fields ineteger with long. and lat. everyone. I try to update the
> field geometry with point(long lat).
>
>  I use this update with numbers and this is ok.
>
> UPDATE
> public."Contenedor"
> SET
> ubicacion = GeomFromText('POINT(1.9845 49.8543)', 4326)
>
> but when i change the number by a field this is not ok. :
>
> UPDATE
> public."Contenedor"
> SET
> ubicacion = GeomFromText('POINT(public.Contenedor.long 49.8543)', 4326)
>
>
> I have this error.
>
> ERROR: parse error - invalid geometry
> Estado SQL:XX000
> Contexto:SQL function "geomfromtext" statement 1
>
> Everyone can tell ma some solution please.
>
>  Thank you.
>
>
>
>
> ________________________________
> Discover the new Windows Vista Learn more!



-- 
Brian Modra Land line: +27 23 5411 462
Mobile: +27 79 183 8059
5 Jan Louw Str, Prince Albert, 6930
Postal: P.O. Box 2, Prince Albert 6930
South Africa



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2008-04-28 07:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-04-28 07:34 Problem with GeomFromText('POINT(... J Fran <jllfnpg@hotmail.com>
2008-04-28 07:55 ` Brian Modra <epailty@googlemail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox