The Home of GeoMOOSE!

Wiki | Tickets | Live Demos | Download
GeoMOOSE Logo

Table Of Contents

Previous topic

GeoMOOSE Configuration Options

Next topic

Settings.ini Reference Guide

This Page

Changing the Projection

GeoMOOSE 2 uses the Proj4js library to perform all of its projection work. This is much more robust than the older GeoMOOSE reprojection library but requires a much different setup to include a different projection within the application.

Many applications may use a well-known projection. Most of these projections are assigned an EPSG code.

Step 1: Determine your projection.

This may have already been done for you. Having a predetermined projection makes this step quick and easy. However, some projections are not found in the standard collection of projections and you will have to define your own. Proj4js uses the same projection parameter style as the Proj4 C-library. If you need to make a custom projection, create one using an EPSG code of greater than 100000. For example, I may have a projection called “Duck’s Projection.” If I were to use “Duck’s Projection” I would need to define it using proj params (these are form a randomly select filter):

+proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs

Step 2: Create a Projection Javascript File.

You can create this file in the htdocs directory but it should be named “EPSGXXXXX.js” where “XXXXX” is the number for your projection. If this is a custom projection give it a number above 100000. In side of this file you should have:

Proj4js.defs["EPSG:XXXXX"] = "+proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m +no_defs";

Again, substitute your own EPSG number and projection information above.

Step 3: Change the mapserver parameter for your projection.

In the <configuration> section of the mapbook book you will need to change/create the following line:

<param name=”projection”>EPSG:XXXXX</param>

Step 4: Include the Javascript File

Find the section in the <head> of geomoose.html that states, “Include your projection here” and place some code:

<script type=”text/javascript” src=”EPSGXXXXX.js”></script>

For more information on finding projections and projection definition strings visit http://www.spatialreference.org.