file : README.shpgeo.txt : 2010-08-12

Notes on building the shpgeo.lib

As a prerequisite, you must download and build
the PROJ.4 library. see -
 http://trac.osgeo.org/proj/
 
I downloaded -
 http://download.osgeo.org/proj/proj-4.7.0.zip

This source also contains some projection file information,
and it is necessary to establish a pointer to files such
as 'nad83'... 

I have achieved this by adding the following code to shpgeo.c...

file : contrib/shpgeo.c
=======================

projPJ SHPSetProjection ( int param_cnt, char **params ) {
#ifdef PROJ4
  projPJ	*p = NULL;
#ifdef _MSC_VER
  _putenv("PROJ_LIB=C:\\Projects\\proj.4\\proj-4.7.0\\nad");
#ifndef NDEBUG
  _putenv("PROJ_DEBUG=1");
#endif
#endif
  if ( param_cnt > 0 && params[0] )
  { p = pj_init ( param_cnt, params ); }

  return ( p );
#else
#ifdef _MSC_VER
#pragma message("ERROR: 'PROJ4' has NOT been defined!");
.error "Aborting compilation..."
#endif
  return ( NULL );
#endif
}

You may need to correct this to point to where you have PROJ.4
'installed'...

But as can be seen in the PROJ.4 source, it uses the
environment variable 'PROJ_LIB', and this could
manually be set before running say shpproj.exe.

Geoff.
email: report_at_geoffair_dot_info
 
# eof
