If US grid based NAD27 datum shifting is required for North America, it is imperative to unpack the the datum shift files "on" the PROJ.4 source tree before configuring, building and installing.
% tar xzvf proj-4.4.7.tar.gz % cd proj-4.4.7/nad % tar xzvf ../../proj-nad27-1.1.tar.gz % cd .. % ./configure % make % su Password: ******* $ make install $ exitIf NTv2 support is desired, download the NTv2 data file from the Natural Resources Canada web site, and copy it to /usr/local/share/proj. This can be safely done after PROJ.4 is installed. The file is platform independent (unlike the binary files built for the US grid shift files). Please ensure the file is installed with the filename in lower case.
$ cp NTV2_0.GSB /usr/local/share/proj/ntv2_0.gsb
Once unpacked, build GDAL/OGR according to the provided instructions, and then install.
% cd gdal % ./configure ... % make % su Password: ******** $ make install $ exit
Then build the server.
% cd ogr/wcts % makeThe server (ogrwcts) is a simple executable that depends on libgdal.1.1, and potentially on libcurl. It would normally be copied directly into your web server cgi-bin directory.
% cp ogrwcts /u/apache/cgi-binIf you want the HTML form based WCTS client (demonstrated at http://maps.gdal.org/wcts/client.html to have a local cgi-bin server, you should also build the wctsclient application.
% make all % cp wctsclient /u/apache/cgi-bin
% vi wcts_capabilities.xml.0.1.0 % cp wcts_capabilities.xml.0.1.0 /usr/local/share/gdalNext this modified document (with the name unchanged) needs to be placed some where it can be found by the server. The ideal location is the /usr/local/share/gdal directory since it is already in the "data file search path". If it is placed elsewhere, the -data switch to ogrwcts will need to be used to point to the directory. Note, all aspects of the server other than the GetCapabilities request will work fine even without the capabilities document.
% cd ogr/wcts % ./ogrwcts -put < req_getcap.xml % ./ogrwcts -put < req_istransformable.xml % ./ogrwcts -put < req_transform.xml
It is also necessary for the ogrwcts program to be able to load the shared libraries it depends on. In a default install under /usr/local, this might involved adding the directive "SetEnv LD_LIBRARY_PATH /usr/local/lib" in an Apache configuration file, or utilizing ldconfig to ensure that libgdal.1.1.so, and libproj.so will be found when ogrwcts is started.
It is also necessary that directories with the supporting data files used by ogrwcts be readable by the user that cgi-bin programs run as (often "nobody"). In a default install the directories in question are /usr/local/share/gdal and /usr/local/share/proj. Usually these locations will be world readable by default.
% ./configure --prefix=/optThis mechanism can be used while configuring both GDAL and PROJ.4 (and presumably libcurl). Appropriate adjustements to the LD_LIBRARY_PATH or ldconfig settings would be required to find support libraries in ${prefix}/lib. Default path to files supporting GDAL, and PROJ.4 are established during their builds (based on the configure --prefix setting), so these components should be able to find their supporting data files as long as everything is built and installed consistently.
Sometimes it is also desirable to force the ogrwcts cgi-bin to use particular versions of local files. This is normally accomplished by using a shell script as the target cgi-bin, and having that script run ogrwcts with appropriate override commandline switches and environment variables.
The PROJ_LIB environment variable can be set to point to an alternate location to find supporting datum shift files for PROJ.4. They are normally kept in /usr/local/share/proj.
The GDAL_DATA environment variable may be used to set an alternate source for the .csv files used to translate EPSG CRS numbers into detailed definitions. They are normally kept in /usr/local/share/gdal.
The -data directory commandline switch to ogrwcts may be used to designate an alternate search directory for GDAL .csv files, and the capabilities document.
This is an example of a script that might be to override selected environment variables before running the real ogrwcts binary.
#! /bin/sh LD_LIBRARY_PATH=/home/warmerda/gdal:/usr/local/lib export LD_LIBRARY_PATH PROJ_LIB=/usr2/cgi-bin/wcts-proj-lib export PROJ_LIB /home/warmerda/gdal/ogr/wcts/ogrwcts $* exit 0