[Proj] Eric Miller VB Wrapper +nadgrids=

Eric Miller EMiller at dfg.ca.gov
Thu Jun 30 10:37:38 EST 2011


>>> On 6/30/2011 at 7:22 AM, stevejking <stevejking at talktalk.net> wrote:
> I'm trying to use Eric Millers VB api with Excel to convert from OSGB36 to
> WGS84. I'm sucessfully using
> 
> From "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601 +x_0=400000 +y_0=-100000
> +ellps=airy +towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894
> +units=m +no_defs"
> 
> To "+proj=longlat +a=6378137 +b=6378137 +datum=WGS84 +no_defs"
> 
> But when I try to use a grid shift file for better accuracy I get a DLL
> Error 123. I'm using:
> 
> From "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601 +x_0=400000 +y_0=-100000
> +ellps=airy +nadgrids=C:\Program Files\MapWindow\PROJ_NAD\OSTN02_NTv2.gsb
> +units=m +no_defs"
>  
> *Does anyone know how to use a grid shift / nadgrids file with the VB api
> please?*
> 
> The Proj_Lib environment variable is set as C:\Program
> Files\MapWindow\PROJ_NAD. But I've also tried C:\proj\nad and moving the gsb
> file.

Verify that your transform works via the command line tool cs2cs.exe.

That old shim just basically exports a few function wrappers with the stdcall semantics so that they can be consumed by VB[A] code.  The arguments are passed straight to the functions that are wrapped.

The handling of file paths with spaces has historically been a problem.
-- 

Eric G. Miller
Staff Programmer
CA Dept. of Fish & Game





More information about the Proj mailing list