[postgis-users] use of local coordinate system

Greg Troxel gdt at ir.bbn.com
Mon Oct 23 17:15:22 PDT 2006


I have some data in a local coordinate system that I'm currently
storing in x, y columns and would eventually like to put into postgis.
I studied the proj manual and have not been able to make proj
transform my local system.  Right now I'm using hand-written
translate/rotate which isn't bad, but it seems awkward with postgis
and would prevent projected indices.

I have a 135m by 100m grid marked out on a parking lot with PK nails
(or bolts/flagging on grass) at 10mx10m corners.  On this I have
defined (x,y) in the normal cartesian sense.  At (40,30) I place a GPS
receiver that generates differential corrections based on a multi-hour 
averaged position, and these are conveyed to moving nodes.   This
defines the origin of my local system:

   (40, 30) = -71.14655467018 42.390698854

My x-axis is pretty much N, so I convert geodetic to NAD83 UTM zone
19, and then take northing as x and easting as -y, translating to make
(40,30) come out right.

Then, I measured a number of grid points with GPS, and computed an
average rotation of -0.896763396954 (going 100m +x (north) makes my
easting go down ~5m, so my x-axis points slightly west - I realize
this 5m is the combination of my grid azimuth and the UTM grid
azimuth).  I apply the rotation about the 40,30 point.  I have
handwritten code that does this, using proj for geodetic->UTM, and it
works fine.

I would like to do the entire conversion all in proj, so I can store
data in my grid and reproject to geodetic and MA SPC for orthophoto
alignment.  From the manual, it seems like oblique mercator is what I
want.  (Really, I want UTM and then translate/rotate.)  I tried:

proj +proj=omerc +k=0.9998 +no_rot +lat_0=42.390698854 \
  +lon_c=-71.14655467018 +alpha=-0.896763396954

but then the following data

-71.14655467018 42.390698854    40 30
-71.14618295 42.39033973        0 0
-71.14656340 42.39033225        0 30
-71.14689977 42.39031993        0 60
-71.14619653 42.39071044        40 0
-71.14630767 42.39071463        40 10
-71.14693212 42.39069276        40 60
-71.14657137 42.39103775        80 30
-71.14709808 42.39114714        90 70
-71.14623307 42.39125451        100 0
-71.14658142 42.39123297        100 30

 produces values I can't fathom:

3222803.08      -5460083.67    40 30
3222740.73      -5460115.18        0 0
3222779.45      -5460135.10        0 30
3222813.31      -5460153.50        0 60
3222766.93      -5460064.30        40 0
3222778.67      -5460069.23        40 10
3222841.59      -5460103.24        40 60
3222827.48      -5460037.37        80 30
3222889.11      -5460048.28        90 70
3222807.11      -5459990.44        100 0
3222841.58      -5460010.71        100 30

Am I doing something wrong with omerc?  Is it possible to get proj to
do what I want?  Any clues would be appreciated.

    Greg Troxel <gdt at ir.bbn.com>



More information about the postgis-users mailing list