I think the problem with ST_MakePoint is that it takes doubles and you're passing strings.  You can try either adding a cast, or using ST_GeomFromText (but that takes WKT, not two points).  So, if your coords are in the columns easting and northing, then you could try:<br>
<br>(using <a href="http://postgis.refractions.net/docs/ST_MakePoint.html">ST_MakePoint</a> and <a href="http://postgis.refractions.net/docs/ST_SetSRID.html">ST_SetSRID</a>)<br>UPDATE Y14_header2 set the_geom = ST_SetSRID(ST_MakePoint(CAST(easting AS double precision), CAST(northing AS double precision)),
27700);<br><br>(I think ST_SetSRID and SetSRID are the same except SetSRID is the old name)<br><br>or<br><br>(using <a href="http://postgis.refractions.net/docs/ST_GeomFromText.html">ST_GeomFromText</a>)<br>UPDATE Y14_header2 set the_geom = ST_GeomFromText('POINT (' || easting || ' ' || northing || ')',27700);<br>
<br>Notice that in the second case I'm concatenating some text in there to make it WKT (WKT for a point is "POINT(x y)").<br><br><br><br><div class="gmail_quote">On Tue, Aug 10, 2010 at 4:53 AM, chrispg <span dir="ltr"><<a href="mailto:chrisemberson@hotmail.com">chrisemberson@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
Thanks Jeff and Brent for your replies.<br>
The re-project vs SetSRID is a useful tip, but all along I thought the data<br>
was in the wrong place - given Brent's reply and the fact I cannot see any<br>
points in QGIS probably means that I need to populate the table, so I ran<br>
this...<br>
<br>
UPDATE Y14_header2 set the_geom = SetSRID(ST_MakePoint(easting, northing),<br>
27700);<br>
<br>
and received this error....<br>
<br>
ERROR:  function st_makepoint(character varying, character varying) does not<br>
exist<br>
LINE 1: UPDATE Y14_header2 set the_geom = setsrid(ST_makepoint(easting,...<br>
                                                  ^<br>
HINT:  No function matches the given name and argument types. You might need<br>
to add explicit type casts.<br>
<br>
I also tried ST_GeomFromText but still the same error.<br>
<br>
Any ideas?<br>
TIA<br>
<div><div></div><div class="h5"><br>
<br>
Hi Chris,<br>
<br>
The steps you carried out were fine, but you need to repopulate your<br>
geometry column.<br>
<br>
dropgeometrycolumn() removes the column from the table<br>
creategeometrycolumn() creates a new EMPTY column<br>
   (does not create any values in that column)<br>
the first update setsrid() tries to set geometries to a different<br>
   SRID than that specified for the geometry column, so fails<br>
the second update setsrid() modifies all the non-existent<br>
   geometry value (does nothing because there are no values to<br>
   update, but is a semantically correct statement, so does not<br>
   fail)<br>
<br>
There is still nothing in that column for QGIS to plot<br>
<br>
I don't know why ogr2ogr created a WGS84 geometry column instead of a<br>
EPSG:27700 one, but it is easy to fix...<br>
<br>
Assuming you now have 2 columns in your table, northing & easting, which are<br>
the coords in EPSG:27700 as numeric values:<br>
<br>
-- your sql statement to create the column is fine<br>
SELECT AddGeometryColumn ('public', 'Y14_header2', 'the_geom',<br>
27700,'POINT',2);<br>
<br>
-- but you need to populate it<br>
UPDATE Y14_header2 set the_geom = setsrid(ST_makepoint(easting, northing),<br>
27700);<br>
<br>
<br>
This will generate point values from the northing & easting columns in the<br>
table, assign the appropriate SRID & write them to the table.<br>
<br>
If you did want WGS84 versions of these you could run:<br>
<br>
SELECT AddGeometryColumn ('public', 'Y14_header2',> 'wgs84_geom',<br>
4326,'POINT',2);<br>
UPDATE Y14_header2 set wgs84_geom = ST_transform(the_geom, 4326);<br>
<br>
which creates a second geometry column in the table in the new projection, &<br>
sets the values in this column to points in the wgs84 coord srid<br>
<br>
<br>
HTH,<br>
<br>
  Brent Wood<br>
--<br>
</div></div>View this message in context: <a href="http://old.nabble.com/Postgis%2C-OGR2OGR-and-QGIS-tp29340858p29395586.html" target="_blank">http://old.nabble.com/Postgis%2C-OGR2OGR-and-QGIS-tp29340858p29395586.html</a><br>

<div><div></div><div class="h5">Sent from the PostGIS - User mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br><span style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;"><span style="border-collapse: separate; font-family: arial; font-size: small;"></span></span><br>