[Proj] ostn02: northings and eastings to lats and longs

Frank Warmerdam warmerdam at pobox.com
Tue Nov 7 10:56:35 EST 2006


Roger Oberholtzer wrote:
> I am happily using proj to convert WGS84 lats and longs into OSTN02
> eastings and northings. My C API code (seen in these parts before...)
> is:
> 
> 
> fromProj = pj_init_plus(
>                 "+proj=latlong "
>                 "+ellps=WGS84 "
>                 "+towgs84=0,0,0 "
>                 "+nodefs")
> 
> toProj   = pj_init_plus(
>                 "+proj=tmerc "
>                 "+lat_0=49 "
>                 "+lon_0=-2 "
>                 "+k=0.9996012717 "
>                 "+x_0=400000 "
>                 "+y_0=-100000 "
>                 "+ellps=airy "
> 
> "+towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894 "
>                 "+nadgrids=gb.gsb "
>                 "+units=m "
>                 "+no_defs")
> 
> Now, how would I specify these items if I wanted to go in the opposite
> direction - from OSTN02 northings and eastings to WGS84 lats and longs?
> Surely it is not just to turn around the fromProj and the toProj. Note
> also that I am doing a grid shift via the  "+nadgrids=gb.gsb " option.

Roger,

I hate to once again state the obvious, but yes, you should just
reverse them.

The pj_transform() function understands how to apply the gridshift
in a forward or backward direction.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the Proj mailing list