Re: [postgis-users] update a geometry field from real fields from postgis datatable
you need a space between the ordinates and you need to put the longitude first. P. On Tue, Mar 13, 2012 at 1:52 PM, francis francis.mil...@free.fr wrote: hello, I have a table with two columns '*lat*' and '*lon*' : it is real type double and a column '*geom*' type geometry; how to make a request to update my column geom from 'lat' and 'lon' columns ? somewhat I wrote this : *update mytable set geom = 'POINT (' | | lat | | '' | | lon | | ')';* but it does not work! Do you have an idea? thank you my config Windows XP Pro SP2 PostGIS 1.5.3 -- -- ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] update a geometry field from real fields from postgis datatable
You can avoid float8 - text - float8 conversions with something like: update mytable set geom = ST_SetSRID(ST_MakePoint(lon, lat), 4326) (I'm guessing SRID=4326, but yours could be different) -Mike On 14 March 2012 09:52, francis francis.mil...@free.fr wrote: hello, I have a table with two columns 'lat' and 'lon' : it is real type double and a column 'geom' type geometry; how to make a request to update my column geom from 'lat' and 'lon' columns ? somewhat I wrote this : update mytable set geom = 'POINT (' | | lat | | '' | | lon | | ')'; but it does not work! Do you have an idea? thank you my config Windows XP Pro SP2 PostGIS 1.5.3 -- ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users