[postgis-users] lat/long to coordinate conversion

Michael Fuhr mike at fuhr.org
Sat Jan 14 23:10:05 PST 2006


On Sat, Jan 14, 2006 at 10:20:54PM -0800, Shaun Collins wrote:
> is there a function in postgis that will convert
> lat/long to coordinates with a known srid?

Use one of the geometry constructors to create a geometry object
from the lat/lon with an appropriate SRID (e.g., 4326), then use
Transform() to convert the coordinates to another SRID.  Example:

test=> SELECT AsEWKT(Transform(GeomFromEWKT('SRID=4326;POINT(-118.2923 36.5785)'), 32611));
                       asewkt                       
----------------------------------------------------
 SRID=32611;POINT(384381.795377305 4048892.7545226)
(1 row)

-- 
Michael Fuhr



More information about the postgis-users mailing list