[postgis-users] UPDATE THE_GEOM IN MY TABLE

Mike Toews mwtoews at gmail.com
Mon Feb 8 07:50:23 PST 2010


2010/2/8 eehab hamzeh <eehab40 at hotmail.com>
>
> I am trying to update the_geom in my table i use the following sql statement i receive error
>
> update vertix set the_geom = GeometryFromText('point(select x from vertix || select y from vertix || select z from vertix)')


Much simpler is:

update vertix set the_geom = ST_MakePoint(x, y, z);

Also, rather than keeping both numeric and geometry representations of
the same data, you might find it useful to use updateable views to
show the numeric representation. This way, you can modify the numbers
directly to change the geometry and vice versa, so you don`t have to
synchronize (update) the representations if either change. I have code
if you`d like to see, let me know.

-Mike



More information about the postgis-users mailing list