User avatar
Posts: 229
Joined: Thu Jul 26, 2007 8:41 pm
Location: Sweden
Contact: Website

Use customized units in GpsGate Server

Mon Jul 06, 2009 4:00 pm

Customized units in GpsGate Server

With version 2.2 (and later) of GpsGate Server it is possible to customize the units used in your installation by editing or adding new measurement files. The GpsGate Server has a default measurement setting per server and each user can also have individual measurement settings. Any number of measurement files can be installed on one server. This is a step by step-instruction how to do this

1. Getting started: The default measurement setting in GpsGate Server is metric (English-US and nautic measurement files are also available). In order to add your own measurements you need to edit an existing measurement file or create a new one.

Put the customized measurement file in "YourInstallPath/Resources/Languages"

Note: The text editor you use should support UTF-8. And do remember to save the file as UTF-8

2. Creating a new measurement file: Copy an existing measurement file in the Resources-folder, select the one that is "closest" to your requirements. Open the copy with a program such as Notepad. All GpsGate measure names are listed in the measurement file with their current conversion settings. Do the following for each measurement to change the units used in your installation:

a) Change the MeasurementTable Name, this is what identifies your measurement file in the user interface

b) Select a TargetUnit Name, Symbol and Plural language keys

c) Set the conversion factor for your TargetUnit

d) If you add a new TargetUnit, remember to add the new language keys to your language files

3. Customization sample: To show the altitude in feet in your metric installation you should create a new measurement file with the altitude changed from meter to feet

a) Copy the file Metric.measure to a second file called Metric_2.measure. Open Metric_2.measure in an editor.

b) Give the measurement table a unique name. Change the line <MeasurementTable Name="metric"> to <MeasurementTable Name="metric 2">

c) Find the measure "POS_ALTITUDE" in the template file:

<Measure Name="POS_ALTITUDE">
  <Converter Type="Linear" Factor="1" Delta="0" />
  <Format Format="0.0" />

d) Change the TargetUnit names and conversion factor. Check your language files for existing "UNIT_" language keys, if you are adding a unit not yet present you need to add language keys to the language file. Calculate your conversion factor, the conversion factor from meter to feet is 1/0.3048 = 3.280839895013. The new file is shown below:

<Measure Name="POS_ALTITUDE">
  <TargetUnit Name="UNIT_NAME_FOOT" Symbol="UNIT_SYMBOL_FOOT" Plural="UNIT_PLURAL_FOOT" />
  <Converter Type="Linear" Factor="3.280839895013" Delta="0" />
  <Format Format="0.0" />

e) Save the file in UTF-8 format

f) Open your language files and verify that the "UNIT_" language keys used for your TargetUnit are present, if not you must add the phrase keys (please look at the guide about language files for language file editing). These phrase keys need to be present in the language files:

<Phrase key="UNIT_NAME_FOOT">foot</Phrase>
<Phrase key="UNIT_SYMBOL_FOOT">ft</Phrase>
<Phrase key="UNIT_PLURAL_FOOT">feet</Phrase>

4. When you have done this, Logon as the SiteAdmin and go to the Settings-window, select the default measurement of your choice and click the Save-button and then click on the “Rescan languages and measurements” button, this will force the GUI to use your selected .measure file instead of using cached measurements.

The measurement file does not show up in the drop down! - Common errors

a. Check that the XML syntax is correct. Make a copy of your .measure file, change the extension to .xml and open it in Internet Explorer by double clicking on it. Internet Explorer will now verify the file, and display any errors.

b. Check the rights on the file. When you copy the file to the web folder, make sure the web server has right to read the file.

Return to “GpsGate Server - How to setup and use”