<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br>Hi James,<br><br>I suggest you avoid upper case letters in table & column names if you can. It makes a few things easier....<br><br>The syntax in both SQL statements is wrong. Try:<br><br><span style="font-style: italic;">select ST_CreateGeometryColumn('public','CLEANEDCAMDENGPS','geom',4326,'POINT',2);</span><br style="font-style: italic;"><br>the fields are (in order):<br><br>schema where table can be found ('public')<br>the table name where you want the new column (<span style="font-style: italic;">'CLEANEDCAMDENGPS')</span><br>the name of the geometry column to create (<span style="font-style: italic;">'geom')</span><br>the SRID of the geometry column to create (<span style="font-style: italic;">4326)</span><br>the geometry type<span style="font-style: italic;"> ('POINT')</span><br>the number of dimensions (<span style="font-style:
italic;"></span>2 - x & y)<br><br>All string values need to be quoted.<br><br>To populate this column try:<br><br><span style="font-style: italic;">update "CLEANEDCAMDENGPS"</span><br style="font-style: italic;"><span style="font-style: italic;">set geom=setsrid(makepoint("LONGITUDE","LATITUDE"),4326);</span><br><br>So, create a point geometry from the two numeric columns (makepoint), force the SRID of this geometry to 4326 (setsrid), & write this value to your new column (update table set column =).<br><br><br>HTH,<br><br> Brent Wood<br><br><br>James Smith wrote:<br>> Dear all,<br>><br>> Would appreciate some help. I have created an existing database (with<br>> PostGIS extension) and it has a table called CLEANEDCAMDENGPS which <br>> is populated with approx 600,000 rows. There are 20 or so columns in the<br>> table, two of which are Latitude and Longitude (WGS84). I would now<br>> like to create a Geom column with
points in, the values of which<br>> should be taken from the latitude and longitude column. Could someone<br>> provide me with sample code as to how to do this please? I had a go<br>> with the below, but don't really know what I'm doing... neither of the<br>> statements work...<br>><br>> --CREATE THE COLUMN--<br>> SELECT AddGeometryColumn('CAMDENGPS', 'GPS_POINTS', 'geom', 4326, 'POINT', 2)<br>><br>> --POPULATE THE COLUMN--<br>> INSERT INTO CLEANEDCAMDENGPS (GPS_POINTS)<br>> VALUES ( ST_GEOMFROMTEXT('POINT((SELECT LONGITUDE FROM<br>> CLEANEDCAMDENGPS) (SELECT LATITUDE FROM CLEANEDCAMDENGPS))', 4326,<br>> 'Point'));<br>><br>> Thank you<br>><br>> James<br>> _______________________________________________<br>> postgis-users mailing list<br>> postgis-users@postgis.refractions.net<br>>
http://postgis.refractions.net/mailman/listinfo/postgis-users<br>><br><br>_______________________________________________<br>postgis-users mailing list<br>postgis-users@postgis.refractions.net<br>http://postgis.refractions.net/mailman/listinfo/postgis-users<br></td></tr></table>