Acquiring and Building the VTP Software under Windows

Compiler

Microsoft Visual C++ is recommended, one of these versions:

It may also be possible to use Cygwin/gcc, by adapting the existing Unix makefiles, but this has not been well tested.

Using very old versions of MSVC (e.g. VC6) is not recommended, and project/workspace files are not provided for that version.  However, if you want to attempt that route, see issues with VC6.

1. Acquire the necessary dependent libraries

The VTP software is very ambitious and attempts to be comprehensive, so unavoidably it depends on many other libraries.  As Newton said, "If I have seen further than others, it is because I have stood on the shoulders of giants."

The following six libraries, built for both VC7.1 and VC9, are conveniently contained in WinAPIs-1104.zip (1 MB)

For 3D rendering of terrain, you will need:

To compile the GUI applications (VTBuilder and Enviro) you will need:

For 3D applications (e.g. Enviro) you need:

Optional Libraries:

If you want to have another option for texture compression (besides standard OpenGL), you can grab Simon Brown's squish library.

2. Configure and build wxWidgets

If you are using the pre-built wxWidgets headers/libs, skip this step.

To build wxWidgets , use the workspace wx2.8.7/build/msw/wx_dll.dsw

You will build both the configurations "DLL Unicode Debug" and "DLL Unicode Release".

The simplest way is to build the whole workspace, but it's not really necessary.  The VTP projects use only the "aui", base", "core", "net", and "gl" libraries.

Building wxWidgets is a fairly complex subject.  I highly recommend the following the following steps:

  1. Replace your file include/wx/msw/setup.h with this setup.h, which turns off a large number of things for a simpler, smaller library.
  2. Remove all of following hard-coded libraries in the wx project settings under "Project Properties: Linker: Input":
    wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib
    You won't need them.
  3. Replace your file include/msvc/wx/setup.h with this setup.h, which will automatically cause all (and only) the necessary libraries to be linked.
  4. Remember, build only the projects "aui", "base", "core", "net" and "gl".

3. Download the VTP source distribution

Source code (2.2 MB zip file)
You can unzip it anywhere, but i recommend simply using the root of any drive.

Alternately, you can get the very latest VTP source from SVN.

4. To build the VTP software, use either CMake, or the standard VC project files.

CMake is recommended, especially for VC10 which doesn't let you set environment-wide paths.

With CMake

  1. Run CMake (you can get it from here)
  2. Tell if your source location (e.g. C:/vtp) and a place to build (e.g. C:/vtp/build)
  3. Fill in the location of all the dependencies.  It's OK to omit the optional libraries (netcdf, curl, bzip2, squish, quikgrid).
  4. Press "configure" and "generate"
  5. Go to your build folder and open VTP.sln in MSVC.

With the standard project files

1. Add the library paths to your development environment

In MSVC, this is under "Tools - Options - Projects - VC++ Directories".

Includes files will be in the following directories.
(Paths will be different if you installed the libraries in different locations, and may have a "-vc9" if you installed the VC9 binaries.)

\APIs\gdal180\include
\APIs\wx2.8.7\include
\APIs\wx2.8.7\include\msvc
\APIs\bzip2-1.0.3-bin
\APIs\libjpeg-6b
\APIs\libpng-1.2.12
\APIs\libcurl-7.15.0\include
\APIS\mini-bin
\APIS\QuikGrid
\APIs\netcdf-3.5.0.win32bin\include
\APIs\osg-2.83-bin(-vc71/vc9)\include

Library paths:

\APIs\gdal180\lib
\APIs\wx2.8.7\lib\vc_dll
\APIs\bzip2-1.0.3-bin
\APIs\libjpeg-6b
\APIs\libpng-1.2.12
\APIs\libcurl-7.15.0
\APIs\mini-bin
\APIs\netcdf-3.5.0.win32bin\lib
\APIs\QuikGrid\Release
\APIs\osg-2.83-bin(-vc71/vc9)\lib

2. In MSVC, load each VTP 'solution' to build the applications that you want to use, e.g.:

E.g. for VC 7.1:

VTP\TerrainApps\VTBuilder\VTBuilder-vc7.sln
VTP\TerrainApps\Enviro\wxEnviro-vc7.sln

Note that all the solutions for VC9 have a -vc9 in their filename, e.g.:

VTP\TerrainApps\VTBuilder\VTBuilder-vc9.sln
VTP\TerrainApps\Enviro\wxEnviro-vc9.sln

 

5. Sample applications

Beside the large, useful application Enviro and VTBuilder, the are also six smaller application provided as small, simple examples of how to use the VTP terrain library on top of various application frameworks:

VTP\TerrainApps\Simple       (Builds directly on OSG)
VTP\TerrainApps\glutSimple  
(uses GLUT)
VTP\TerrainApps\mfcSimple   
(uses MFC)
VTP\TerrainApps\sdlSimple   
(uses SDL)
VTP\TerrainApps\wxSimple    
(uses wxWidgets)
VTP\TerrainApps\fltkSimple  
(uses FLTK)

6. Download Application Data

vtp-apps-data.zip (8 MB) (required) contains basic data for the main applications, including a world map for use by VTBuilder, and earth image, plant images, road textures, etc. for Enviro.  You should unzip this to the same place as your source, for example if your VTP source is in C:\work\vtp, unzip it there and it will create a folder C:\work\vtp\Data.

Optional:

  1. Hawaii-demo-0411.zip (32 MB) (optional) contains some demo terrain data, including elevation and satellite imagery for the Island of Hawai`i.  You don't need this if you are only going to use your own geospatial data.
  2. vtp-plantlib.zip (80 MB) (optional) contains the VTP Plant library of billboard plant textures.

7. Set Environment Variables

Set the following environment variables as follows, or change the path if you installed GDAL and PROJ4 in some other location.

GDAL_DATA=C:\APIs\gdal160\data
PROJ_LIB=C:\VTP\proj\nad

This will allow you to use State Plane Coordinates, do conversion between different Datums, and other projection operations.

8. Set your PATH

Some of the DLLs which you have installed or built will need to be found at runtime.  You can either copy them to a location on your path, or (recommended) add them to your PATH environment variable.  Typical paths include:

\APIs\bzip2-1.0.3-bin
\APIs\gdal180\bin
\APIs\libcurl-7.15.0
\APIs\libpng-1.2.12
\APIs\netcdf-3.5.0.win32bin\bin
\APIs\osg-2.80-bin\bin
\APIs\wx2.8.7\lib\vc_dll

9. Run!

If you have also downloaded the pre-built binaries then you will find documentation for each application in the Docs folder under each directory.  Alternately, documentation is online.

See the FAQ and status pages for bug reports, feature requests, etc.

Try the software on your own geospatial data!

Send feedback to myself or the mailing list!