stephan@229: .. index:: installation, requirements, apache, UMN MapServer, compile, stephan@229: jar, logging, ArcSDE stephan@188: stephan@140: ------------ stephan@140: Requirements stephan@140: ------------ stephan@140: stephan@140: The current version of the converter only runs on Windows. This is because stephan@229: the ArcObjects JDK API is not running properly on Linux though. In theory stephan@229: it should also run on Linux. stephan@140: stephan@140: To run the converter you need at least the following componentes: stephan@140: stephan@140: * Sun Java6 SDK to build, JRE to run stephan@140: * ArcGIS Desktop10.x or ArcEngine10.x with a valid licence enabled stephan@202: * UMN MapServer with Java MapScript-bindings (>=6.0.1 or recent development-version) stephan@229: * Optinal: Apache2 Webserver for displaying the resulting Mapfiles stephan@140: * Optional: MapServer compiled with ArcSDE-plugin stephan@140: * Optional: GDAL/OGR compiled with ArcSDE-support stephan@229: * Optional: GDAL/OGR compiled with FileGeodatabase-support stephan@229: * Optional: Other GDAL/OGR-related tools stephan@229: * Optional: Sphinx for building the docs stephan@140: stephan@140: stephan@140: ------------ stephan@140: Installation stephan@140: ------------ stephan@140: stephan@140: Compile the converter-sources stephan@140: ----------------------------- stephan@140: stephan@140: To compile the sources you need to have a properly configured stephan@140: ant-environmet available. ArcGIS SDK provides an ant-installation which stephan@140: suffices:: stephan@140: stephan@140: ant jar stephan@140: rrenkert@182: or:: rrenkert@182: rrenkert@182: ant jar-norevision rrenkert@182: stephan@140: Create run-environment stephan@140: ---------------------- stephan@140: rrenkert@182: The current version of MXD2map needs a few steps to run properly. rrenkert@182: The following steps assume the runtime folder to be c:/mxd2map/. This path can rrenkert@182: be changed. stephan@140: stephan@202: 1. Copy ``mxd2map.jar`` to ``c:/mxd2map/``. stephan@140: stephan@202: #. Copy folder "conf" from repository to ``c:/mxd2map/`` rrenkert@182: stephan@202: #. Create folder ``c:/mxd2map/lib/`` rrenkert@182: rrenkert@182: #. Get log4j from http://logging.apache.org/log4j/1.2/download.html rrenkert@182: rrenkert@182: #. Get jargs http://jargs.sourceforge.net/ (Version 1.0) rrenkert@182: stephan@202: #. Build the libraries and copy the resulting jar-files to ``c:/mxd2map/lib/`` rrenkert@182: stephan@202: #. Copy mapscript.jar and mapscript.dll to ``c:/mxd2map/lib/`` rrenkert@182: stephan@202: #. Create a folder ``c:/mxd2map/logs/`` rrenkert@182: stephan@202: #. Create or copy a converter.properties file to ``c:/mxd2map/`` stephan@202: stephan@202: Setup environment-variables stephan@202: --------------------------- stephan@202: stephan@202: For running the converter it is necessary to set up some environment stephan@202: variables and adjust the path accordingly. stephan@202: stephan@202: The following example shows the minimum env-vars needed:: stephan@202: stephan@202: @echo off stephan@202: if "%1" == "setenv" goto setenv stephan@202: stephan@202: %comspec% /k SDKShell.bat setenv %1 stephan@202: goto exit stephan@202: stephan@202: :setenv stephan@202: @echo Setting environment for using the GDAL and MapServer tools. stephan@202: stephan@202: if "%2"=="hideoci" goto hideoci stephan@202: stephan@202: set ocipath=0 stephan@202: set _path="%PATH:;=" "%" stephan@202: for %%p in (%_path%) do if not "%%~p"=="" if exist %%~p\oci.dll set ocipath=1 stephan@202: stephan@202: if "%ocipath%"=="0" goto hideoci stephan@202: @echo WARNING: If you encounter problems with missing oci libraries then type: stephan@202: @echo SDKShell hideoci stephan@202: goto setenv2 stephan@202: stephan@202: :hideoci stephan@202: @echo Hiding the OCI plugin library. stephan@202: if not exist %CD%\bin\gdal\plugins-optional mkdir %CD%\bin\gdal\plugins-optional stephan@202: if exist %CD%\bin\gdal\plugins\ogr_OCI.dll move %CD%\bin\gdal\plugins\ogr_OCI.dll %CD%\bin\gdal\plugins-optional\ogr_OCI.dll stephan@202: if exist %CD%\bin\gdal\plugins\gdal_GEOR.dll move %CD%\bin\gdal\plugins\gdal_GEOR.dll %CD%\bin\gdal\plugins-optional\gdal_GEOR.dll stephan@202: stephan@202: :setenv2 stephan@202: SET PATH=C:\Program Files\ArcGIS\DeveloperKit10.0\java\jre\bin;C:\Program Files\ArcGIS\Engine10.0\bin;%CD%\bin;%CD%\bin;%CD%\bin\gdal\python\osgeo;%CD%\bin\proj\apps;%CD%\bin\gdal\apps;%CD%\bin\ms\apps;%CD%\bin\gdal\csharp;%CD%\bin\ms\csharp;%CD%\bin\curl;%CD%\bin\ms\java;C:\Program Files\Vim\vim71;C:\Program Files\TortoiseHg;%PATH% stephan@202: SET GDAL_DATA=%CD%\bin\gdal-data stephan@202: SET GDAL_DRIVER_PATH=%CD%\bin\gdal\plugins stephan@202: SET PYTHONPATH=%CD%\bin\gdal\python\osgeo stephan@202: SET PROJ_LIB=%CD%\bin\proj\SHARE stephan@202: SET CURL_CA_BUNDLE=C:\ms4w\Apache\conf\ca-bundle\cacert.pem stephan@202: stephan@202: :exit stephan@202: stephan@202: The above batch-script ``SDKShell.bat`` needs to be sources before working stephan@202: with MXD2map. stephan@202: stephan@229: stephan@229: Install Apache Webserver stephan@229: ------------------------ stephan@229: stephan@229: If you will be able to display the resulting mapfiles directly you need to stephan@229: install a webserver like Apache2 and the UMN MapServer CGI-file stephan@229: ``mapserv.exe``. stephan@229: stephan@229: Install Apache webserver by exedcuting the .msi-file and follow the stephan@229: install-dialogs:: stephan@229: stephan@229: httpd-2.2.19-win32-x86-openssl-0.9.8r.msi stephan@229: stephan@229: Make sure that you install apache as a service so it will be available stephan@229: directly after system bootup. stephan@229: stephan@229: stephan@229: Install UMN MapServer stephan@229: --------------------- stephan@229: stephan@229: The current documentation uses the Windows binary-builds from http://www.gisinternals.com/sdk/ stephan@229: stephan@229: 1. Unzip the ZIP-file at ``c:/ms_6.1-dev`` stephan@229: stephan@229: #. Configure Apache Webserver to find the cgi-bin-folder:: stephan@229: stephan@229: ScriptAlias /cgi-bin/ "C:/ms_6.1-dev/bin/" stephan@229: stephan@229: stephan@229: Options None stephan@229: Order allow,deny stephan@229: Allow from all stephan@229: stephan@229: stephan@229: #. Copy mapserv.exe from ``c:/ms_6.1-dev/bin/apps/ms`` to ``c:/ms_6.1-dev/bin/`` stephan@229: stephan@235: #. Add environment-variables to apache in order to have WMS-server available:: stephan@235: stephan@235: SetEnv PROJ_LIB "c:/ms_6.1-dev/bin/proj/SHARE" stephan@235: SetEnv PATH "c:/ms_6.1-dev/bin" stephan@235: SetEnv PATH "c:/ms_6.1-dev/bin/gdal/python/osgeo" stephan@235: stephan@235: # set GDAL_DATA environment variable to location of supporting gdal files stephan@235: SetEnv GDAL_DATA "c:/ms_6.1-dev/bin/gdaldata" stephan@235: stephan@235: # set GDAL_DRIVER_PATH environment variable for gdal plugins stephan@235: SetEnv GDAL_DRIVER_PATH "c:/ms_6.1-dev/bin/gdal/plugins" stephan@235: stephan@229: stephan@229: Configure Logging stephan@229: ----------------- stephan@229: stephan@229: Logging is supported on different levels. MXD2map logs with Javas Log4J. A stephan@229: sample configuration could look like this:: stephan@229: stephan@229: #### Log just errors and warnings to a file. stephan@229: log4j.rootLogger=DEBUG, MXD, Console stephan@229: stephan@229: log4j.appender.MXD=org.apache.log4j.RollingFileAppender stephan@229: log4j.appender.MXD.File=./logs/console-client.log stephan@229: log4j.appender.MXD.MaxFileSize=5000KB stephan@229: log4j.appender.MXD.MaxBackupIndex=1 stephan@229: log4j.appender.MXD.layout=org.apache.log4j.PatternLayout stephan@229: log4j.appender.MXD.layout.ConversionPattern=%d [%t] %-5p %c - %m%n stephan@229: stephan@229: #log4j.rootLogger=WARN, Console stephan@229: log4j.appender.Console=org.apache.log4j.ConsoleAppender stephan@229: log4j.appender.Console.Threshold=INFO stephan@229: log4j.appender.Console.layout=org.apache.log4j.PatternLayout stephan@229: log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p %c - %m%n stephan@229: stephan@229: stephan@229: Apache Webserver and UMN MapServer stephan@229: .................................. stephan@229: stephan@229: They both support logging. MapServers outout ends up in Apaches logfiles stephan@229: if not configured differently within a providing template. The loglevel stephan@229: can be adjusted at template-level. For further information consult the UMN stephan@229: MapServer manual regarding logging at stephan@229: http://mapserver.org/optimization/debugging.html#steps-to-enable-mapserver-debugging.