[postgis-users] update a geometry field from real fields from postgis datatable

Mike Toews mwtoews at gmail.com
Tue Mar 13 15:04:47 PDT 2012


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.milhau at 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 at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list