| 1 | = Setting up Windows to Handle On-The-Fly Projections with !MapServer / !MapScript = |
| 2 | |
| 3 | ---- |
| 4 | Installer packages such as [http://www.maptools.org/ms4w MS4W] contain Proj ready-to-use. |
| 5 | ---- |
| 6 | |
| 7 | by Chip Hankley and Frank Warmerdam |
| 8 | |
| 9 | MapServer supports on-the-fly projections using the PROJ4 library. See: |
| 10 | |
| 11 | * http://www.remotesensing.org/proj |
| 12 | * http://mapserver.gis.umn.edu/doc36/coordinates.html |
| 13 | |
| 14 | == Using Prebuilt Binaries == |
| 15 | |
| 16 | 1. Grab ftp://ftp.remotesensing.org/proj/proj446_win32_bin.zip and unpack it, if possible under the root in C:\. This creates a C:\PROJ directory. |
| 17 | 2. If you had to unpack it somewhere else, you will need to set the PROJ_LIB environment variable to point to the NAD directory within it. eg. SET PROJ_LIB=D:\Software\PROJ_446\NAD |
| 18 | 3. Either add the C:\PROJ\BIN directory to your path, or copy C:\PROJ\BIN\PROJ.DLL to somewhere appropriate, like wherever your MAPSERV.EXE is. |
| 19 | |
| 20 | You should be good to go, with access to the "epsg" init file, and the various standard NAD27/NAD83 grid shift files. |
| 21 | |
| 22 | == Building From Source == |
| 23 | Set up PROJ4 on a Windows box by doing the following: |
| 24 | |
| 25 | 1. Download the latest PROJ4 source from http://www.remotesensing.org/proj. |
| 26 | 2. Un-compress the source documents to the C: drive. The default parent folder will end up being something like C:\PROJ-4.X.X, where the 4-X.X refers to the version. You should rename the parent folder to PROJ. |
| 27 | 3. If you want to support NAD27 to NAD83 datum shifts, also download the US and Canadian datum shift grids from the same site (this should come packaged as a single archive - Zip or Tar). Un-compress this file to the C:\PROJ\NAD directory. |
| 28 | 4. Compile PROJ4. |
| 29 | |
| 30 | Using Microsoft Visual C++, you would do the following: |
| 31 | |
| 32 | C:\proj\src>"C:\Program Files\Microsoft Visual Studio .NET\Vc7\bin\vcvars32.bat" |
| 33 | C:\proj\src>nmake /f makefile.vc nadshift |
| 34 | |
| 35 | Note that the first line simply sets the environment variable for doing command-line compiling using Microsoft Visual C++. The second line compiles the program AND specifies that you want PROJ4 to be configured to support NAD shifting. |