<!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>That worked and solved the problem. Thanks a
lot!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Adam</FONT></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 11:15
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">You'll
have to cast explicitly since your data are in varchars.<BR
class=Apple-interchange-newline></SPAN></SPAN></SPAN></DIV>
<DIV><BR class=khtml-block-placeholder></DIV>
<DIV>MakePoint(longitude::double precision, latitude::double precision)</DIV>
<DIV><BR class=khtml-block-placeholder></DIV>
<DIV>should do the trick.</DIV><BR>
<DIV>
<DIV>On Dec 29, 2006, at 11:08 PM, Adam wrote:</DIV><BR
class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">
<DIV style="MARGIN: 0px">If I run without any quotes I get this error:</DIV>
<DIV style="MARGIN: 0px">ERROR:<SPAN class=Apple-converted-space>
</SPAN>function makepoint(character varying, character varying) does not
exist</DIV>
<DIV style="MARGIN: 0px">HINT:<SPAN class=Apple-converted-space>
</SPAN>No function matches the given name and argument types. You may need
to add explicit type casts.</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px">If I run with double quotes I get this error:</DIV>
<DIV style="MARGIN: 0px">ERROR:<SPAN class=Apple-converted-space>
</SPAN>function makepoint(character varying, character varying) does not
exist</DIV>
<DIV style="MARGIN: 0px">HINT:<SPAN class=Apple-converted-space>
</SPAN>No function matches the given name and argument types. You may need
to add explicit type casts.</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px">Any other ideas as to what the problem is?</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px">I looked up "MakePoint" in my functions and it is
there:</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>Function Arguments Returns Programming language</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>makepoint double precision, double precision geometry c</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>Object File Link Symbol</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>$libdir/liblwgeom.so.1.1 LWGEOM_makepoint</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>Properties</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>IMMUTABLE</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>RETURNS NULL ON NULL INPUT</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>SECURITY INVOKER</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px">----- Original Message ----- From: "Gregory S.
Williamson" <<A
href="mailto:gsw@globexplorer.com">gsw@globexplorer.com</A>></DIV>
<DIV style="MARGIN: 0px">To: "PostGIS Users Discussion" <<A
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A>>;
"PostGIS Users Discussion" <<A
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A>></DIV>
<DIV style="MARGIN: 0px">Sent: Friday, December 29, 2006 11:02 PM</DIV>
<DIV style="MARGIN: 0px">Subject: RE: [postgis-users] Adding Spatial Index
to Existing Table</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px">If you single quote something PostgreSQL will
interpet it as a string ... since they are lower case anyway, try not
quoting them at all, of double quote them if you need to preserve
case:</DIV>
<DIV style="MARGIN: 0px">UPDATE locations SET point_geom =
SetSRID(makepoint(longitude,latitude), 4326);</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px">Or:</DIV>
<DIV style="MARGIN: 0px">UPDATE locations SET point_geom =
SetSRID(makepoint("longitude","latitude"), 4326);</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px">G</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px">-----Original Message-----</DIV>
<DIV style="MARGIN: 0px">From: <A
href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</A>
on behalf of Adam</DIV>
<DIV style="MARGIN: 0px">Sent: Fri 12/29/2006 8:57 PM</DIV>
<DIV style="MARGIN: 0px">To: PostGIS Users Discussion</DIV>
<DIV style="MARGIN: 0px">Cc:</DIV>
<DIV style="MARGIN: 0px">Subject: Re: [postgis-users] Adding Spatial Index
to Existing Table</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px">I tried: UPDATE locations SET point_geom =
SetSRID(makepoint('longitude','latitude'), 4326);</DIV>
<DIV style="MARGIN: 0px">but got this error:</DIV>
<DIV style="MARGIN: 0px">ERROR:<SPAN class=Apple-converted-space>
</SPAN>invalid input syntax for type double precision: "longitude"Could the
problem be that my "longitude" column is type "Character Varying"?-----<SPAN
class=Apple-converted-space> </SPAN>Original Message -----<SPAN
class=Apple-converted-space> </SPAN>From: Brad Ediger</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space> </SPAN>To:
PostGIS Users Discussion</DIV>
<DIV style="MARGIN: 0px"><SPAN
class=Apple-converted-space> </SPAN>Sent: Friday, December 29, 2006
1:18 PM</DIV>
<DIV style="MARGIN: 0px"><SPAN
class=Apple-converted-space> </SPAN>Subject: Re: [postgis-users] Adding
Spatial Index to Existing Table</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space> </SPAN>If
your lat/longs are WGS84, you should be able to say:</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px"><SPAN
class=Apple-converted-space> </SPAN>UPDATE table SET location =
SetSRID(MakePoint(Long,Lat), 4326);</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space> </SPAN>That
should update all points in one statement, and set the proper SRID.</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px"><SPAN
class=Apple-converted-space> </SPAN>Brad</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space> </SPAN>On
Dec 29, 2006, at 1:08 PM, Adam wrote:</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>This is my first try at adding spatial to my table.<SPAN
class=Apple-converted-space> </SPAN>Currently I have a 'Lat' and
'Long' columns that have my Latitiude and Longitude.</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>Do I need to add another column named 'Location' and insert each rows
'Lat' and 'Long' into the corresponding 'Location' row by doing:<SPAN
class=Apple-converted-space> </SPAN>"INSERT INTO table ( Location )
VALUES ( GeometryFromText('Point xx.xxx yy.yyyy', 4326) )" ?<SPAN
class=Apple-converted-space> </SPAN>This will assume WGS 84
datum.</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>Is this right?</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>_______________________________________________</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN>postgis-users mailing list</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN><A
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A></DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space>
</SPAN><A
href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV
style="MARGIN: 0px">------------------------------------------------------------------------------</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MARGIN: 0px"><SPAN
class=Apple-converted-space> </SPAN>_______________________________________________</DIV>
<DIV style="MARGIN: 0px"><SPAN
class=Apple-converted-space> </SPAN>postgis-users mailing list</DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space> </SPAN><A
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A></DIV>
<DIV style="MARGIN: 0px"><SPAN class=Apple-converted-space> </SPAN><A
href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV
style="MARGIN: 0px">-------------------------------------------------------</DIV>
<DIV style="MARGIN: 0px">Click link below if it is SPAM <A
href="mailto:gsw@globexplorer.com">gsw@globexplorer.com</A></DIV>
<DIV style="MARGIN: 0px">"<A
href="https://mailscanner.globexplorer.com/dspam/dspam.cgi?signatureID=4595f117132351789821027&user=gsw@globexplorer.com&retrain=spam&template=history&history_page=1">https://mailscanner.globexplorer.com/dspam/dspam.cgi?signatureID=4595f117132351789821027&user=gsw@globexplorer.com&retrain=spam&template=history&history_page=1</A>"</DIV>
<DIV style="MARGIN: 0px">!DSPAM:4595f117132351789821027!</DIV>
<DIV
style="MARGIN: 0px">-------------------------------------------------------</DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></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>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px"><BR></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>