[postgis-users] Lat/Long from coordinates and srid

Shaun Collins shaunkeng at yahoo.com
Sun Jan 15 22:13:11 PST 2006


Sorry, brain freeze, I meant the other way around from
coordinates to lat/long. Is there a function that will
give lat/long from coordinates and srid

Thanks

Shaun


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)



More information about the postgis-users mailing list