[postgis-users] Spatial Ref Sys oops

Carl Anderson carl.anderson at vadose.org
Sat Mar 15 09:43:39 PST 2003


I have been have some problems using transform(geometry,srid)

I tracked it down to an oops in the spatial_ref_sys file

For SRID's that are in coordinate units other than meters this is 
true.  SRID's tha are in meters are not affected by this.

using SRID 102667  --  NAD83 Georgia West (FIPS 1002) US Feet as an 
example

The srtext field shows the false easting in meters not in feet (the 
projections coord units).
Additionally proj4 needs a units parameter otherwise it will not change 
coordinate units.



-----------------------------------------------------------
initially

select transform('SRID=102667;POINT(2284248.581058 
314340.180605)'::geometry,4267);
                       transform
-----------------------------------------------------
  SRID=4267;POINT(-100.609237649977 29.8157860269902)

wrong location

fixing the proj4text from

+proj=tmerc +lat_0=30.000000000 +lon_0=-84.166666667 +k=0.999900 
+x_0=2296583.333 +y_0=0.000 +ellps=GRS80 +to_meter=+0.3048006096

BY (for grins throw a proj4.4.5 datum also)

update spatial_ref_sys set proj4text = '+proj=tmerc +lat_0=30.000000000 
+lon_0=-84.166666667 +k=0.999900 +x_0=700000.00 +y_0=0.000 +ellps=GRS80 
+units=us-ft +datum=NAD83' where srid = 102667;

then produces the correct results
select transform('SRID=102667;POINT(2284248.581058 
314340.180605)'::geometry,4267);
                      transform
----------------------------------------------------
  SRID=4267;POINT(-84.2060804142583 30.864143821645)



C.




More information about the postgis-users mailing list