[postgis-users] constructing new geometry from existing columns

Kevin Neufeld kneufeld at refractions.net
Wed Nov 21 09:38:41 PST 2007


ST_SetSRID( ST_MakePoint(lon, lat), 4326)

http://postgis.refractions.net/docs/ch06.html

-- Kevin

John Cartwright wrote:
> Hello All,
>
> I'm trying to populate a newly-added geometry column in a table using 
> two existing columns: LON, LAT.  The only way I see to do it seems a 
> little clumsy:
>
> update  grid_points set SHAPE = GeomFromText('POINT(' || lon ||' ' || 
> lat || ')',4326);
>
> Is there a better way than constructing a WKT string?
>
> Thanks!
>
> -- john
>
> _______________________________________________
> 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