[postgis-users] Can i use postgis to do what cs2cs does?

Tyler Mitchell tjmitchell at riverside.bc.ca
Mon Jun 28 08:08:03 PDT 2004


>     i have a table in PostgreSQL with several geographic points using 
> WGS84 datum lat/long.
> 
>     Using cs2cs i can convert it to utm in sad69 datum (Corrego Alegre).
> 
>     Is it possible to do it using postgis? If so, can someone give me an 

> example....this will help me a lot because i will not need to call 
> external programs such as cs2cs to do my selects.

Rafael, yes it is.  As long as Proj support is built into the PostGIS 
version you are running.
Then you need to (or will greatly benefit from) have the spatial_ref_sys 
table populated (See spatial_ref_sys.sql and 
http://postgis.refractions.net/docs/x321.html#AEN325).  What you'll do is 
use the transform(<in_geometry>,<output SRID#>) is a select statement and 
it will transform, or reproject it for you. 

Be sure that you have properly selected an SRID for your input data when 
you loaded it into PostGIS.

Hope that helps.

Tyler



More information about the postgis-users mailing list