Proj.4 Library

External: index
Internal: |- preamble -|- utilities -|- debug -|- downloads -|- diff -|- end -|


This is my MSVC8 (2005) and MSVC9 (2008) Express WIN32 build of Proj.4 static library, and utilities, in XP and Vista resp. - see for details of what this source can do. I used it to build the additional utilities in the Shapefile C Library 'contrib' folder.


  1. Download the SVN source. Check above site for any change in the svn command -
    [some_root]> svn co  proj4-svn
  2. cd proj4-svn; md contrib; cd contrib
  3. Download my msvc zip file, and unzip in proj4-svn\contrib, preserving folders. This will create a 'msvc' folder
  4. Fire up MSVC, and load [some_root]\proj4-svn\contrib\msvc\proj4.dsw, convert and build...

Additional Setup:

Datum shift grids: Download the The US, Canadian, French and New Zealand datum shift grids - unzip in the [some_root]\proj4-svn\nad directory, then in the contrib\msvc directory, run the setup-nads.bat batch file, to generate the binary 'nad' files, like 'conus' from 'conus.lla', etc. This generation requires bin\nad2bin.exe to have been built.

You should be now ready to run the various 'test*.bat' batch files... 'testALL.bat' will run them all... Note, all the 'test' batch files require GNU 'diff' utility to be in your PATH. If you want to run the 'testNTv2.bat', then you also need to download the 'NTV2_0.GSB' file.



This page in no way attempts to 'explain' what the utility programs do, and you are urged to go to the above proj.4 site for that, but some small explanations scraped from the site are :-

NOTE: To use these, and other utilities based on this library, it is sometime very necessary to set PROJ_LIB in the environment point to where you find the 'nad' files, nad27, nad83, ... If _NOT_ set in the environment, each of the 'test' batch files sets this relative to this 'msvc' folder...

The proj.exe program is limited to converting between geographic and projection coordinates within one datum. Running proj with -lp will list the projections, -le the ellipsoids, and -lu the units, and -ld for the built-in datums.

There are two test files, to test this utility against a known output, which requires the GNU 'diff' utility. See 'test27.bat' and 'test83.bat' batch files.

The cs2cs.exe program operates similarly, but allows translation between any pair of definable coordinate systems, including support for datum translation.

There are three test files, to test this utility against a known output, which requires the GNU 'diff' utility. See 'testDATUM.bat', 'testIGNF.bat' and 'testVarious.bat'.

There is a 4th, 'testNTv2.bat', but requires ntv2_0.gsb to be installed in the 'nad' directory. This can be obtained from - - after registering, but note, in my tests with this file I did not get exactly per the 'dist' file, but it was only just a few minor decimal places differences. I have constructed a minimally modified 'ntv2_out2.dist', which is in my 'msvc' zip.

The nad2nad.exe program provides for translation between NAD27 and NAD83 (also available in cs2cs) in a convenient manner. Not tested.

The geod.exe program provides the ability to compute geodetic (Great Circle) computations. Not tested.

There is a single 'testALL.bat' batch file to run all the above test.



If you want more output, set PROJ_DEBUG=9 in the environment. Actually I think '3' is the maximum... the pj_log() (in src/pj_log.c) function uses like if( level > ctx->debug_level ) return;, but not sure what is the highest value used... in proj_api.h there are defines :-

#define PJ_LOG_NONE        0
#define PJ_LOG_ERROR       1

so maybe the highest value used is '3'?



Take care downloading and running executables from the web!

If you just want to try the WIN32 utilities, cs2cs.exe, geod.exe, nad2bin.exe, nad2nad.exe or the proj.exe then is for you. It also includes the WIN32 static library, proj4.lib, built using MSVC9, with the DLL RUNTIME (/MD).

If you have downloaded the SVN source, and want to build the static proj4.lib, and the executable utilities for yourself, using any version of MSVC, the is for you. It contains a set of MSVC files, which should be placed in a contrib/msvc folder of the source, and then the proj4.dsw loaded into MSVC.

Date Link Size MD5
2010/08/19 405,935 e265c3d3788b49db9754315464ac7eeb
2010/08/19 47,147 3bd45b456938f8c9ba086ce28c024231
2010/08/19 4,965,470 02754ab61f23fb39c88c3e3c731e0e5f

Note: My 'src' zip also includes the contents of the, and their respective binary conversions...

Take care downloading and running executables from the web!


Older Versions

Date Link Size MD5
2010/08/16 404,403 ea4941b945fba776ce09d6b2ca6ce94a
2010/08/16 14,081 a3def9c168d88a018ba225fb902c9304
2010/08/16 2,060,086 2fa5abc101d20c70b8e19d1014fe21ee

PS: 2010/08/17 - Only subsequently did I discover windows DOES have a strerror(errnum) function, and thus HAVE_STRERROR should be defined in the MSVC build files for the proj4.lib. See src/emess.c, which I have included in the proj4.dsp, adding it to proj4.lib, rather than separately compiling it for each of the utilities...

Take care downloading and running executables from the web!



WIN32: A very important WIN32 port of some unix utilities (unixutils), particularly 'diff.exe', can be found here - - Native Win32 ports of some GNU utilities - GNU utilities for Win32. This zip should be downloaded, and most, if not ALL!, should be placed within a folder in your PATH environment variable, or their path added to PATH!



checked by Tidy  Valid HTML 4.01 Transitional