[postgis] TRANSFORM(GEOMETRY, SRID) in CVS version

Dave Blasby dblasby at refractions.net
Fri Dec 21 14:14:41 PST 2001


The CVS version has a beta version of this function.

NOTES:
The makefile has two changes to it 
	(a) it defines "WANT_PROJECTION".  If "WANT_PROJECTION" is set, you'll
get the re-projection support functions
            If its unset, you'll get null functions.
	(b) It also link in the proj library
If you dont want projection support, you should remove the
"-DWANT_PROJECTION" and "-lproj" in the makefile.  
Paul's working on getting this done automatically for you.

You'll have to have proj4 installed on your machine.

If you're upgrading an already existing DB, you should add a "proj4text"
column to the spatial_ref_sys table and add the function
"transform_geom()", "transform()", and "proj4_from_srid()".  See the
postgis.sql file for details.

It works for all geometry types.

EXAMPLE:

trans=# select * from spatial_ref_sys ;
srid |   auth_name   | auth_srid | srtext
|                               
proj4text                                 
-----+---------------+-----------+--------+--------------------------------------------------------------------------
   1 | latlong WGS84 |         1 |        | +proj=longlat +datum=WGS84
   2 | BC albers     |         2 |        | proj=aea ellps=GRS80
lon_0=-126 lat_0=45 lat_1=50 lat_2=58.5 x_0=1000000

trans=# select transform( 'SRID=1;POINT(-120.8 50.3)', 2);
        
	'SRID=2;POINT(1370033.37046971 600755.810968684)'

dave

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Send FREE Holiday eCards from Yahoo! Greetings.
http://us.click.yahoo.com/IgTaHA/ZQdDAA/ySSFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list