<div>Hi all,</div>
<div> </div>
<div>I have a query I need to create that transforms the geometry from lat/long to plate carree so I can return distances of a point to nearby polygons at a specified distance (not ideal to use Plate Carree but I cannot find any other global projection that I can use within the EPSG codes). What I have so far is as follows:</div>

<div> </div>
<div>SELECT ebaname, distance(ST_Transform(ST_geomfromtext('POINT(-77.144 -0.629)',4326),32662), the_geom) as Distance_Metres<br>FROM ebas<br>WHERE ST_DWithin(ST_Transform(the_geom, 32662) ,ST_Transform(ST_geomfromtext('POINT(-77.144 -0.629)',4326),32662), 100000)<br>
AND ST_Transform(the_geom, 32662) > ST_Transform(ST_geomfromtext('POINT(-77.144 -0.629)',4326),32662)<br>ORDER BY ST_Distance(ST_transform(the_geom,32662), ST_Transform(ST_geomfromtext('POINT(-77.144 -0.629)',4326),32662))</div>

<div> </div>
<div> </div>
<div>This seems to work ok, but what I am trying to do is to use an existing point layer in postgres (same coordinates as specifying the geometry as geomfromtext) . I cannot seem to figure this out, any help would be gratefully appreciated.</div>

<div> </div>
<div>TIA</div>
<div> </div>
<div>Mark</div>