<div>First, to answer your question, the ST_SetSRID failed since the box3d cast failed since it could not be parsed.</div><div><br></div>I think you are using the wrong approach. Try using ST_Expand instead of nesting calculations in the WKT:<div>

<br></div><div><a href="http://postgis.refractions.net/documentation/manual-1.5/ST_Expand.html">http://postgis.refractions.net/documentation/manual-1.5/ST_Expand.html</a></div><div><br></div><div>Furthermore, you are trying to expand the search of a point with units of degrees by 200 degrees. If you want a distance in metres or feet, you need to transform your point into another projection. (This second part is probably more complicated/confusing than the first issue.)</div>

<div><br></div><div><a href="http://postgis.refractions.net/documentation/manual-1.5/ST_Expand.html"></a>-Mike<br><div><br><div class="gmail_quote">On 29 April 2010 05:19, rakesh modi <span dir="ltr"><<a href="mailto:rakesh.modi1585@gmail.com">rakesh.modi1585@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>Hi All,</div><div><br></div><div>i am trying to run this query but getting error - </div><div><div>ERROR:  function setsrid(unknown) does not exist</div>

<div>LINE 4:             FROM roads WHERE the_geom && SetSRID(</div>
<div>                                                 ^</div><div>what's the problem .. </div></div><div><br></div><div><br></div><div>SELECT gid, source, target, the_geom, </div><div><span style="white-space:pre">                  </span> distance(the_geom, GeometryFromText(</div>


<div><span style="white-space:pre">                       </span> 'POINT(26.8988086602918 7.71874658182343)', 4326)) AS dist </div><div>            FROM roads WHERE the_geom && ST_SetSRID(</div><div>                  'BOX3D((26.8988086602918-200 7.71874658182343-200 26.8988086602918+200 7.71874658182343+200))</div>


<div>                         , ::box3d,4326)') </div><div>            ORDER BY dist LIMIT 1;</div>
<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>
<br></blockquote></div><br></div></div>