[postgis-users] Spatial Ref Sys oops

Carl Anderson carl.anderson at vadose.org
Sat Mar 15 13:39:22 PST 2003


Paul I very much appreciate your help on this,

I have been using the postgis transform function for a while
without problems and It has been allowed me to embed some dynamic 
reprojection into a trigger in production databases.  That work was 
between a UTM and a Lat/Long projection.

During testing from a us-feet dataset to a Lat/Long dataset this 
problem appeared.  I think that a misunderstanding of proj (possibly 
mine) is to fault.  The proj docs are a bit lean for recent changes.

On 2003.03.15 14:25 Paul Ramsey wrote:
> The "to_meter" parameter should be sufficient to do the units
> transform.

I have tested the +to_meter parameter in proj and invproj,  it just is 
not working for me. but falling back to the old +units=us-ft is working.
I see clearly that the +to_meter style is much better, allowing for 
clearer conversions from feet to meters, but something is broken there.

Can someone else who has proj4 (4.4.5 or 4.4.6) support in their postgis
cut and paste the examples from the last post?  maybe I have cross 
linked libs.  the correct answer is the second.  -100W is in Texas not 
Georgia.

> Note that in proj for, all the offsets are in meters, even when the 
> output projection is in feet. Fun.
> 

This might be a design principle, but testing shows this to be 
different (and maybe a feature that I don't understand) possibly 
Wamerdam can shed some light.  
your epsg file (very similar to the one distributed in PROJ4 (4.4.6)) 
has:
> # NAD 1983 StatePlane Georgia West FIPS 1002 Feet
> <102667> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999900
> +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83
> +to_meter=0.3048006096012192  no_defs <>

CVS's (spatial_ref_sys.sql) entry
is:
--- ESRI : NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet
---
INSERT INTO "spatial_ref_sys" 
("srid","auth_name","auth_srid","srtext","proj4text") VALUES 
(102667,'ESRI',102667,'PROJCS["NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",2296583.333333333],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",-84.16666666666667],PARAMETER["Scale_Factor",0.9999],PARAMETER["Latitude_Of_Origin",30],UNIT["Foot_US",0.30480060960121924]]','+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 ');


Observe the x_0 parameter in the epsg Proj4 INIT file is 700000.00, 
(feet) per the NAD83 definition false easting is 700,000 feet.
The spatial_ref_sys entry is in meters.

clearly both files are intended to feed proj4 so something must be up.

the salient test should be:
Does select transform()  from one of these feet based projections work 
correctly.  Especially try a non meters based desination.  Note that 
round trip projections utm->odd->utm does not really test this problem.



What follows are 3 different settings for proj4text in spatial_ref_sys
and the resulting transformation
===============================================================
+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

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

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

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

==============================================================
+proj=tmerc +lat_0=30.000000000 +lon_0=-84.166666667 +k=0.999900 
+x_0=700000.0 +y_0=0.000 +ellps=GRS80 +units=us-ft 
select transform('SRID=102667;POINT(2284248.581058 
314340.180605)'::geometry,4267);
                      transform
----------------------------------------------------
  SRID=4267;POINT(-84.2060804142583 30.864143821645)



Why is to_meter=0.3048006096 but us-ft defined as 0.304800609601219 per 
prog -lu ?   It is beneath my usable scale, but the change seems 
arbitrary.
  

C.



More information about the postgis-users mailing list