<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3020" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY 
style="WORD-WRAP: break-word; khtml-nbsp-mode: space; khtml-line-break: after-white-space" 
bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I tried: UPDATE locations SET point_geom = 
SetSRID(makepoint('longitude','latitude'), 4326);</FONT></DIV>
<DIV><FONT face=Arial size=2>but got this error:</FONT></DIV>
<DIV><PRE class=data>ERROR:  invalid input syntax for type double precision: "longitude"</PRE><PRE>Could the problem be that my "longitude" column is type "Character Varying"?</PRE></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=brad@bradediger.com href="mailto:brad@bradediger.com">Brad Ediger</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A 
  title=postgis-users@postgis.refractions.net 
  href="mailto:postgis-users@postgis.refractions.net">PostGIS Users 
  Discussion</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, December 29, 2006 1:18 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [postgis-users] Adding 
  Spatial Index to Existing Table</DIV>
  <DIV><BR></DIV>
  <DIV><SPAN class=Apple-style-span 
  style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; border-spacing: 0px 0px; khtml-text-decorations-in-effect: none; apple-text-size-adjust: auto; orphans: 2; widows: 2"><SPAN 
  class=Apple-style-span 
  style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; border-spacing: 0px 0px; khtml-text-decorations-in-effect: none; apple-text-size-adjust: auto; orphans: 2; widows: 2"><SPAN 
  class=Apple-style-span 
  style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; border-spacing: 0px 0px; khtml-text-decorations-in-effect: none; apple-text-size-adjust: auto; orphans: 2; widows: 2">If 
  your lat/longs are WGS84, you should be able to say:<BR 
  class=Apple-interchange-newline></SPAN></SPAN></SPAN></DIV>
  <DIV><BR class=khtml-block-placeholder></DIV>
  <DIV>UPDATE table SET location = SetSRID(MakePoint(Long,Lat), 4326);</DIV>
  <DIV><BR class=khtml-block-placeholder></DIV>
  <DIV>That should update all points in one statement, and set the proper 
  SRID.</DIV>
  <DIV><BR class=khtml-block-placeholder></DIV>
  <DIV>Brad</DIV><BR>
  <DIV>
  <DIV>On Dec 29, 2006, at 1:08 PM, Adam wrote:</DIV><BR 
  class=Apple-interchange-newline>
  <BLOCKQUOTE type="cite">
    <DIV><FONT face=Arial size=2>This is my first try at adding spatial to my 
    table.  Currently I have a 'Lat' and 'Long' columns that have my 
    Latitiude and Longitude.</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT> </DIV>
    <DIV><FONT face=Arial size=2>Do I need to add another column named 
    'Location' and insert each rows 'Lat' and 'Long' into the corresponding 
    'Location' row by doing:  "INSERT INTO table ( Location ) VALUES ( 
    GeometryFromText('Point xx.xxx yy.yyyy', 4326) )" ?  This will 
    assume WGS 84 datum.</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT> </DIV>
    <DIV><FONT face=Arial size=2>Is this right?</FONT></DIV>
    <DIV 
    style="MARGIN: 0px">_______________________________________________</DIV>
    <DIV style="MARGIN: 0px">postgis-users mailing list</DIV>
    <DIV style="MARGIN: 0px"><A 
    href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A></DIV>
    <DIV style="MARGIN: 0px"><A 
    href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A></DIV></BLOCKQUOTE></DIV><BR>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>postgis-users 
  mailing 
  list<BR>postgis-users@postgis.refractions.net<BR>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></BLOCKQUOTE></BODY></HTML>