<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">But his lat/lon are character varying so I think it would be more like<div><br></div><div><pre class="programlisting"><span class="Apple-style-span" style="white-space: normal; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;">update mytable set the_geom=</span></font></span><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;">ST_GeometryFromText('POINT(' || long || ' ' || lat || ')',4326)</span></font></pre><div><br></div><div><br></div><div><div>On Mar 25, 2011, at 11:26 AM, Stephen Woodbridge wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>update mytable set the_geom=st_setsrid(st_makepoint(lon,lat),4326);<br><br>On 3/25/2011 10:44 AM, Gis Mage wrote:<br><blockquote type="cite">Hello!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I have a table with two text fields "lat" and "long" of character<br></blockquote><blockquote type="cite">varying type.<br></blockquote><blockquote type="cite">I've created a field the_geom with type geometry.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">How do I calculate the_geom field with an sql query?<br></blockquote><blockquote type="cite">The table is huge - about 1.5 million records, so I think the fastest<br></blockquote><blockquote type="cite">way to do this is to use pointfromtext function, but I can't figure out<br></blockquote><blockquote type="cite">how to put in the values of "lat" and "long" fields inside function<br></blockquote><blockquote type="cite">arguments.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Can anyone help me out?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">postgis-users mailing list<br></blockquote><blockquote type="cite"><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br></blockquote><blockquote type="cite"><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></blockquote><br>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>http://postgis.refractions.net/mailman/listinfo/postgis-users<br></div></blockquote></div><br></div></body></html>