<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>
<DIV>
<P class=MsoNormal style="MARGIN: 5pt 0in; mso-pagination: none; mso-layout-grid-align: none">hi, </P>
<P class=MsoNormal style="MARGIN: 5pt 0in; mso-pagination: none; mso-layout-grid-align: none">thanks for reply. i think i have to clarify my problem a bit more. i want to get the records from my table within a specified distance for e.g 50 meters. For this i have to calculate the extent first to get the image in mapserver. what i have is just a polygon geom, which area as you know can vary from property to property. i dont want to take into account the area/distance the property holds, but a center point for that polygon, so to calculate the distance equally on each side of that point, and then calculate the extent of those records, for the image to be generated. what i have done uptil now is:</P>
<P class=MsoNormal style="MARGIN: 5pt 0in; mso-pagination: none; mso-layout-grid-align: none">SELECT extent(geom),max(Distance('<center of polygon>',geom))as distance</P>
<P class=MsoNormal style="MARGIN: 5pt 0in; mso-pagination: none; mso-layout-grid-align: none">from tarea</P>
<P class=MsoNormal style="MARGIN: 5pt 0in; mso-pagination: none; mso-layout-grid-align: none">where within(geom,'<expand(geom,50)from the given geom>')</P>
<P class=MsoNormal style="MARGIN: 5pt 0in; mso-pagination: none; mso-layout-grid-align: none">and Distance('<center of polygon>',geom)<=50</P>
<P class=MsoNormal style="MARGIN: 5pt 0in; mso-pagination: none; mso-layout-grid-align: none">but this query is taking about 25-26 mins which is quite a large time span. and also when i get the results and on showing through the map server, the scale bar is not matching, i mean it has to show a 100 meter bar scale, but, it is showing more then 100 meters on the scalebar, about 192 or so. </P>
<P class=MsoNormal style="MARGIN: 5pt 0in; mso-pagination: none; mso-layout-grid-align: none">i hope this elaboration of problem will be helpful.</P>
<P class=MsoNormal style="MARGIN: 5pt 0in; mso-pagination: none; mso-layout-grid-align: none">thanks. </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p></SPAN></P></DIV></DIV></div><br>

      </body></html>