<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div>Hi,<br></div><div><br></div><div>I have a data set in wgs 84 (lon & lat) that has a spatial index, I intend to run a nearest neighbour query</div><div>with a search radius specified in meter. So in my query i transformed the data to UTM. The following query worked successfully</div><div><br></div><div>select gid, road_name, town, AsText(the_geom) as geo, ST_Distance(ST_Transform(the_geom, 26331), ST_Transform(setsrid(makepoint(3.3315343, 6.5593127), 4326), 26331)) as dist</div><div>  from lagos84</div><div>where expand(ST_Transform(setsrid(makepoint(3.3315343, 6.5593127), 4326), 26331), 5) && ST_Transform(the_geom, 26331)</div><div>order by dist</div><div>limit all;</div><div><br></div><div><br></div><div>When I transformed the data to UTM and I ran a similar query (without the ST_Transform function) it ran faster obviously because of the
 absence of</div><div>the ST_Transform operation. Based on my requirements, I might have no option but to leave my data in wgs 84 (lon & lat). </div><div> </div><div>My question is this:</div><div><br></div><div>1. As a result of the coordinate transformation, did the query above still use the spatial index ?</div><div>   Since the spatial index was built with the data in wgs 84 (lon & lat) </div><div><br></div><div>2. is the d spatial index dependent on coordinate system ?</div><div><br></div><div>3. what happens during a coordinate transformation ( ST_Transform( ) ) ? is the spatial index rebuilt ?</div><div><br></div><div>I know spatial indexes are built based on mbb's so i am just curious.</div><div><br></div><div>I would also appreciate it if one has better query to meet this requirement.</div><div><br></div><div>Cheers,</div><div><br></div><div>Roman.</div><div><br></div><div> </div><div><br></div></td></tr></table><br>