<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Neville,<br><br>Merry Christmas (it already is here in NZ :-)<br><br>You are passing a string - 'POINT(33.911404 -116.768347)' - not a geometry in your query hence the error message that ST_SetSRID() doesn't know what the first parameter is<br><br>Instead of:<br><br>select state from zipcode where DISTANCE(column2,<br>ST_SetSRID('POINT(33.911404 -116.768347)', 2163)) < 8000;<br><br>try:<br><br>select state from zipcode where DISTANCE(column2,<br>
ST_SetSRID(ST_MAKEPOINT(33.911404 -116.768347), 2163)) < 8000;<br>
<br><br>Cheers,<br><br> Brent<br><br><br>--- On <b>Tue, 12/25/12, nevillekb <i><nevillekb@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: nevillekb <nevillekb@gmail.com><br>Subject: Re: [postgis-users] Using PostGIS for latitude & longitude<br>To: postgis-users@postgis.refractions.net<br>Date: Tuesday, December 25, 2012, 1:32 AM<br><br><div class="plainMail">Hi,<br><br>So i created a table named zipcode with the following columns<br><br>Id<br>State<br>Zip<br>Latitude<br>Longitude<br>column1<br>column2<br><br>columns named column1 and column2 are the 2 geometry columns i have created<br>to store the lat and long in 2 formats -SRID 4269 (Lat/Lon) and SRID 2163<br>(US National Atlas – meters).<br><br>Then i execute the following query to populate both the columns with the lat<br>and lon data<br><br>UPDATE zipcode SET column1
=<br>ST_SetSRID(ST_MakePoint("longitude","latitude"),4269), column2 =<br>ST_Transform(ST_SetSRID(ST_MakePoint("longitude","latitude"),4269), 2163);<br><br>Everything has worked fine till now, but now when i try to execute the<br>following query to show all records that are within 5 miles of a given point<br>i get an error.<br><br>Query:<br><br>select state from zipcode where DISTANCE(column2,<br>ST_SetSRID('POINT(33.911404 -116.768347)', 2163)) < 8000;<br><br>Error Generated:<br><br>WARNING ] select state from zipcode where DISTANCE(column2,<br>ST_SetSRID('POINT(33.911404 -116.768347)', 2163)) < 8000<br> ERROR: function st_setsrid(unknown, integer) is not unique<br> LINE 1: select state from zipcode where DISTANCE(column2,<br>ST_SetSRID...<br>
^<br> HINT: Could not choose a best candidate function. You might<br>need to add explicit type casts.<br><br>Can someone help me out as to where am i going wrong in the above query??<br><br>Thanks<br><br><br><br>--<br>View this message in context: <a href="http://postgis.17.n6.nabble.com/Using-PostGIS-for-latitude-longitude-tp5002097p5002125.html" target="_blank">http://postgis.17.n6.nabble.com/Using-PostGIS-for-latitude-longitude-tp5002097p5002125.html</a><br>Sent from the PostGIS - User mailing list archive at Nabble.com.<br>_______________________________________________<br>postgis-users mailing list<br><a ymailto="mailto:postgis-users@lists.osgeo.org" href="/mc/compose?to=postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br><a
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></div></blockquote></td></tr></table>