<div>Hi All</div>
<div> </div>
<div>I am trying to create a query that uses a mouse click to get coordinates (from mapserver) and then features within a specified distance are selected and displayed in different colours. The query I have at the moment works well, however, the problem I am trying to solve is how to indicate these distances with concentric circles around the coordinates from the mouse click. Is this do-able? My query is as follows;</div>

<div><font size="2"></font> </div>
<div><font size="2">DATA "the_geom FROM (SELECT intname,the_geom, gid, distance(the_geom, geometryfromtext('POINT(' || (%mapx%) || ' ' || (%mapy%) || ')',4326)) AS dist from kbapoly) as myquery using SRID=4326 using unique gid"</font></div>

<div><font size="2"></font> </div>
<div><font size="2">At the moment I define the distance from the CLASS EXPRESSION so I have 3 classes</font></div>
<div><font size="2"></font> </div>
<div><font size="2">1)  <font size="2">EXPRESSION ([dist] <= 1)</font></font></div>
<div><font size="2">2)  <font size="2">EXPRESSION ([dist] >= 1 AND [dist] <= 2)</font></font></div>
<div><font size="2">3)  <font size="2">EXPRESSION ([dist] >= 2 AND [dist] <= 3)</font></font></div>
<div><font size="2"></font> </div>
<div><font size="2">(distance is decimal degrees)</font></div>
<div><font size="2"></font> </div>
<div><font size="2">I can create a buffer around a mouse click on the map using the following query</font></div>
<div><font size="2"><font size="2"></font></font> </div>
<div><font size="2"><font size="2">DATA "the_geom from (SELECT buffer(geometryfromtext('POINT(' || (%mapx%) || ' ' || (%mapy%) || ')',4326), 1) AS the_geom, gid as gid FROM kbapoly) as myquery using srid=4326 using unique gid" </font></font></div>

<div><font size="2"><font size="2"></font></font> </div>
<div><font size="2"><font size="2">What I am struggling with is how to combine these two queries if this is possible. So I can display three concentric buffers at 1, 2 and 3 decimal degrees around the selected features.</font></font></div>

<div><font size="2"><font size="2"></font></font> </div>
<div><font size="2"><font size="2">Any help or advice would be really appreciated.</font></font></div>
<div><font size="2"><font size="2"></font></font> </div>
<div><font size="2"><font size="2">Thanks in advance</font></font></div>
<div><font size="2"><font size="2"></font></font> </div>
<div><font size="2"><font size="2">Mark</font></font></div>