1. Introduction

Overview

The Eye4Software GPS Toolkit, is a software component that helps you developing your own GPS applications, including Track and Trace, Navigation, Positioning, Hydrographic Survey, construction and much more.

The core of the toolkit is a single "GpsCtl32.dll" (32bit) or "GpsCtl64.dll" (64bit) file. The toolkit offers the following features:

 Supports up to 256 serial ports, including RS232, Bluetooth and USB serial ports;  Supports Garmin GPS devices connected by USB (Garmin PVT protocol);  Decodes the most common used GPS NMEA0183 sentences like: GGA, GLL, GSA, GSV, RMC, RME, RMZ, VTG and ZDA;  Outputs and as both decimal and (user defined) string representations;  Conversion between units, like km/h, mph, feet, knots, meters;  Conversion between geodetic datums and reference ellipsoids;  Conversion between latitude / longitude and map projections;  Convert coordinates between NAD83 and NAD27 using NADCON correction files;  Convert coordinates between NAD83 and NAD83(HARN) using HARN/HPGN correction files;  Convert coordinates between different map datums using NTv2 correction files;  Distance and Azimuth calculation using Vincenty's formula;  Built-in support for more than 350 map datums and 3500 map grids.

When the toolkit is used to convert coordinates, the following map projections are supported:

 Lambert Conformal Conic (LCC) 1SP projection;  Lambert Conformal Conic (LCC) 1SP projection (West Orientated);  Lambert Conformal Conic (LCC) 2SP projection;  Lambert Conformal Conic (LCC) 2SP projection (Belgium);  Lambert Equal Area Conic projection;  Transverse ;  Transverse Mercator projection (South Orientated);  Oblique Mercator projection;  Hotine Oblique Mercator projection;  Swiss Oblique Mercator projection;  Oblique ;  Polar Stereographic projection;  Albers Equal Area Conic projection;  Cassini Soldner projection;  Mercator projection 1SP;  Mercator projection 2SP;  Polyconic projection;  Gauss Kruger projection;  Universal Transverse Mercator (UTM) projection;  ;  Eckert IV projection;  Eckert VI projection;  Krovak projection;  Cylindrical Equal Area Projection;  ;  Miller Projection;  ;  Gall stereographic projection;  ;  Equirectangular projection;  Loximuthal projection;  Plate Carree projection;  Van der Grinten I projection;  Winkel I projection  Ortographic projection;  ;  Hammer-;  Quartic authalic projection;  Azimuthal Equidistant projection.

Supported programming languages

The toolkit can be used with every programming language which supports the use of ActiveX / COM objects. Some development environments that include ActiveX are:

 Microsoft Visual C++;  Microsoft Visual Basic;  Microsoft Visual C# .Net;  Microsoft Visual Basic .Net;  Microsoft VBScript;  Microsoft Visual Basic for Applications (MS Excel, MS Access, MS Word);  Microsoft ASP;  Microsoft ASP .NET;  Borland C++ Builder;  Borland Delphi;  PHP;  Coldfusion;  Powerbuilder.

Requirements

The toolkit can be used to write applications or scripts for the following platforms:

Server Platforms:

 Windows 2000 Server;  Windows 2003 Server;  Windows 2008 Server;  Windows 2003 R2 Server;  Windows 2008 R2 Server.

Desktop Platforms:

 Windows 2000 Professional;  Windows XP;  Windows Vista;  Windows 7;  Windows 8.

Supported GPS hardware

You can use all GPS devices equipped with a NMEA0183 port, or Garmin GPS devices equipped with an USB connector. If you do not have such a device, you also use a GPS or NMEA0183 simulator to get started with your project. All NMEA0183 versions are currently supported.

NOTE: When using a Garmin GPS device, connected using an USB cable, no virtual serial port driver is needed, the GPS Toolkit communicates directly with Garmin's USB driver using Garmin's PVT protocol.

Installation

There are 2 ways to install this software on your computer:

Automatic Installation

To use the automatic installation, just download the installer from our website. The setup wizard will guide you through the installation process. After installation has been completed, all components and code samples are installed on your computer.

Manual Installation

When you want to include the product in your installer, or you want to test the component on a pc without using the setup wizard, just copy the core of the toolkit, the "GpsCtl32.dll" or GpsCtl64.dll (depending on the target platform) to the target computer, and register the control with the REGSVR32 command like this (replace the path with the path to your copy of the file):

REGSVR32 C:\Program Files\Eye4Software\Gps Toolkit\Program\GpsCtl32.dll

or for a x64 platform:

REGSVR32 C:\Program Files\Eye4Software\Gps Toolkit\Program\GpsCtl64.dll

When you encounter any troubles registering the component, make sure you have Administrator rights and/or UAC is turned off.

2. Getting Started

This section of the manual describes how to use the component in the various programming environments. If your programming language is not listed, please contact our support department.

Microsoft Visual C++

First, you have to create a new project. The toolkit can be used with both GUI and Console projects. Make sure the component is installed and registered on your development PC. For installation on a development PC, the automatic installation is recommended.

In order to use the GPS toolkit from Visual C++, you have to copy some include files to your new project folder. These files are included in the Visual C++ sample included with the product: "GpsCtrl.h", "GpsCtrl_i.c" and "GpsConstantsX.h".

In the source file you are going to use the component, include the following lines of code:

#include "GpsCtrl.h" #include "GpsCtrl_i.c" #include "GpsConstantsX.h"

Declare the component in your code like this:

IGps * m_pGps = NULL; IGpsUtilities * m_pUtilities = NULL; IGpsProjection * m_pGpsProjection = NULL; IGpsDatumParameters * m_pGpsDatumParameters = NULL; IGpsGridParameters * m_pGpsDatumParameters = NULL;

Because we are going to use an ActiveX object, we have to initialize COM like this:

CoInitialize ( NULL );

Now you should be able to create an instance of the object(s), always make sure that you check the m_pGps pointer before using it, if its value is NULL, most probably the component isn't registered on the system.

CoCreateInstance ( CLSID_Gps, NULL, CLSCTX_INPROC_SERVER,

IID_IGps, ( void ** ) &m_pGps );

CoCreateInstance ( CLSID_GpsUtilities, NULL, CLSCTX_INPROC_SERVER, IID_IGpsUtilities, ( void ** ) &m_pGpsUtilities );

CoCreateInstance ( CLSID_GpsProjection, NULL, CLSCTX_INPROC_SERVER, IID_IGpsProjection, ( void ** ) &m_pGpsProjection );

CoCreateInstance ( CLSID_GpsDatumParameters, NULL , CLSCTX_INPROC_SERVER, IID_IGpsDatumParameters, ( void ** ) &m_pGpsDatumParameters );

CoCreateInstance ( CLSID_GpsGridParameters, NULL, CLSCTX_INPROC_SERVER, IID_IGpsGridParameters, ( void ** ), &m_pGpsGridParameters );

Visual Basic

First you have to create a new project. The toolkit can be used with both GUI and Console projects, for a GUI object, just select the "Standard EXE" project option. Make sure the component is installed and registered on your development PC. For installation on a development PC, the automatic installation is recommended.

In order to use the GPS Toolkit from Visual Basic, you have to add a reference to the ActiveX control. You can do this by selecting the "References..." option from the "Project" menu, and check the checkbox in front of the "Eye4Software GPS Toolkit" and click "OK". Declare the component in your code like this:

Private objGps As Gps Private objGpsUtilities As GpsUtilities Private objGpsProjection As GpsProjection Private objGpsDatumParameters As GpsDatumParameters Private objGpsGridPatameters As GpsGridParameters Private objGpsConstants As GpsConstants

Now you should be able to create an instance of the object(s), always make sure that you check the objGps object (it should not be Null) before using it.

Set objGps = CreateObject ("Eye4Software.Gps") Set objGpsUtilities = CreateObject ("Eye4Software.GpsUtilities") Set objGpsProjection = CreateObject ("Eye4Software.GpsProjection") Set objGpsDatumParameters = CreateObject ("Eye4Software.GpsDatumParameters") Set objGpsGridParameters = CreateObject ("Eye4Software.GpsGridParameters") Set objGpsConstants = CreateObject ("Eye4Software.GpsConstants")

Visual Basic .NET

First you have to create a new project. The toolkit can be used with both .NET Windows Forms and Console Application projects, for a Windows Forms object, just select the "Windows Application" project option. Make sure the component is installed and registered on your development PC. For installation on a development PC, the automatic installation is recommended.

In order to use the GPS Toolkit from Visual Basic .NET, you have to add a reference to the ActiveX control. You can do this by selecting the "Add Reference..." option from the "Project" menu, and check the checkbox in front of the "Eye4Software GPS Toolkit 2.2" and click "OK". Declare the component in your code like this:

Private objGps As Gps Private objGpsUtilities As GpsUtilities Private objGpsProjection As GpsProjection Private objGpsDatumParameters As GpsDatumParameters Private objGpsGridPatameters As GpsGridParameters Private objGpsConstants As GpsConstants

Now you should be able to create an instance of the object(s), always make sure that you check the objGps object (it should not be Null) before using it.

objGps = New Gps objGpsUtilities = New GpsUtilities objGpsProjection = New GpsProjection objGpsDatumParameters = New GpsDatumParameters objGpsGridParameters = New GpsGridParameters objGpsConstants = New GpsConstants

Visual C# .NET

First you have to create a new project. The toolkit can be used with both .NET Windows Forms and Console Application projects, for a Windows Forms object, just select the "Windows Application" project option. Make sure the component is installed and registered on your development PC. For installation on a development PC, the automatic installation is recommended.

In order to use the GPS Toolkit from Visual C# .NET, you have to add a reference to the ActiveX control. You can do this by selecting the "Add Reference..." option from the "Project" menu, and check the checkbox in front of the "Eye4Software GPS Toolkit" and click "OK". Declare the component in your code like this:

private Gps objGps; private GpsUtilities objGpsUtilities; private GpsProjection objGpsProjection; private GpsConstants objGpsConstants; private GpsDatumParameters objGpsDatumParameters; private GpsGridParameters objGpsGridParameters;

Now you should be able to create an instance of the object(s), always make sure that you check the objGps object (it should not be Null) before using it.

objGps = new Gps(); objGpsUtilities = new GpsUtilities(); objGpsProjection = new GpsProjection(); objGpsDatumParameters = new GpsDatumParameters(); objGpsGridParameters = new GpsGridParameters(); objGpsConstants = new GpsConstants();

VBScript

First you have to create a script file using notepad or a VBS editor. Make sure the component is installed and registered on your development PC. For installation on a development PC, the automatic installation is recommended.

Declare the component in your script like this:

Dim objGps Dim objGpsUtilities Dim objGpsProjection Dim objGpsDatumParameters Dim objGpsGridPatameters Dim objGpsConstants

Now you should be able to create an instance of the object, always make sure that you check the objGps object (it should not be Null) before using it.

Set objGps = CreateObject ("Eye4Software.Gps") Set objGpsUtilities = CreateObject ("Eye4Software.GpsUtilities") Set objGpsProjection = CreateObject ("Eye4Software.GpsProjection") Set objGpsDatumParameters = CreateObject ("Eye4Software.GpsDatumParameters") Set objGpsGridParameters = CreateObject ("Eye4Software.GpsGridParameters") Set objGpsConstants = CreateObject ("Eye4Software.GpsConstants")

Borland Delphi

First you have to create a new project. Make sure the component is installed and registered on your development PC. For installation on a development PC, the automatic installation is recommended.

Declare the component in your code like this:

var objGps : Variant; objGpsUtilities : Variant; objGpsProjection : Variant; objGpsDatumSrc : Variant; objGpsDatumDst : Variant; objGpsGridSrc : Variant; objGpsGridDst : Variant; objGpsConstants : Variant;

Now you should be able to create an instance of the object, always make sure that you check the objGps object (it should not be Null) before using it.

objGps := CreateOleObject ( 'Eye4Software.Gps' ); objGpsUtilities := CreateOleObject ( 'Eye4Software.GpsUtilities'); objGpsProjection := CreateOleObject ( 'Eye4Software.GpsProjection' ); objGpsDatumSrc := CreateOleObject ( 'Eye4Software.GpsDatumParameters' ); objGpsDatumDst := CreateOleObject ( 'Eye4Software.GpsDatumParameters' ); objGpsGridSrc := CreateOleObject ( 'Eye4Software.GpsGridParameters' ); objGpsGridDst := CreateOleObject ( 'Eye4Software.GpsGridParameters' ); objGpsConstants := CreateOleObject ( 'Eye4Software.GpsConstants' );

3. The 'GpsConstants' object

The GpsConstants is an object which only contains constants, which can be used in other objects. Some examples of constants are the values used to specify units, latitude / longitude format etc.

Dataformat Constants

Constant Value Description

GPS_DEVICE_FORMAT_DEFAULT 0 Use default dataformat on the serial port GPS_DEVICE_FORMAT_8N1 1 Use N,8,1 dataformat on the serial port GPS_DEVICE_FORMAT_7E1 2 Use E,7,1 dataformat on the serial port

NMEA Filter Constants

Constant Value Description

GPS_NMEA_FILTER_GGA 1 Decode the GGA sentences GPS_NMEA_FILTER_GLL 2 Decode the GLL sentences GPS_NMEA_FILTER_RMC 4 Decode the RMC sentences GPS_NMEA_FILTER_VTG 8 Decode the VTG sentences GPS_NMEA_FILTER_GSA 16 Decode the GSA sentences GPS_NMEA_FILTER_GSV 32 Decode the GSV sentences GPS_NMEA_FILTER_RME 4096 Decode Garmin proprietary RME sentences GPS_NMEA_FILTER_RMZ 8192 Decode Garmin proprietary RMZ sentences

Speed Unit Constants

Constant Value Description

GPS_SPEED_KNOTS 0 Return speed in knots GPS_SPEED_MILESPERHOUR 1 Return speed in miles per hours GPS_SPEED_KILOMETERSPERHOUR 2 Return speed in kilometer per hour GPS_SPEED_METERSPERSECOND 3 Return speed in meters per second

Altitude Unit Constants

Constant Value Description

GPS_ALTITUDE_METERS 0 Return altitude in meters GPS_ALTITUDE_FEET 1 Return altitude in feet

Latitude and Longitude formats

Constant Value Description

GPS_LATLONFORMAT_D 0 Return position in dd.dddd format GPS_LATLONFORMAT_DM 1 Return position in dd mm.mm format GPS_LATLONFORMAT_DMS 2 Return position in dd mm sss format

Datum Shift Grid Type

Constant Value Description

GPS_GRIDTYPE_NONE 0 Do not use a datum shift grid (default) GPS_GRIDTYPE_NADCON 3 Use a NADCON datum shift file GPS_GRIDTYPE_HARN 4 Use a HARN/HPGN datum shift file GPS_GRIDTYPE_NTV2 5 Use a NTv2 datum shift file

Map Projection Constants

Constant Value Description

Do not use grid, just use GPS_PROJECTION_NONE 0 latitude and longitude Use Lambert Conformal Conic GPS_PROJECTION_LAMBERT1SP 100 projection with one standard parallel Use Lambert Conformal Conic projection with one standard GPS_PROJECTION_LAMBERT1SPWEST 100 parallel, West orientated as used in Iceland, Greenland and Faroe Use Lambert Conformal Conic GPS_PROJECTION_LAMBERT2SP 110 projection with two standard parallels Use Lambert Conformal Conic GPS_PROJECTION_LAMBERT2SPBELGIUM 110 projection with two standard parallels (Belgium Variant) Use Lambert Azimuthal Equal GPS_PROJECTION_LAMBERTAEA 120 Area projection Use Albers Equal Area Conic GPS_PROJECTION_ALBERSEQUALAREA 130 projection Use Mercator projection with GPS_PROJECTION_MERCATOR1SP 140 one standard parallel Use Mercator projection with GPS_PROJECTION_MERCATOR2SP 150 two standard parallels Use Transverse Mercator GPS_PROJECTION_TRANSVERSEMERCATOR 160 projection Use Transverse Mercator GPS_PROJECTION_TRANSVERSEMERCATORSOUTH 161 projection, south orientated, as used in South Africa Use Oblique Mercator GPS_PROJECTION_OBLIQUEMERCATOR 170 projection Use Hotine Oblique Mercator GPS_PROJECTION_HOTINEOBLIQUEMERCATOR 180 projection Use Swiss Oblique Mercator GPS_PROJECTION_SWISSOBLIQUEMERCATOR 190 projection GPS_PROJECTION_STEREOGRAPHIC 210 Use Stereographic projection Use Polar Stereographic GPS_PROJECTION_POLARSTEREOGRAPHIC 220 projection GPS_PROJECTION_CASSINI 230 Use GPS_PROJECTION_KROVAK 240 Use Krovak projection GPS_PROJECTION_POLYCONIC 250 Use Polyconic projection GPS_PROJECTION_MOLLWEIDE 260 Use Mollweide projection GPS_PROJECTION_ECKERTIV 270 Use Eckert IV projection GPS_PROJECTION_ECKERTVI 280 Use Eckert VI projection Use Cylindrical Equal Area GPS_PROJECTION_CYLINDRICALEQUALAREA 290 projection GPS_PROJECTION_SINUSOIDAL 300 Use Sinusoidal projection GPS_PROJECTION_MILLER 310 Use Miller projection GPS_PROJECTION_BONNE 320 Use Bonne projection

Projection Units

Constant Value Description

GPS_PROJECTION_UNITS_M 9001 Meter GPS_PROJECTION_UNITS_KM 9036 Kilometer GPS_PROJECTION_UNITS_GLM 9031 German Legal Meter GPS_PROJECTION_UNITS_FT 9002 International Foot GPS_PROJECTION_UNITS_FTBR 9095 British Foot GPS_PROJECTION_UNITS_FTCLA 9005 Clarke's Foot GPS_PROJECTION_UNITS_FTGC 9094 Gold Coast Foot GPS_PROJECTION_UNITS_FTIND 9080 Indian Foot GPS_PROJECTION_UNITS_FTSE 9041 British Foot (Sears) GPS_PROJECTION_UNITS_FTUS 9003 U.S. Survey Foot GPS_PROJECTION_UNITS_LK 9098 Link GPS_PROJECTION_UNITS_LKCLA 9039 Clarke's Link GPS_PROJECTION_UNITS_LKSE 9043 British Link (Sears) GPS_PROJECTION_UNITS_LKUS 9034 U.S. Survey Link GPS_PROJECTION_UNITS_MI 9093 Statute Mile GPS_PROJECTION_UNITS_MIUS 9035 U.S. Survey Mile GPS_PROJECTION_UNITS_NM 9030 Nautical Mile GPS_PROJECTION_UNITS_CH 9097 Chain GPS_PROJECTION_UNITS_CHCLA 9038 Clarke's Chain GPS_PROJECTION_UNITS_CHSE 9042 British Chain (Sears) GPS_PROJECTION_UNITS_CHUS 9033 U.S. Survey Chain GPS_PROJECTION_UNITS_YDIND 9084 Indian Yard GPS_PROJECTION_UNITS_YDCLA 9037 Clarke’s Yard GPS_PROJECTION_UNITS_CHUS 9040 British Yard (Sears)

4. The 'GpsSatelliteInfo' object

The GpsSatelliteInfo object is used only with the following functions: GetFirstSatellite and GetNextSatellite. It is used to hold information about a satellite used to calculate a fix. The object stores information about the satellite's ID, elevation, azimuth and signal strength.

GpsSatelliteInfo Object Properties

ID property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

The PRN# or SVID of the current GPS satellite.

Code Sample:

... Set objSat = objGps.GetFirstSatellite ()

While ( objGps.LastError = 0 )

WScript.Echo "Info for satellite #" & objSat.ID WScript.Echo " Azimuth : " & objSat.Azimuth WScript.Echo " Elevation : " & objSat.Elevation WScript.Echo " Signal : " & objSat.SignalNoiseRatio WScript.Echo " Used : " & objSat.UsedForFix

Set objSat = objGps.GetNextSatellite () WEnd

Elevation property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

The elevation of the current GPS satellite in degrees.

Code Sample:

... Set objSat = objGps.GetFirstSatellite ()

While ( objGps.LastError = 0 )

WScript.Echo "Info for satellite #" & objSat.ID WScript.Echo " Azimuth : " & objSat.Azimuth WScript.Echo " Elevation : " & objSat.Elevation WScript.Echo " Signal : " & objSat.SignalNoiseRatio WScript.Echo " Used : " & objSat.UsedForFix

Set objSat = objGps.GetNextSatellite ()

WEnd

Azimuth property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

The azimuth of the current GPS satellite in degrees.

Code Sample:

Set objSat = objGps.GetFirstSatellite ()

While ( objGps.LastError = 0 )

WScript.Echo "Info for satellite #" & objSat.ID WScript.Echo " Azimuth : " & objSat.Azimuth WScript.Echo " Elevation : " & objSat.Elevation WScript.Echo " Signal : " & objSat.SignalNoiseRatio WScript.Echo " Used : " & objSat.UsedForFix

Set objSat = objGps.GetNextSatellite () WEnd

SignalNoiseRatio property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

The SNR (Signal Noise Ratio) of the current GPS satellite in dB (decibel).

Code Sample:

... Set objSat = objGps.GetFirstSatellite ()

While ( objGps.LastError = 0 )

WScript.Echo "Info for satellite #" & objSat.ID WScript.Echo " Azimuth : " & objSat.Azimuth WScript.Echo " Elevation : " & objSat.Elevation WScript.Echo " Signal : " & objSat.SignalNoiseRatio WScript.Echo " Used : " & objSat.UsedForFix

Set objSat = objGps.GetNextSatellite () WEnd

UsedForFix property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

This property indicates whether this satellite was used for the current fix. If this value is TRUE it was used, if FALSE, the satellite is in view, but was not used for calculating the fix (yet).

Code Sample:

... Set objSat = objGps.GetFirstSatellite ()

While ( objGps.LastError = 0 )

WScript.Echo "Info for satellite #" & objSat.ID WScript.Echo " Azimuth : " & objSat.Azimuth WScript.Echo " Elevation : " & objSat.Elevation WScript.Echo " Signal : " & objSat.SignalNoiseRatio WScript.Echo " Used : " & objSat.UsedForFix

Set objSat = objGps.GetNextSatellite () WEnd

GpsSatelliteInfo Object Functions

Clear Function

Return Value:

Always 0.

Parameters:

None

Optional:

Yes

Description:

Use this function to clear all the values of the GpsSatelliteInfo object.

Code Sample:

... Set objSat = objGps.GetFirstSatellite ()

While ( objGps.LastError = 0 )

WScript.Echo "Info for satellite #" & objSat.ID WScript.Echo " Azimuth : " & objSat.Azimuth WScript.Echo " Elevation : " & objSat.Elevation WScript.Echo " Signal : " & objSat.SignalNoiseRatio WScript.Echo " Used : " & objSat.UsedForFix

objSat.Clear ()

Set objSat = objGps.GetNextSatellite () WEnd

5. The 'Gps' object

The Gps object is the core of the component, it handles the serial communication and the decoding of the received NMEA sentences.

Gps Object Properties

Version property

Type:

String

In/Out:

Out

Optional:

Yes

Description:

The version property can be used to print the version number of the GPS toolkit version currently used.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" )

WScript.Echo objGps.Version

RegistrationCode property

Type:

String

In/Out:

In

Optional:

Yes

Description:

Use this property to activate the software. Once you purchased the software, you will receive a license code. Assign this code to this property to be able to use the software after the evaluation has been expired.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) objGps.RegistrationCode = "XXXXXXXXXXXXXXXXXXXXXXXXXXX"

Registered property

Type:

Boolean

In/Out:

Out

Optional:

Yes

Description:

This value indicates whether the software has been activated. When the software has been successfully activated using the "RegistrationCode" property, or when the evaluation period has not been expired yet, it will return TRUE, otherwise FALSE.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" )

If ( objGps.Registered = True ) Then Wscript.Echo "Registration OK" Else WScript.Echo "Invalid license key, or trial has been expired" End If

LastError property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

When one of the functions has been executed, this property returns the result code of this function. To get the description of this error, use the "LastErrorDescription" property instead.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) objGps.DeviceSerialPort = 1 objGps.Open ()

WScript.Echo "Opening GPS device, result = " & objGps.LastError & " ( " & objGps.LastErrorDescription & " )" ...

LastErrorDescription property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

When one of the functions has been executed, this property returns the result code of this function. The result is displayed in textual format. To get the number of this error, use the "LastError" property instead.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) objGps.DeviceSerialPort = 1 objGps.Open ()

WScript.Echo "Opening GPS device, result = " & objGps.LastError & " ( " & objGps.LastErrorDescription & " )" ...

LogFile property

Type:

String

In/Out:

In/Out

Optional:

Yes

Description:

Use this property to specify the file where all operations should be logged to perform troubleshooting. This is also the file where NMEA data is logged, in case the "LogNmeaData" property is set to TRUE.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) objGps.LogFile = "C:\GpsLog.txt" objGps.LogGpsData = True objGps.DeviceSerialPort = 1 objGps.Open ()

DeviceSerialPort property

Type:

Number

In/Out:

In/Out

Optional:

No

Description:

In order to read NMEA data from a serial port, you have to specify the serial port to use. Just set this property to the serial port the GPS device is connected to, for instance if you are using COM4, set the value of this property to "4". When using a Garmin GPS connected using USB, set this property to zero to specify to use Garmin's USB driver instead of a serial port. When using this driver, the Garmin PVT protocol is used.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) objGps.DeviceSerialPort = 4 objGps.Open ()

DeviceBaudrate property

Type:

Number

In/Out:

In/Out

Optional:

Yes

Description:

By default, a baudrate of 4800 bps is used on the serial port, because this speed is defined in the NMEA0183 standard. If your GPS device uses another baudrate, you can set it using this property. All standard baudrate values are supported ( 300 bps .. 115200 bps). This property is ignored when the Garmin USB GPS driver is used.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) objGps.DeviceSerialPort = 1 objGps.DeviceBaudrate = 9600 objGps.Open () ...

DeviceDataFormat property

Type:

Number

In/Out:

In/Out

Optional:

Yes

Description:

By default, the n81 dataformat is used (8 databits, no parity and 1 stopbit). If your GPS device is using another dataformat, you can set it using this property. Possible values are defined using the "DeviceFormat Constants". This property is ignored when the Garmin USB GPS driver is used.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) Set objCon = CreateObject ( "Eye4Software.GpsConstants" ) objGps.DeviceSerialPort = 1 objGps.DeviceBaudrate = 9600 objGps.DeviceDataFormat = objCon.GPS_DEVICE_FORMAT_7E1 objGps.Open () ...

DeviceTimeout property

Type:

Number

In/Out:

In/Out

Optional:

Yes

Description:

This property specifies the read timeout in milliseconds. The default value should work okay with most GPS devices, but in case you encounter incomplete received strings, increase this value.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) objGps.DeviceSerialPort = 1 objGps.DeviceTimeOut = 2000 objGps.Open () ...

TalkerID property

Type:

String

In/Out:

In/Out

Optional:

Yes

Description:

The talker ID of a NMEA0183 string is used to identify the device which sent the string. For instance, when a GLL string is sent by a GPS device, the string will start with "$GPGLL", if a latlon string is forwarded by an echosounder, the string will start with "$DPGLL". Another example, when a VTG is calculated by the GPS, it is received as "$GPVTG", if it is determined by a compass, it is received as "$HCVTG". You can use this property to specify from which devices you want to decode data. If you only want to decode from GPS devices, just set this property to "GP". By default sentences with all talker ID's are decoded. Please find a list with possible Talker Identifiers below: This property is ignored when the Garmin USB GPS driver is used. The protocol used in this case is Garmin PVT which does not use talker Id's

Talker ID Description

AG Autopilot - General AP Autopilot - Magnetic CD Communications - DSC CR Communications - Receiver CS Communications - Satellite CT Communications - Radio-Telephone (MF/HF) CV Communications - Radio-Telephone (VHF) CX Communications - Scanning Receiver DF Direction Finder EC ECDIS EP EPIRB ER Engine Room Monitoring Systems GP Global Positioning System (GPS) HC Heading - Magnetic Compass HE Heading - North Seeking Gyro HN Heading - Non North Seeking Gyro II Integrated Instrumentation IN Integrated Navigation LC Loran C RA RADAR / ARPA SD Sounder - Depth SN Electronic Positioning System SS Sounder - Scanning (SONAR) TI Turn Rate Indicator VD Velocity Sensor - Doppler DM Velocity Sensor - Magnetic VW Velocity Sensor - Mechanical WI Weather Instruments YX Transducer ZA Timekeeper - Atomic Clock ZC Timekeeper - Chronometer ZQ Timekeeper - Quartz ZV Timekeeper - Radio Update, WWV or WWVH

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) Set objCon = CreateObject ( "Eye4Software.GpsConstants" ) objGps.DeviceSerialPort = 1 objGps.TalkerID = "GP;II" objGps.Open () ...

Filter property

Type:

Number

In/Out:

In/Out

Optional:

Yes

Description:

You can use the "Filter" property to tell the toolkit which sentences has to be decoded. By default all NMEA sentences are decoded, but if you want to force to decode some values from a specific string you can use this property (for instance when the GGA sentence is more precise then the GLL sentence).

The sentences to decode are specified by using the "NmeaFilter Constants" as demonstrated in the code sample below.

This property is ignored when the Garmin USB GPS driver is used. The protocol used in this case is Garmin PVT which does not use NMEA sentences.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) Set objCon = CreateObject ( "Eye4Software.GpsConstants" ) objGps.DeviceSerialPort = 1 objGps.Filter = objCon.GPS_NMEA_FILTER_GGA Or objCon.GPS_NMEA_FILTER_VTG objGps.Open () ...

EnableChecksum property

Type:

Boolean

In/Out:

In/Out

Optional:

Yes

Description:

Some GPS devices support CRC checking in the NMEA strings they sent. You can check for such strings by looking for a "*" with a 2 digit hex number at the end of the string. The CRC string is used to check whether there are no errors in the received data. The GPS toolkit can calculate the checksum and check if the string is okay, if not the string is discarded. To turn on this functionality, set this property to TRUE. This property is ignored when the Garmin USB GPS driver is used. The protocol used in this case is Garmin PVT which has CRC checking built-in

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) objGps.DeviceSerialPort = 1 objGps.EnableChecksum = TRUE objGps.Open () ...

UnitsSpeed property

Type:

Number

In/Out:

In/Out

Optional:

Yes

Description:

Use one of the "SpeedUnits Constants" to specify the units used for speeds. The default is: Knots.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) Set objCon = CreateObject ( "Eye4Software.GpsConstants" ) objGps.DeviceSerialPort = 1 objGps.UnitsSpeed = objCon.GPS_SPEED_METERSPERSECOND objGps.Open () ...

UnitsAltitude property

Type:

Number

In/Out:

In/Out

Optional:

Yes

Description:

Use one of the "AltitudeUnits Constants" to specify the units used for altitudes. The default is: Meters.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) Set objCon = CreateObject ( "Eye4Software.GpsConstants" ) objGps.DeviceSerialPort = 1 objGps.UnitsAltitude = objCon.GPS_ALTITUDE_FEET objGps.Open () ...

LatLonStringFormat property

Type:

Number

In/Out:

In/Out

Optional:

Yes

Description:

You can use this property to specify the format used in the "gpsLatitudeString" and "gpsLongitudeString property. You can set this property using one of the "LatLonFormat Constants".

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) Set objCon = CreateObject ( "Eye4Software.GpsConstants" ) objGps.DeviceSerialPort = 1 objGps.LatLonStringFormat = objCon.GPS_ALTITUDE_FEET objGps.Open () ...

LogGpsData property

Type:

Boolean

In/Out:

In/Out

Optional:

Yes

Description:

When this property is set to TRUE, all received NMEA0183 data will be appended to the specified logfile. See the "LogFile" property for more information on logfiles.

In case the Garmin USB driver is used to receive GPS data, a HEX dump of all received PVT data will be appended to the specified logfile.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) objGps.LogFile = "C:\GpsLog.txt" objGps.LogGpsData = True objGps.DeviceSerialPort = 1 objGps.Open () ...

gpsLatitude property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the current latitude. The latitude is returned as a floating point value which can be used in calculations.

If you need the Latitude formatted as a string, please have a look at the "gpsLatitudeString" property.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.Open () ... Wscript.Echo "Longitude : " & objGps.gpsLongitude WScript.Echo "Latitude : " & objGps.gpsLatitude

gpsLongitude property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the current longitude. The longitude is returned as a floating point value which can be used in calculations. If you need the Latitude formatted as a string, please have a look at the "gpsLongitudeString" property.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.Open () ... Wscript.Echo "Longitude : " & objGps.gpsLongitude WScript.Echo "Latitude : " & objGps.gpsLatitude

gpsAltitude property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the current altitude. The altitude is returned as a floating point value in meters or feet, depending on the setting of the "UnitsAltitude" property.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.UnitsSpeed = objCon.GPS_ALTITUDE_FEET ... objGps.Open () ... Wscript.Echo "Altitude : " & objGps.gpsAltitude & " Feet"

gpsSpeed property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the current speed over ground. The altitude is returned as a floating point value in knots, meters per second, miles per hour, kilometers per hour, depending on the setting of the "UnitsSpeed" property.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.UnitsSpeed = objCon.GPS_SPEED_KNOTS ... objGps.Open () ... WScript.Echo "Speed : " & objGps.gpsSpeed & " Knots"

gpsCourse property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the current course over ground. The altitude is returned as a floating point value in degrees.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.Open () ... WScript.Echo "Course : " & objGps.gpsCourse & " Degrees"

gpsMagneticVariation property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the magnetic variation. This value is returned as a floating point value in degrees.

The GPS receiver has to send the $GPRMC sentence in order to retrieve this value.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.Open () ... If ( objGps.gpsMagneticVariation > 0 ) Then Wscript.Echo "Magnetic Variation : " & objGps.gpsMagneticVariation & " Degrees East" Else Wscript.Echo "Magnetic Variation : " & objGps.gpsMagneticVariation & " Degrees West" End If

gpsTime property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the current atomic GPS time from the GPS device. Time is presented in seconds since the epoch ( 1/1/1970 00:00 ). If you want the formatted time, use the "gpsTimeString" property instead.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.Open () ... Wscript.Echo "Time : " & objGps.gpsTime & " Seconds since epoch"

gpsQuality property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

This property indicates the type of fix ( or no fix ) of the GPS device. Possible values are:

Value Description

0 No Fix 1 GPS fix 2 DGPS fix (Differential GPS) 3 PPS fix 4 RTK fix (Real Time Kinematic) 5 Float RTK 6 Dead Reckoning (estimated) 7 Manual input mode 8 Simulation mode

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.Open () ... WScript.Echo "GPS Quality: "& objGps.gpsQuality

gpsSatellites property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the number of satellites used for the current fix.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.Open () ... WScript.Echo "GPS Satellites Used: "& objGps.gpsSatellites

gpsDifferentialID property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the ID of the DGPS base station used when DGPS or RTK is used.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.Open () ... WScript.Echo "GPS Beacon ID: "& objGps.gpsDifferentialID

gpsDifferentialAge property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the age of the DGPS data currently used for fix. When this data is getting older, and now new information is received, the position will become more inaccurate.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.Open () ... WScript.Echo "DGPS Beacon Data Age: "& objGps.gpsDifferentialAge

gpsPDOP property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the PDOP (Position Dilution Of Position) from the GPS device.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.DeviceSerialPort = 1 objGps.Open () ... WScript.Echo "PDOP: " & objGps.gpsPDOP WScript.Echo "VDOP: " & objGps.gpsVDOP WScript.Echo "HDOP: " & objGps.gpsHDOP gpsHDOP property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the HDOP (Horizontal Dilution Of Position) from the GPS device.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.DeviceSerialPort = 1 objGps.Open () ... WScript.Echo "PDOP: " & objGps.gpsPDOP WScript.Echo "VDOP: " & objGps.gpsVDOP WScript.Echo "HDOP: " & objGps.gpsHDOP

gpsVDOP property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the VDOP (Vertical Dilution Of Position) from the GPS device.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.DeviceSerialPort = 1 objGps.Open () ... WScript.Echo "PDOP: " & objGps.gpsPDOP WScript.Echo "VDOP: " & objGps.gpsVDOP WScript.Echo "HDOP: " & objGps.gpsHDOP

gpsEOPE property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the estimated overall position error from the GPS device. This error is always returned in meters. This property only contains a value when using a Garmin GPS device or any other device which supports Garmin's $PGRME NMEA sentence.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.DeviceSerialPort = 1 objGps.Open () ... WScript.Echo "Estimated Overall Position Error : " & objGps.gpsEOPE WScript.Echo "Estimated Vertical Position Error : " & objGps.gpsEVPE WScript.Echo "Estimated Horizontal Position Error : " & objGps.gpsEHPE

gpsEHPE property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the estimated horizontal position error from the GPS device. This error is always returned in meters. This property only contains a value when using a Garmin GPS device or any other device which supports Garmin's $PGRME NMEA sentence.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.DeviceSerialPort = 1 objGps.Open () ... WScript.Echo "Estimated Overall Position Error : " & objGps.gpsEOPE WScript.Echo "Estimated Vertical Position Error : " & objGps.gpsEVPE WScript.Echo "Estimated Horizontal Position Error : " & objGps.gpsEHPE

gpsEVPE property

Type:

Float

In/Out:

Out

Optional:

Yes

Description:

Use this property to retrieve the estimated vertical position error from the GPS device. This error is always returned in meters. This property only contains a value when using a Garmin GPS device or any other device which supports Garmin's $PGRME NMEA sentence.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.DeviceSerialPort = 1 objGps.Open () ... WScript.Echo "Estimated Overall Position Error : " & objGps.gpsEOPE WScript.Echo "Estimated Vertical Position Error : " & objGps.gpsEVPE WScript.Echo "Estimated Horizontal Position Error : " & objGps.gpsEHPE

Gps Object Functions

Clear Function

Return Value:

Always 0. Use the "LastError" or "LastErrorDescription" properties to get the result of the operation.

Parameters:

None

Optional:

Yes

Description:

Use this function to reset all the object's properties to its default values.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.DeviceBaudrate = 115200 objGps.Clear () ... WScript.Echo objGps.DeviceBaudrate 'Should return 4800

Open Function

Return Value:

Always 0 or S_OK. Use the "LastError" or "LastErrorDescription" properties to get the result of the operation.

Parameters:

None

Optional:

No

Description:

When the Open function is called, the toolkit will attempt to open the serial port, and start reading and decoding NMEA0183 data from the GPS device. You can stop decoding and close the serial port using the "Close" function. To communicate directly to the Garmin USB driver, set this property to zero.

Code Sample (Serial):

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.DeviceSerialPort = 1 objGps.DeviceBaudrate = 4800 ... objGps.Open () ...

Code Sample (Garmin USB):

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.DeviceSerialPort = 0 ... objGps.Open () ...

Close Function

Return Value:

Always 0 (S_OK). Use the "LastError" or "LastErrorDescription" properties to get the result of the operation.

Parameters:

None

Optional:

Yes

Description:

If started, the Close function will stop the toolkit reading and decoding NMEA0183 or PVT data, and close the serial port or communications to the Garmin driver. To start reading and decoding data again, use the "Open" function.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) ... objGps.DeviceBaudrate = 115200 objGps.Clear () ... WScript.Echo objGps.DeviceBaudrate 'Should return 4800

GetFirstSatellite Function

Return Value:

Always 0. Use the "LastError" or "LastErrorDescription" properties to get the result of the operation.

Parameters:

None

Optional:

Yes

Description:

Use this function to get information about the GPS satellites used for fix calculation. This function returns the first object in the enumeration. After calling GetFirstSatellite, you have to use "GetNextSatellite" while the "LastError" property is equal to zero.

Code Sample:

... Set objSat = objGps.GetFirstSatellite ()

While ( objGps.LastError = 0 )

WScript.Echo "Info for satellite #" & objSat.ID WScript.Echo " Azimuth : " & objSat.Azimuth WScript.Echo " Elevation : " & objSat.Elevation WScript.Echo " Signal : " & objSat.SignalNoiseRatio WScript.Echo " Used : " & objSat.UsedForFix

Set objSat = objGps.GetNextSatellite () WEnd

GetNextSatellite Function

Return Value:

Always 0. Use the "LastError" or "LastErrorDescription" properties to get the result of the operation.

Parameters:

None

Optional:

Yes

Description:

Use this function after the call to "GetFirstSatellite" to get information about the other GPS satellites used for fix calculation. You have to call "GetNextSatellite" while the "LastError" property is equal to zero..

Code Sample:

... Set objSat = objGps.GetFirstSatellite ()

While ( objGps.LastError = 0 )

WScript.Echo "Info for satellite #" & objSat.ID WScript.Echo " Azimuth : " & objSat.Azimuth WScript.Echo " Elevation : " & objSat.Elevation WScript.Echo " Signal : " & objSat.SignalNoiseRatio WScript.Echo " Used : " & objSat.UsedForFix

Set objSat = objGps.GetNextSatellite () WEnd

Parse Function

Return Value:

Always 0. Use the "LastError" or "LastErrorDescription" property to get the result of the operation.

Parameters:

A string containing a line of NMEA0183 data

Optional:

Yes

Description:

Use this function to parse a single line of NMEA 0183 data. This is usefull when you wish to decode GPS data retrieved from something other then a GPS device, for instance, when data is retrieved from a file or network connection. When the Parse function completes, it will set the same properties as when using a GPS device.

Code Sample:

Set objGps = CreateObject ( "Eye4Software.Gps" ) objGps.Parse "$GPGGA,123244,5209.6851,N,00643.0712,E,1,09,1.0,32.3,M,46.7,M,,*7E"

WScript.Echo ( "Latitude = " & objGps.gpsLatitudeString ) WScript.Echo ( "Longitude = " & objGps.gpsLongitudeString ) WScript.Echo ( "Altitude = " & objGps.gpsAltitude )

6. The 'GpsDatumParameters' object

The GpsDatumParameters object is used to store all parameters of a specific map datum. This map datum is used to pass to a GpsGridParamaters object when a transormation from one grid to another is performed, or to pass to the TransformDatum function of the GpsProjection project, when performing a tranformation between one map datum and another.

After creation, the GpsDatumParameters object holds both ellipsoid and the Helmert-7 parameters used to transform to WGS84.

Using the LoadFromId function, you can load one of the 500 predefined map datums available in the toolkit.

GpsDatumParameters Object Properties

Id property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

The EPSG code for this map datum. Use this code to load a datum using the LoadFromId function.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.GetFirstDatum

While ( objDatum.LastError = 0 ) WScript.Echo "Datum: " & objDatum.Name & " (EPSG:" & objDatum.Id & ")" objDatum.GetNextDatum WEnd

Name property

Type:

String

In/Out:

Out

Optional:

Yes

Description:

The name of this map datum. This name is only set when the datum is a build-in datum of the toolkit.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.GetFirstDatum

While ( objDatum.LastError = 0 ) WScript.Echo "Datum: " & objDatum.Name & " (EPSG:" & objDatum.Id & ")" objDatum.GetNextDatum WEnd

Axis property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The semi-major axis of the ellipsoid defined for this datum.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Axis = 6378137.000 objDatum.Flattening = 298.257223563

Flattening property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The flattening of the ellipsoid defined for this map datum.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Axis = 6378137.000 objDatum.Flattening = 298.257223563

TranslationX property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The X translation in meters used to convert from this map datum to WGS84. The GPS toolkit uses the Helmert-7 parameters.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Axis = 6378137.000 objDatum.Flattening = 298.257223563 objDatum.TranslationX = -56.263 objDatum.TranslationY = 16.136 objDatum.TranslationZ = -22.856

TranslationY property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The Y translation in meters used to convert from this map datum to WGS84. The GPS toolkit uses the Helmert-7 parameters.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Axis = 6378137.000 objDatum.Flattening = 298.257223563 objDatum.TranslationX = -56.263 objDatum.TranslationY = 16.136 objDatum.TranslationZ = -22.856

TranslationZ property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The Z translation in meters used to convert from this map datum to WGS84. The GPS toolkit uses the Helmert-7 parameters.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Axis = 6378137.000 objDatum.Flattening = 298.257223563 objDatum.TranslationX = -56.263 objDatum.TranslationY = 16.136 objDatum.TranslationZ = -22.856 RotationX property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The X rotation in arc seconds used to convert from this map datum to WGS84. The GPS toolkit uses Helmert-7 parameters.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Axis = 6377340.189 objDatum.Flattening = 299.324965463529 objDatum.TranslationX = 446.448 objDatum.TranslationY = -125.157 objDatum.TranslationZ = 542.060 objDatum.RotationX = 0.150 objDatum.RotationY = 0.247 objDatum.RotationZ = 0.842 objDatum.ScaleFactor = -20.4894

RotationY property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The Y rotation in arc seconds used to convert from this map datum to WGS84. The GPS toolkit uses Helmert-7 parameters.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Axis = 6377340.189 objDatum.Flattening = 299.324965463529 objDatum.TranslationX = 446.448 objDatum.TranslationY = -125.157 objDatum.TranslationZ = 542.060 objDatum.RotationX = 0.150 objDatum.RotationY = 0.247 objDatum.RotationZ = 0.842 objDatum.ScaleFactor = -20.4894

RotationZ property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The Z rotation in arc seconds used to convert from this map datum to WGS84. The GPS toolkit uses Helmert-7 parameters.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Axis = 6377340.189 objDatum.Flattening = 299.324965463529 objDatum.TranslationX = 446.448 objDatum.TranslationY = -125.157 objDatum.TranslationZ = 542.060 objDatum.RotationX = 0.150 objDatum.RotationY = 0.247 objDatum.RotationZ = 0.842 objDatum.ScaleFactor = -20.4894

ScaleFactor property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The scalefactor in ppm used to convert from this map datum to WGS84. The GPS toolkit uses the Helmert-7 parameters. The scalefactor has to be set in ppm, for instance: if the scalefactor is specified as 4.0773e-06, you have to enter 4.0773.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Axis = 6377340.189 objDatum.Flattening = 299.324965463529 objDatum.TranslationX = 446.448 objDatum.TranslationY = -125.157 objDatum.TranslationZ = 542.060 objDatum.RotationX = 0.150 objDatum.RotationY = 0.247 objDatum.RotationZ = 0.842 objDatum.ScaleFactor = -20.4894

PrimeMeridian property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The longitude in degrees of the prime meridian used for this map datum. Most datums use Greenwich which is 0.0. If unsure, please do not alter.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Axis = 6377397.155 objDatum.Flattening = 299.1528128 objDatum.PrimeMeridian = -17.6666667 ' Ferro

GridType

Type:

Nunber

In/Out:

In/Out

Optional:

Yes

Description:

In case you want to use a grid shift file to perform datum transformations, set this parameter. By default this parameter is set to "0" which means that no grid shift will be loaded.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDstDatum.LoadFromId (4267) objDstDatum.GridType = objConstants.GPS_GRIDTYPE_NADCON objDstDatum.Grid = "C:\Program Files (x86)\Eye4Software\GpsToolkit\Nadcon\conus.los"

Grid property

Type:

String

In/Out:

In/Out

Optional:

Yes

Description:

Use this property to specify the grid shift file to use in datum conversions. You have to specify the full path to the file. When the GridType property is set to zero, this setting will be ignored.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDstDatum.LoadFromId (4267) objDstDatum.GridType = objConstants.GPS_GRIDTYPE_NADCON objDstDatum.Grid = "C:\Program Files (x86)\Eye4Software\GpsToolkit\Nadcon\conus.los"

GpsDatumParameter Object Functions

Clear Function

Return Value:

Always 0.

Parameters:

None

Optional:

Yes

Description:

Use this function to resets all the values of the GpsDatumParameters object to WGS84 datum parameters.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Clear objDatum.Axis = 6377340.189 objDatum.Flattening = 299.324965463529 objDatum.TranslationX = 446.448 objDatum.TranslationY = -125.157 objDatum.TranslationZ = 542.060 objDatum.RotationX = 0.150 objDatum.RotationY = 0.247 objDatum.RotationZ = 0.842 objDatum.ScaleFactor = -20.4894

LoadFromId Function

Return Value:

Always 0.

Parameters:

Map Datum ID

Optional:

Yes

Description:

Use this function to initialize the GpsDatumParameters with one of the 300 built in map datum available in the GPS toolkit. By using this function, you do not have to set all datum parameters manually.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" )

' Use NAD27 Datum objDatum.LoadFromId ( 4267 )

GetFirstDatum and GetNextDatum Functions

Return Value:

Always 0.

Parameters:

None

Optional:

Yes

Description:

Use these functions to enumerate all build in map datums of the GPS Toolkit. You first have to call GetFirstDatum. While the LastError property is zero, you can call GetNextDatum to load the next available datum. Use the objects properties to retrieve information about the loaded map datum.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.GetFirstDatum

While ( objDatum.LastError = 0 ) WScript.Echo "Datum Id : " & objDatum.Id WScript.Echo "Datum Name : " & objDatum.Name

...

objDatum.GetNextDatum WEnd

SaveToFile Function

Return Value:

Always 0.

Parameters:

FileName

Optional:

Yes

Description:

Using this function you can save all the values of the GpsDatumParameters object to a config file, so you can use the same data again through the LoadFromFile function.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.Clear objDatum.Axis = 6377340.189 objDatum.Flattening = 299.324965463529 objDatum.TranslationX = 446.448 objDatum.TranslationY = -125.157 objDatum.TranslationZ = 542.060 objDatum.RotationX = 0.150 objDatum.RotationY = 0.247 objDatum.RotationZ = 0.842 objDatum.ScaleFactor = -20.4894 objDatum.SaveToFile "C:\Datums\OSGB36.ini"

LoadFromFile Function

Return Value:

Always 0.

Parameters:

FileName

Optional:

Yes

Description:

Use this function to read all the values of the GpsDatumParameters object from a file.

Code Sample:

Dim objDatum

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) objDatum.LoadFromFile "C:\Datums\OSGB36.ini"

WScript.Echo objDatum.Axis WScript.Echo objDatum.Flattening

WScript.Echo objDatum.TranslationX WScript.Echo objDatum.TranslationY WScript.Echo objDatum.TranslationZ

WScript.Echo objDatum.RotationX WScript.Echo objDatum.RotationY WScript.Echo objDatum.RotationZ

WScript.Echo objDatum.ScaleFactor

7. The 'GpsGridParameters' object

The GpsGridParameters object is used to store all parameters of a specific map grid. This map grid object is used to pass to the TransformGrid function of the GpsProjection project, when performing a tranformation between one map grid and another.

The GpsGridParameters object holds projection specific parameters like the false easting and northing, parallels, scalefactor and latitude and or longitude of origin.

Using the LoadFromId function, you do not have to set all these parameters by yourself. This function initializes the object with one of the 3500 built in map grid definitions. The following table shows which parameters are used for the different projection types:

Projection SCALE FALSE_N FALSE_E LAT_0 LON_0 PAR_1 PAR_2 AZI RECTGRD Lambert Conformal x x x x x - - - - Conic 1 SP Lambert Conformal - x x x x x x - - Conic 2 SP Lambert Azimuthal - x x x x x x - - Equal Area Transverse x x x x x - - - - Mercator Oblique x x x x x - - - - Stereographic Polar - x x x x - - - - Stereographic Oblique - x x x x - - - - Mercator Hotine Oblique - x x x x - - x x Mercator Swiss Oblique - x x x x - - - - Mercator Albers Equal - x x x x x x - - Area Conic Mercator 1SP x x x x x - - - - Mercator 2SP - x x x x x - - - Mollweide - x x - x - - - - Eckert IV - x x - x - - - - Eckert VI - x x - x - - - - Cassini - x x x x - - - - Krovak x x x x x x - x -

GpsGridParameters Object Properties

Datum property

Type:

Object

In/Out:

In/Out

Optional:

No

Description:

The map datum associated with the grid you want to use. The datum is passed to this property as a GpsDatumParameters object.

Code Sample:

Dim objDatum, objGrid

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) objDatum.Axis = 6378388.0 objDatum.flattening = 297.0 objDatum.TranslationX = -87.0 objDatum.TranslationY = -98.0 objDatum.TranslationZ = -121.0 objGrid.Datum = objDatum

Projection property

Type:

Number

In/Out:

In/Out

Optional:

No

Description:

The projection you want to calculate the grid. Supported projections include: Lambert Conformal Conic 1SP, Lambert Conformal Conic 2SP, Lambert Azimuthal Equal Area, Transverse Mercator, Stereographic, Polar Stereographic, Albers Equal Area, Krovak and none (no grid at all, just latitude and longitude). The constants for these and more projections are defined in the GpsConstants object.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_STEREOGRAPHIC objGrid.ScaleFactor = 0.999908 objGrid.FalseNorthing = 463000.00 objGrid.FalseEasting = 155000.00 objGrid.OriginLatitude = 52.156161 objGrid.OriginLongitude = 5.387639

Units property

Type:

Number

In/Out:

In/Out

Optional:

Yes

Description:

Unit used to specify Northing and Easting values (and also False Easting and False Northing). The constants for these projections are defined in the GpsConstants object. By default, meters are used for Easting and Northing output.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_LAMBERT2SP objGrid.FalseNorthing = 5400088.438000 objGrid.FalseEasting = 150000.012560 objGrid.ParallelNorth = 49.833334 objGrid.ParallelSouth = 51.166667 objGrid.OriginLatitude = 90.0 objGrid.OriginLongitude = 4.367487 objGrid.Units = objConstants.GPS_PROJECTION_UNITS_FTCLA

ScaleFactor property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The scalefactor used to calculate the position within the grid. Note: the scalefactor has to be specified in ppm, for instance, when the scale factor is 4.0772e-06, you have to specify just 4.0772..

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_STEREOGRAPHIC objGrid.ScaleFactor = 0.999908 objGrid.FalseNorthing = 463000.00 objGrid.FalseEasting = 155000.00 objGrid.OriginLatitude = 52.156161 objGrid.OriginLongitude = 5.387639

False Northing property

Type:

Number

In/Out:

In/Out

Optional:

Yes

Description:

The false northing used to calculated the position within the grid. This parameter is also used to specify delta-Y. The FalseNorthing property can be used for any projection, except for the latitude / longitude grid.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_STEREOGRAPHIC objGrid.ScaleFactor = 0.999908 objGrid.FalseNorthing = 463000.00 objGrid.FalseEasting = 155000.00 objGrid.OriginLatitude = 52.156161 objGrid.OriginLongitude = 5.387639

FalseEasting property

Type:

Float

In/Out:

In/Out

Optional:

No

Description:

The false easting used to calculated the position within the grid. This parameter is also used to specify delta-X. The FalseEasting property can be used for any projection, except for the latitude / longitude grid.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_STEREOGRAPHIC objGrid.ScaleFactor = 0.999908 objGrid.FalseNorthing = 463000.00 objGrid.FalseEasting = 155000.00 objGrid.OriginLatitude = 52.156161 objGrid.OriginLongitude = 5.387639

OriginLatitude property

Type:

Number

In/Out:

In/Out

Optional:

No

Description:

The latitude of origin for this grid, in degrees. The OriginLatitude property can be used for any projection, except for the latitude / longitude grid.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_STEREOGRAPHIC objGrid.ScaleFactor = 0.999908 objGrid.FalseNorthing = 463000.00 objGrid.FalseEasting = 155000.00 objGrid.OriginLatitude = 52.156161 objGrid.OriginLongitude = 5.387639

OriginLongitude property

Type:

Float

In/Out:

In/Out

Optional:

No

Description:

The longitude of origin for this grid, in degrees. The OriginLongitude property can be used for any projection, except for the latitude / longitude grid.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_STEREOGRAPHIC objGrid.ScaleFactor = 0.999908 objGrid.FalseNorthing = 463000.00 objGrid.FalseEasting = 155000.00 objGrid.OriginLatitude = 52.156161 objGrid.OriginLongitude = 5.387639

ParallelNorth property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The 1st or north parallel latitude for this grid, in degrees. The ParallelNorth property can only be used for the Lambert projections.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_LAMBERT2SP objGrid.FalseNorthing = 5400088.438000 objGrid.FalseEasting = 150000.012560 objGrid.ParallelNorth = 49.833334 objGrid.ParallelSouth = 51.166667 objGrid.OriginLatitude = 90.0 objGrid.OriginLongitude = 4.367487

ParallelSouth property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The 2nd or south parallel latitude for this grid, in degrees. The ParallelSouth property can only be used for the Lambert projections.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_LAMBERT2SP objGrid.FalseNorthing = 5400088.438000 objGrid.FalseEasting = 150000.012560 objGrid.ParallelNorth = 49.833334 objGrid.ParallelSouth = 51.166667 objGrid.OriginLatitude = 90.0 objGrid.OriginLongitude = 4.367487

ParallelNorth property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The 1st or north parallel latitude for this grid, in degrees. The ParallelNorth property can only be used for the Lambert projections.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_LAMBERT2SP objGrid.FalseNorthing = 5400088.438000 objGrid.FalseEasting = 150000.012560 objGrid.ParallelNorth = 49.833334 objGrid.ParallelSouth = 51.166667 objGrid.OriginLatitude = 90.0 objGrid.OriginLongitude = 4.367487

ParallelSouth property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The 2nd or south parallel latitude for this grid, in degrees. The ParallelSouth property can only be used for the Lambert projections.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_LAMBERT2SP objGrid.FalseNorthing = 5400088.438000 objGrid.FalseEasting = 150000.012560 objGrid.ParallelNorth = 49.833334 objGrid.ParallelSouth = 51.166667 objGrid.OriginLatitude = 90.0 objGrid.OriginLongitude = 4.367487

AzimuthAngle property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The Azimuth angle of initial line, in degrees. The AzimuthAngle property can only be used for the Krovak and Oblique Mercator projections.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_OBLIQUEMERCATOR objGrid.FalseNorthing = -4354009.816 objGrid.FalseEasting = 2546731.496 objGrid.OriginLatitude = 45.30916666 objGrid.OriginLongitude = -86.00000000 objGrid.AzimuthAngle = 337.25556 objGrid.RectifiedGridAngle = 337.25556

RectifiedGridAngle property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The Angle from Rectified to Skew Grid, in degrees. The ParallelSouth property can only be used for the Oblique Mercator projections.

Code Sample:

Dim objGrid, objConstants

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_OBLIQUEMERCATOR objGrid.FalseNorthing = -4354009.816 objGrid.FalseEasting = 2546731.496 objGrid.OriginLatitude = 45.30916666 objGrid.OriginLongitude = -86.00000000 objGrid.AzimuthAngle = 337.25556 objGrid.RectifiedGridAngle = 337.25556

GpsGridParameters Object Functions

Clear Function

Return Value:

Always 0.

Parameters:

None

Optional:

Yes

Description:

Use this function to resets all the values of the GpsGridParameters object to WGS84 datum and geographic latitude/longitude grid.

Code Sample:

Dim objGrid

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) objGrid.Clear

GetFirstGrid and GetNextGrid Functions

Return Value:

Always 0.

Parameters:

None

Optional:

Yes

Description:

Use these functions to enumerate all build in map grids of the GPS Toolkit. You first have to call GetFirstGrid. While the LastError property is zero, you can call GetNextGrid to load the next available grid. Use the objects properties to retrieve information about the loaded map grid.

Code Sample:

Dim objGrid

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) objGrid.GetFirstGrid

While ( objGrid.LastError = 0 ) WScript.Echo "Grid Id : " & objGrid.Id WScript.Echo "Grid Name : " & objGrid.Name

...

objDatum.GetNextGrid WEnd

LoadFromId Function

Return Value:

Always 0.

Parameters:

Grid ID

Optional:

Yes

Description:

Use this function to initialize the GpsGridParameters with one of the 3500 built in map grids available in the GPS toolkit. By using this function, you do not have to set all datum and grid parameters manually.

Code Sample:

Option Explicit

Dim objProjection Dim objGridSrc Dim objGridDst

Set objProjection = CreateObject ( "Eye4Software.GpsProjection" ) Set objGridSrc = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objGridDst = CreateObject ( "Eye4Software.GpsGridParameters" )

WScript.Echo "Eye4Software GPS Toolkit " & objProjection.Version & " - Grid Conversion Demo" WScript.Echo

' Set Source Grid ( WGS84, Geographic Latitude and Longitude ) ' The ID for WGS84 is 4326, see 'http://www.eye4software.com/resources/datums' for a full list of supported datums ' To convert from another datum or grid, just change the code below (EPSG code) objGridSrc.LoadFromId ( 4326 )

' Set Destination Grid ( Dutch Grid ) ' The ID for the Dutch Grid is 28992, see 'http://www.eye4software.com/resources/grids' for a full list of supported grids ' To convert to another datum or grid, just change the code below (EPSG code) objGridDst.LoadFromId ( 28992 )

' Set Source coordinates ( WGS84) objProjection.Latitude = 52.110000 objProjection.Longitude = 5.290000

WScript.Echo "Convert from Latitude / Longitude to Dutch Grid (RDNAP)" WScript.Echo WScript.Echo "Latitude = " & objProjection.Latitude WScript.Echo "Longitude = " & objProjection.Longitude WScript.Echo

' Perform the transformation objProjection.TransformGrid objGridSrc, objGridDst

' Return the result WScript.Echo "Result: " & objProjection.LastError & " (" & objProjection.LastErrorDescription & ")" WScript.Echo If ( objProjection.LastError = 0 ) Then WScript.Echo "Northing = " & objProjection.Northing WScript.Echo "Easting = " & objProjection.Easting End If

LoadStatePlane Function

Return Value:

Always 0.

Parameters:

SPCS27 or SPCS83 ID

Optional:

Yes

Description:

Use this function to initialize the GpsGridParameters with one of the built in U.S. State Plane Coordinate Systems available in the GPS toolkit. By using this function, you do not have to set all datum and grid parameters manually.

Code Sample:

Option Explicit

Dim objProjection Dim objGridSrc Dim objGridDst

Set objProjection = CreateObject ( "Eye4Software.GpsProjection" ) Set objGridSrc = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objGridDst = CreateObject ( "Eye4Software.GpsGridParameters" )

WScript.Echo "Eye4Software GPS Toolkit " & objProjection.Version & " - StatePlane Conversion Demo" WScript.Echo

' Set Source Grid ( NAD83, Geographic Latitude and Longitude ) ' The ID for NAD83 is 4269, see 'http://www.eye4software.com/resources/datums' for a full list of supported datums ' To convert from another datum or grid, just change the code below (EPSG code) objGridSrc.LoadFromId ( 4269 )

' Set Destination Grid ( State Plane SPCS83 ) ' The ID for the Arizona Central is 0202, see 'http://www.eye4software.com/resources/stateplane' for a full list ' To convert to another datum or grid, just change the code below (SPC27 or SPC83 code) objGridDst.LoadStatePlane ( 202 )

' Set Source coordinates ( NAD83 ) objProjection.Latitude = 31.523864 objProjection.Longitude = -110.836469

WScript.Echo "Convert from Latitude / Longitude to State Plane (SPCS83) #0202" WScript.Echo WScript.Echo "Latitude = " & objProjection.Latitude WScript.Echo "Longitude = " & objProjection.Longitude WScript.Echo

' Perform the transformation objProjection.TransformGrid objGridSrc, objGridDst

' Return the result WScript.Echo "Result: " & objProjection.LastError & " (" & objProjection.LastErrorDescription & ")" WScript.Echo If ( objProjection.LastError = 0 ) Then WScript.Echo "Northing = " & objProjection.Northing WScript.Echo "Easting = " & objProjection.Easting End If

SaveToFile Function

Return Value:

Always 0.

Parameters:

FileName

Optional:

Yes

Description:

Using this function you can save all the values of the GpsGridParameters object (including map datum) to a config file, so you can use the same data again through the LoadFromDisk function.

Code Sample:

Dim objGrid

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) objGrid.Projection = objConstants.GPS_PROJECTION_OBLIQUEMERCATOR objGrid.FalseNorthing = -4354009.816 objGrid.FalseEasting = 2546731.496 objGrid.OriginLatitude = 45.30916666 objGrid.OriginLongitude = -86.00000000 objGrid.AzimuthAngle = 337.25556 objGrid.RectifiedGridAngle = 337.25556 objGrid.SaveToFile "C:\Datums\Michigan.ini"

LoadFromFile Function

Return Value:

Always 0.

Parameters:

FileName

Optional:

Yes

Description:

Use this function to read all the values of the GpsGridParameters (including map datum) object from a file.

Code Sample:

Dim objGrid

Set objGrid = CreateObject ( "Eye4Software.GpsGridParameters" ) objDatum.LoadFromDisk "C:\Datums\om.ini"

8. The 'GpsProjection' object

The GpsProjection object is used to convert coordinates from one map grid to another, or to perform datum transformations between different map datums. To perform coordinate transformations between different grids, you also need to declare and create two GpsDatumParameters and two GpsGridParameter objects, one for the source grid, and one for the destination grid. If you only want to do a datum transformation on a single latitude / longitude position, only two GpsDatumParameter objects are needed. To perform grid transformations, use the TransformGrid function, for datum transformations use the TransformDatum function.

GpsProjection Object Properties

Version property

Type:

String

In/Out:

Out

Optional:

Yes

Description:

The version property can be used to print the version number of the GPS toolkit version currently used.

Code Sample:

Set objPrj = CreateObject ( "Eye4Software.GpsProjection" )

WScript.Echo objPrj.Version

RegistrationCode property

Type:

String

In/Out:

In

Optional:

Yes

Description:

Use this property to activate the software. Once you purchased the software, you will receive a license code. Assign this code to this property to be able to use the software after the evaluation has been expired.

Code Sample:

Set objPrj = CreateObject ( "Eye4Software.GpsProjection" ) objPrj.RegistrationCode = "XXXXXXXXXXXXXXXXXXXXXXXXXXX"

Registered property

Type:

String

In/Out:

Out

Optional:

Yes

Description:

This string returns license information, for instance if the software has been registered or how many days there are left for evaluation

Code Sample:

Set objPrj = CreateObject ( "Eye4Software.GpsProjection" )

If ( objPrj.Registered = True ) Then Wscript.Echo "Registration OK" Else WScript.Echo "Invalid license key, or trial has been expired" End If

LastError property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

When one of the functions has been executed, this property returns the result code of this function. To get the description of this error, use the "LastErrorDescription" property instead.

Code Sample:

Set objProj = CreateObject ( "Eye4Software.GpsProjection" ) Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" )

... objProj.TransformDatum objDatumSrc, objDatumDst

WScript.Echo "Transform datum, result = " & objProj.LastError & " ( " & objProj.LastErrorDescription & " )" ...

LastErrorDescription property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

When one of the functions has been executed, this property returns the result code of this function. The result is displayed in textual format. To get the number of this error, use the "LastError" property instead.

Code Sample:

Set objProj = CreateObject ( "Eye4Software.GpsProjection" ) Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" )

... objProj.TransformDatum objDatumSrc, objDatumDst

WScript.Echo "Transform datum, result = " & objProj.LastError & " ( " & objProj.LastErrorDescription & " )" ...

LogFile property

Type:

String

In/Out:

In/Out

Optional:

Yes

Description:

Use this property to specify the file where all operations should be logged to perform troubleshooting.

Code Sample:

Set objProj = CreateObject ( "Eye4Software.GpsProjection" ) Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" )

... objProj.LogFile = "C:\LogFile.txt" objProj.TransformDatum objDatumSrc, objDatumDst

WScript.Echo "Transform datum, result = " & objProj.LastError & " ( " & objProj.LastErrorDescription & " )" ...

Latitude

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The source and / or destination latitude used when performing transformation. Depending on the projectiontype that is used, you have to set either the Latitude or Northing property. When performing a datum translation, only the Latitude and Longitude properties can be used.

Code Sample:

Set objProj = CreateObject ( "Eye4Software.GpsProjection" ) Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" )

... objProj.Latitude = 51.9 objproj.Longitude = 4.4 objProj.TransformDatum objDatumSrc, objDatumDst

WScript.Echo "Latitude after datum transformation: " & objProj.Latitude WScript.Echo "Longitude after datum transformation: " & objProj.Longitude

Longitude property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The source and / or destination longitude used when performing transformation. Depending on the projectiontype that is used, you have to set either the Longitude or Easting property. When performing a datum translation, only the Latitude and Longitude properties can be used.

Code Sample:

Set objProj = CreateObject ( "Eye4Software.GpsProjection" ) Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objGridSrc = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objGridDst = CreateObject ( "Eye4Software.GpsGridParameters" )

... objProj.Northing = 200000 objproj.Easting = 400000 objProj.TransformGrid objDatumSrc, objDatumDst

WScript.Echo "Latitude after datum transformation: " & objProj.Latitude WScript.Echo "Longitude after datum transformation: " & objProj.Longitude

Altitude property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The source and destination altitude used when performing 3D datum / grid transformations. When performing a datum transformation, the datum transformation is also applied to this altitude. When a map grid is used, the in and output is in the unit specified in the grid, otherwise meters are used.

Code Sample:

Set objProjection = CreateObject ( "Eye4Software.GpsProjection" ) Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" ) objProjection.Latitude = 33.59638 objProjection.Longitude = -112.15133 objProjection.Altitude = 0.00000 objDatumSrc.LoadFromId ( 4326 ) ' From WGS84 objDatumDst.LoadFromId ( 4267 ) ' To NAD27 objProjection.TransformDatum objDatumSrc, objDatumDst

WScript.Echo "Latitude after datum transformation: " & objProjection.Latitude WScript.Echo "Longitude after datum transformation: " & objProjection.Longitude WScript.Echo "Altitude after datum transformation: " & objProjection.Altitude

Northing property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The source and / or destination northing (or Y) used when performing transformation. Depending on the projectiontype that is used, you have to set either the Latitude or Northing property. When performing a datum translation, only the Latitude and Longitude properties can be used.

Code Sample:

Set objProj = CreateObject ( "Eye4Software.GpsProjection" ) Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objGridSrc = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objGridDst = CreateObject ( "Eye4Software.GpsGridParameters" )

... objProj.Northing = 200000 objproj.Easting = 400000 objProj.TransformGrid objDatumSrc, objDatumDst

WScript.Echo "Latitude after datum transformation: " & objProc.Latitude WScript.Echo "Longitude after datum transformation: " & objProc.Longitude

Easting property

Type:

Float

In/Out:

In/Out

Optional:

Yes

Description:

The source and / or destination easting (or X) used when performing transformation. Depending on the projectiontype that is used, you have to set either the Longitude or Easting property. When performing a datum translation, only the Latitude and Longitude properties can be used.

Code Sample:

Set objProj = CreateObject ( "Eye4Software.GpsProjection" ) Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objGridSrc = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objGridDst = CreateObject ( "Eye4Software.GpsGridParameters" )

... objProj.Northing = 200000 objproj.Easting = 400000 objProj.TransformGrid objDatumSrc, objDatumDst

WScript.Echo "Northing after grid transformation: " & objProc.Northing WScript.Echo "Easting after grid transformation: " & objProc.Easting

Zone property

Type:

Number

In/Out:

In/Out

Optional:

Yes

Description:

This property is used by both the FromUTM and ToUTM functions. With the ToUTM function you can set it to override the zone autodetection, when it is set to zero before calling ToUTM, it contains the detected zone when this function has been completed successfully. The FromUTM function does not support autodetection of the zone, because it is only possible when the latitude and longitude coordinates are known. In this case it is required to set this parameter. Code Sample:

Option Explicit

Dim objDatum, objProjection

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objProjection = CreateObject ( "Eye4Software.GpsProjection" )

' Set Datum NAD27 (EPSG ID 4267) objDatum.LoadFromId ( 4267 )

' Set Source coordinates objProjection.Latitude = 51.900000 objProjection.Longitude = 4.400000 objProjection.Zone = 0 'Use Autodetect

' Perform the transformation objProjection.ToUtm objDatum

' Return the result WScript.Echo "Convert from Latitude / Longitude to UTM NAD 27" WScript.Echo WScript.Echo "Result: " & objProjection.LastError & " (" & objProjection.LastErrorDescription & ")" WScript.Echo If ( objProjection.LastError = 0 ) Then WScript.Echo "Latitude = " & objProjection.Latitude WScript.Echo "Longitude = " & objProjection.Longitude WScript.Echo WScript.Echo "Northing = " & objProjection.Northing WScript.Echo "Easting = " & objProjection.Easting WScript.Echo "Zone = " & objProjection.Zone End If

WScript.Echo "Ready."

GpsProjection Object Functions

Clear Function

Return Value:

Always 0.

Parameters:

None

Optional:

Yes

Description:

Use this function to clear all the values of the GpsProjection object.

Code Sample:

Set objProj = CreateObject ( "Eye4Software.GpsProjection" )

'Clear Latitude, Longitude, Easting and Northing properties objProj.Clear

TransformDatum Function

Return Value:

Always 0.

Parameters: a GpsDatumParameters object containing the source datum parameters. a GpsDatumParameters object containing the destination datum parameters.

Optional:

Yes

Description:

Use this function to perform a geodetic datum transformation on the specified Latitude and Longitude. The source and destination datum are specified by using GpsDatumParameters objects.

Code Sample:

Option Explicit

Dim objDatumSrc, objDatumDst, objProjection

Set objProjection = CreateObject ( "Eye4Software.GpsProjection" ) Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" )

' Set Source Datum: WGS84 onjDatumSrc.Clear objDatumSrc.Axis = 6378137.000 objDatumSrc.Flattening = 298.257223563

' Set Destination Datum: OSGB36 objDatumDst.Axis = 6377340.189 objDatumDst.Flattening = 299.32496546352854 objDatumDst.TranslationX = 446.448 objDatumDst.TranslationY = -125.157 objDatumDst.TranslationZ = 542.060 objDatumDst.RotationX = 0.150 objDatumDst.RotationY = 0.247 objDatumDst.RotationZ = 0.842 objDatumDst.ScaleFactor = -20.4894

' Set Source coordinates objProjection.Latitude = 51.900000 objProjection.Longitude = 4.400000

WScript.Echo "Convert from WGS84 to OSGB36" WScript.Echo WScript.Echo "Latitude = " & objProjection.Latitude WScript.Echo "Longitude = " & objProjection.Longitude WScript.Echo

' Perform the transformation objProjection.TransformDatum objDatumSrc, objDatumDst

' Return the result WScript.Echo "Result: " & objProjection.LastError & " (" & objProjection.LastErrorDescription & ")" WScript.Echo If ( objProjection.LastError = 0 ) Then WScript.Echo "Latitude = " & objProjection.Latitude WScript.Echo "Longitude = " & objProjection.Longitude End If

WScript.Echo "Ready."

TransformGrid Function

Return Value:

Always 0.

Parameters: a GpsGridParameters object containing the source map grid parameters. a GpsGridParameters object containing the destination map grid parameters.

Optional:

Yes

Description:

Use this function to perform a map grid conversion. You can convert coordinates from Latitude / Longitude to a map grid, backwards and from one grid to another. Various map projections can be used like: Transverse Mercator, Oblique Mercator, Mercator, Lambert Conformal Conic, Oblique Stereographic, Polar Stereographic, Albers Equal Area Conic and others. The source and destination grid are specified by using GpsGridParameters objects.

Code Sample (Lambert Conformal Conic Projection):

Option Explicit

Dim objDatumSrc, objDatumDst, objGridSrc, objGridDst, objProjection, objConstants

Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objGridSrc = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objGridDst = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objProjection = CreateObject ( "Eye4Software.GpsProjection" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" )

' Set Source Datum: WGS84 objDatumSrc.Axis = 6378137.000 objDatumSrc.Flattening = 298.257223563

' Set Source GridL: Latitude/Longitude objGridSrc.Projection = objConstants.GPS_PROJECTION_NONE objGridSrc.Datum = objDatumSrc

' Set Destination Datum: Belgium 1972 objDatumDst.Axis = 6378388.000 objDatumDst.Flattening = 297.000 objDatumDst.TranslationX = -99.059 objDatumDst.TranslationY = 53.322 objDatumDst.TranslationZ = -112.486 objDatumDst.RotationX = 0.419 objDatumDst.RotationY = -0.830 objDatumDst.RotationZ = 1.885 objDatumDst.ScaleFactor = -1.000

' Set destination grid: Belgium Lambert 72 objGridDst.Projection = objConstants.GPS_PROJECTION_LAMBERT2SP objGridDst.Datum = objDatumDst objGridDst.FalseNorthing = 5400088.438000 objGridDst.FalseEasting = 150000.012560 objGridDst.OriginLatitude = 90.0 objGridDst.OriginLongitude = 4.367487 objGridDst.ParallelNorth = 49.833334 objGridDst.ParallelSouth = 51.166667 objGridDst.ScaleFactor = 0.0000

' Set Source coordinates objProjection.Latitude = 51.900000 objProjection.Longitude = 4.400000

' Perform the transformation objProjection.TransformGrid objGridSrc, objGridDst

' Return the result WScript.Echo "Convert from Latitude / Longitude to Lambert-72 using Lambert projection" WScript.Echo WScript.Echo "Result: " & objProjection.LastError & " (" & objProjection.LastErrorDescription & ")" WScript.Echo If ( objProjection.LastError = 0 ) Then WScript.Echo "Latitude = " & objProjection.Latitude WScript.Echo "Longitude = " & objProjection.Longitude WScript.Echo WScript.Echo "Northing = " & objProjection.Northing WScript.Echo "Easting = " & objProjection.Easting End If

WScript.Echo "Ready."

Code Sample (Transverse Mercator):

Option Explicit

Dim objDatumSrc, objDatumDst, objGridSrc, objGridDst, objProjection, objConstants

Set objDatumSrc = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objDatumDst = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objGridSrc = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objGridDst = CreateObject ( "Eye4Software.GpsGridParameters" ) Set objProjection = CreateObject ( "Eye4Software.GpsProjection" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" )

' Set Source Datum: WGS84 objDatumSrc.Axis = 6378137.000 objDatumSrc.Flattening = 298.257223563

' Set Source GridL: Latitude/Longitude objGridSrc.Projection = objConstants.GPS_PROJECTION_NONE objGridSrc.Datum = objDatumSrc

' Set Destination Datum: WGS84 objDatumDst.Axis = 6378137.000 objDatumDst.Flattening = 298.257223563

' Set destination grid: RDNAP objGridDst.Projection = objConstants.GPS_PROJECTION_TRANSVERSEMERCATOR objGridDst.Datum = objDatumDst objGridDst.FalseNorthing = 0 objGridDst.FalseEasting = 500000 objGridDst.OriginLatitude = 0 objGridDst.OriginLongitude = 3 objGridDst.ScaleFactor = 0.9996

' Set Source coordinates objProjection.Latitude = 51.900000 objProjection.Longitude = 4.400000

' Perform the transformation objProjection.TransformGrid objGridSrc, objGridDst

' Return the result WScript.Echo "Convert from Latitude / Longitude to UTM Zone 31 using transverse mercator projection" WScript.Echo WScript.Echo "Result: " & objProjection.LastError & " (" & objProjection.LastErrorDescription & ")" WScript.Echo If ( objProjection.LastError = 0 ) Then WScript.Echo "Latitude = " & objProjection.Latitude WScript.Echo "Longitude = " & objProjection.Longitude WScript.Echo WScript.Echo "Northing = " & objProjection.Northing WScript.Echo "Easting = " & objProjection.Easting End If

WScript.Echo "Ready."

ToUtm Function

Return Value:

Always 0.

Parameters: a GpsDatumParameters object containing the map datum used for the UTM grid.

Optional:

Yes

Description:

In case you only have to perform UTM conversions, you can use this function. From the given latitude and longitude, it calculates the correct UTM zone and converts the coordinate to UTM. The calculated zone is returned. You can force the UTM zone to be used, by passing the zone as a parameter. When it is set to default (0) the zone is calculated. Code Sample (UTM NAD27):

Option Explicit

Dim objDatum, objProjection, objConstants

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objProjection = CreateObject ( "Eye4Software.GpsProjection" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" )

' Set Datum NAD27 (EPSG ID 4267) objDatum.LoadFromId ( 4267 )

' Set Source coordinates objProjection.Latitude = 51.900000 objProjection.Longitude = 4.400000

' Perform the transformation objProjection.ToUtm objDatum

' Return the result WScript.Echo "Convert from Latitude / Longitude to UTM NAD 27" WScript.Echo WScript.Echo "Result: " & objProjection.LastError & " (" & objProjection.LastErrorDescription & ")" WScript.Echo If ( objProjection.LastError = 0 ) Then WScript.Echo "Latitude = " & objProjection.Latitude WScript.Echo "Longitude = " & objProjection.Longitude WScript.Echo WScript.Echo "Northing = " & objProjection.Northing WScript.Echo "Easting = " & objProjection.Easting WScript.Echo "Zone = " & objProjection.Zone End If

WScript.Echo "Ready."

FromUtm Function

Return Value:

Always 0.

Parameters: a GpsDatumParameters object containing the map datum used for the UTM grid.

Optional:

Yes

Description:

In case you only have to perform UTM to latitude / longitude conversions, you can use this function. From the given Northing and Easting, it calculates the correct hemisphere and converts the coordinate to latitude / longitude. You must force the UTM zone to be used, by setting the zone as a parameter.

Code Sample (UTM NAD27):

Option Explicit

Dim objDatum, objProjection

Set objDatum = CreateObject ( "Eye4Software.GpsDatumParameters" ) Set objProjection = CreateObject ( "Eye4Software.GpsProjection" )

' Set Datum NAD27 (EPSG ID 4267) objDatum.LoadFromId ( 4267 )

' Set Source coordinates objProjection.Northing = 5750842.171 objProjection.Easting = 596322.494 objProjection.Zone = 31 ' UTM Zone 31N

' Perform the transformation objProjection.FromUtm objDatum

' Return the result WScript.Echo "Convert from UTM NAD27 to Latitude / Longitude" WScript.Echo WScript.Echo "Result: " & objProjection.LastError & " (" & objProjection.LastErrorDescription & ")" WScript.Echo If ( objProjection.LastError = 0 ) Then WScript.Echo "Northing = " & objProjection.Northing WScript.Echo "Easting = " & objProjection.Easting WScript.Echo "Zone = " & objProjection.Zone WScript.Echo "Latitude = " & objProjection.Latitude WScript.Echo "Longitude = " & objProjection.Longitude WScript.Echo

End If

WScript.Echo "Ready."

9. The 'GpsUtilities' object

The GpsUtilities object is a collection of miscellaneous functions, which can be used in your GPS applications. It contains functions for unit conversion, distance calculations, latitude/longitude string encoding/decoding and more.

GpsUtilities Object Properties

Version property

Type:

String

In/Out:

Out

Optional:

Yes

Description:

The version property can be used to print the version number of the GPS toolkit version currently used.

Code Sample:

Set objUtilities = CreateObject ( "Eye4Software.GpsUtilities" )

WScript.Echo objUtilities.Version

RegistrationCode property

Type:

String

In/Out:

In

Optional:

Yes

Description:

Use this property to activate the software. Once you purchased the software, you will receive a license code. Assign this code to this property to be able to use the software after the evaluation has been expired.

Code Sample:

Set objUtilities = CreateObject ( "Eye4Software.GpsUtilities" ) objUtilities.RegistrationCode = "XXXXXXXXXXXXXXXXXXXXXXXXXXX"

Registered property

Type:

String

In/Out:

Out

Optional:

Yes

Description:

This string returns license information, for instance if the software has been registered or how many days there are left for evaluation

Code Sample:

Set objUtilities = CreateObject ( "Eye4Software.GpsUtilities" )

If ( objUtilities.Registered = True ) Then Wscript.Echo "Registration OK" Else WScript.Echo "Invalid license key, or trial has been expired" End If

LastError property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

When one of the functions has been executed, this property returns the result code of this function. To get the description of this error, use the "LastErrorDescription" property instead.

Code Sample:

Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) Set objUtilities = CreateObject ( "Eye4Software.GpsUtilities" ) fNorthing = objUtilities.ConvertUnits ( objConstants.GPS_PROJECTION_UNITS_M, objConstants.GPS_PROJECTION_UNITS_FTUS, fNorthing )

If ( objUtilities.LastError = 0 ) Then ... End If

LastErrorDescription property

Type:

Number

In/Out:

Out

Optional:

Yes

Description:

When one of the functions has been executed, this property returns the result code of this function. The result is displayed in textual format. To get the number of this error, use the "LastError" property instead.

Code Sample:

Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) Set objUtilities = CreateObject ( "Eye4Software.GpsUtilities" ) fNorthing = objUtilities.ConvertUnits ( objConstants.GPS_PROJECTION_UNITS_M, objConstants.GPS_PROJECTION_UNITS_FTUS, fNorthing )

WScript.Echo "Result = " & objUtilities.LastErrorDescription

GpsUtilities Object Functions

Clear Function

Return Value:

Always 0.

Parameters:

None

Optional:

Yes

Description:

Use this function to clear all the values of the GpsUtilities object.

Code Sample:

Set objUtils = CreateObject ( "Eye4Software.GpsUtilities" )

'Clear all properties objUtils.Clear

ConvertUnits Function

Return Value:

Output Value

Parameters:

Input Units Output Units Input Value

Optional:

Yes

Description:

Use this function to convert values from one unit to another. Pass the input value, input and output units to this function to get the converted value returned. You can specify the input and output units using one of the following constants

Code Sample:

Set objUtils = CreateObject ( "Eye4Software.GpsUtilities" )

WScript.Echo "Northing = " & objUtils.ConvertUnits ( objConstants.GPS_PROJECTION_UNITS_M, objConstants.GPS_PROJECTION_UNITS_FTUS ,objProjection.Northing ) WScript.Echo "Easting = " & objUtils.ConvertUnits ( objConstants.GPS_PROJECTION_UNITS_M, objConstants.GPS_PROJECTION_UNITS_FTUS ,objProjection.Easting )

CalculateDistance Function

Return Value:

Distance

Parameters:

Source Latitude Source Longitude Destination Latitude Destination Longitude

Optional:

Yes

Description:

To calculate the distance between two (latitude/longitude) coordinates, use this function. The function uses the Vincenty's formula which is much more accurate ( < 0.1 m ) then the great circle formula. The output is always in meters, you can use the ConvertUnits function to convert the value.

Code Sample:

Set objUtils = CreateObject ( "Eye4Software.GpsUtilities" )

WScript.Echo "Distance = " & objUtils.CalculateDistance ( 51.9, 4.24, 51.89, 4.93 )

CalculateAzimuth Function

Return Value:

Distance

Parameters:

Source Latitude Source Longitude Destination Latitude Destination Longitude

Optional:

Yes

Description:

To calculate the azimuth (bearing) between two (latitude/longitude) coordinates, use this function. The function uses the great circle formula, the output is in degrees To calculate the reverse azimuth, just swap the source and destination coordinates

Code Sample:

Set objUtils = CreateObject ( "Eye4Software.GpsUtilities" )

WScript.Echo "Azimuth = " & objUtils.CalculateDistance ( 51.9, 4.24, 51.89, 4.93 ) WScript.Echo "Azimuth (Rev) = " & objUtils.CalculateDistance ( 51.89, 4.93, 51.9, 4.24 )

FormatLatitudeString, FormatLongitudeString Functions

Return Value:

The formatted latitude or longitude string

Parameters:

Format Latitude or Longitude

Optional:

Yes

Description:

Use the function to convert a decimal latitude or longitude value to a formatted string. Pass the latitude or longitude value and a Latitude and Longitude format constant to this function to return the string. The following formats are supported:

 54.123428 N (Decimal Degrees)  54 32.521' N (Decimal Degrees, Minutes)  54 12' 32.12" N (Decimal Degrees, Minutes and Seconds)

Code Sample:

Set objUtilities = CreateObject ( "Eye4Software.GpsUtilities" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" )

WScript.Echo objUtilities.FormatLatitudeString ( objConstants.GPS_LATLONFORMAT_DMS, 51.1234 ) WScript.Echo objUtilities.FormatLongitudeString ( objConstants.GPS_LATLONFORMAT_DMS, 4.5678 )

ParseLatitude, ParseLongitude Functions

Return Value:

Latitude or Longitude

Parameters:

Format Formatted String

Optional:

Yes

Description:

Use the function to convert a formatted latitude or longitude string to a decimal value. Pass the string value and a Latitude and Longitude format constant to this function to return the value. The following formats are supported:

 54.123428 N (Decimal Degrees)  54 32.521' N (Decimal Degrees, Minutes)  54 12' 32.12" N (Decimal Degrees, Minutes and Seconds)

Code Sample:

Set objUtilities = CreateObject ( "Eye4Software.GpsUtilities" ) Set objConstants = CreateObject ( "Eye4Software.GpsConstants" ) strLatitude = " 51 54 24.24 N" strLongitude = "004 34 28.58 E" dblLatitude = objUtilities.ParseLatitudeString ( objConstants.GPS_LATLONFORMAT_DMS, strLatitude ) dblLongitude = objUtilities.ParseLongitudeString ( objConstants.GPS_LATLONFORMAT_DMS, strLongitude )

WScript.Echo "Parsed coordinates: " & dblLatitude & " / " & dblLongitude

10. License Agreement

PLEASE READ THIS SOFTWARE LICENSE AGREEMENT CAREFULLY BEFORE DOWNLOADING OR USING THE SOFTWARE. BY CLICKING ON THE "I AGREE" BUTTON, OPENING THE PACKAGE, DOWNLOADING THE PRODUCT, OR USING THIS PRODUCT, YOU ARE CONSENTING TO BE BOUND BY THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, CLICK THE "CANCEL" BUTTON AND THE INSTALLATION PROCESS WILL NOT CONTINUE, RETURN THE PRODUCT TO THE PLACE OF PURCHASE FOR A FULL REFUND, OR DO NOT DOWNLOAD THE PRODUCT. YOUR GENERAL TERMS OF BUSINESS DO NOT APPLY.

1. GENERAL

In this Software License Agreement: (i) "Eye4Software" means Eye4Software B.V., De Regge 11, 7491MC Delden (OV), The Netherlands. (ii) "Customer" means the individual(s), organization or business entity buying a license of the Software from Eye4Software or its Distributors or its Resellers. (iii) "Software" means computer programs (and their storage medium) supplied by Eye4Software and known collectively as "Eye4Software GPS Toolkit" in which Eye4Software has property rights and any user manuals, example code, operating instructions, brochures and all other documentation relating to the said computer programs (the expression "Software" to include all or any part or any combination of Software).

2. LICENSE GRANT

This LICENSE grants you the following rights: (a) Software Product. Eye4Software grants to you a nonexclusive license to use the Software for the sole purposes of designing, developing, and testing your software components or applications ("Applications"). You may install the Software on any computer in your organization. (b) Electronic Documents. Solely with respect to electronic documents included with the Software, you may make an unlimited number of copies (either in hardcopy or electronic form), provided that such copies shall be used only for internal purposes and are not republished or distributed to any third party. (c) Serial Number. A Serial Number provided at the time of sale uniquely identifies each License. This LICENSE GRANT is contingent upon the purchase of a Serial Number from Eye4Software or one of Eye4Software's resellers. (d) Sample Code. Eye4Software grants you the right to use and modify the source code parts of the SOFTWARE that are listed in the "Samples" subdirectories (collectively, "Sample Code"), for the sole purposes of designing, developing, and testing your Applications. (e) Redistributable Files. Provided you comply with Sections 2(f), 2(g) and 2(h), Eye4Software grants you a nonexclusive, royalty-free right to reproduce and distribute the object code version of the following portions of the Software (collectively, "Redistributables"): (i) Sample Code (including any modifications you make); and (ii) the Eye4Software *.dll files located in the Software. (f) Redistribution Requirements. If you redistribute the Redistributables, you agree to: (i) distribute the Redistributables in object code only as a part of Applications developed by you that add significant and primary functionality to the Redistributables; (ii) include a valid copyright notice on your Applications; (iii) not permit further distribution of the Redistributables by your end user; (iv) the registration key should not be visible from files, registry settings nor should it be visible to the customer in any other way. (g) Redistribution Restrictions. You may not redistribute the Redistributables if (i) you are developing Applications for use by other software developers (using this Software for developing and debugging Applications requires additional Licenses for each developer using the Software), or (ii) your Applications exposes the functionality of the Software through a programmable interface. (h) Redistribution indemnification. You agree to indemnify, hold harmless, and defend Eye4Software and its suppliers from and against any and all claims or lawsuits including attorney's fees that arise or result from the use or distribution of your bundled application. (i) Trial Software. If the Software is installed without a Serial Number then, notwithstanding other sections of this License, you may use the Software for up to 30 days after installation, but may not redistribute any Redistributables. (j) Not for Resale Software. If the Software is labeled "Not for Resale" or "NFR," then, notwithstanding other sections of this License, you may not resell, or otherwise transfer for value, the Software, nor distribute any Redistributables. (k) Reservation of Rights. Eye4Software reserves all rights not expressly granted to you in this License Agreement. The license is granted to Customer on a non-exclusive-basis which means that Eye4Software will grant the license also to other individuals, organizations and business entities. This License Agreement consist no obligations for Eye4Software to offer support(services), help(services) or maintenance(services) relating to the Software. Obligations for Eye4Software to offer maintenance (services) relating to the Software can only arise from a Maintenance Agreement between Eye4Software and Customer. General terms of business of the Customer do not apply.

3. UPGRADES AND SUPPLEMENTS

If the Software is labeled as an upgrade, you must be properly licensed to use a product identified by Eye4Software as being eligible for the upgrade in order to use the Software. Software labeled as an upgrade replaces and/or supplements the product that formed the basis for your eligibility for the upgrade. You may use the resulting upgraded product only in accordance with the terms of this License unless we provide other terms along with the update or supplement. If the Software is an upgrade of a component of a package of software programs that you licensed as a single product, the Software may be used and transferred only as part of that single product package.

4. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY

Customer may not reverse engineer, decompile, or disassemble the Software, except and only to the extent that it is expressly permitted by applicable law notwithstanding this limitation.

5. TERMINATION

Without prejudice to any other rights, Eye4Software may cancel or dissolve this License Agreement if Customer does not abide by the terms and conditions of this License Agreement, in which case Customer must destroy all copies of the Software and all of its component parts. 6. LIMITED WARRANTY

Eye4Software warrants that for a period of ninety (90) days from the date of shipment from Eye4Software: (i) the media on which the Software is furnished will be free of defects in materials and workmanship under normal use; (ii) the Software substantially conforms to its published specifications. Except for the foregoing, the Software is provided AS IS. This limited warranty extends only to Customer as the original licensee. Customer's exclusive remedy and the entire liability of Eye4Software and its suppliers under this limited warranty will be, at Eye4Software or its service center's option, repair, replacement, or refund of the Software if reported (or, upon request, returned) to the party supplying the Software to Customer. In no event does Eye4Software warrant that the Software is error free or that Customer will be able to operate the Software without problems or interruptions.The customer will safeguard Eye4Software against any claim relating to the use of the Software by the Customer. This warranty does not apply if the Software: (a) has been altered, except by Eye4Software; (b) has not been installed, operated, repaired, or maintained in accordance with instructions supplied by Eye4Software; (c) has been subjected to abnormal physical or electrical stress misuse, negligence, or accident; (d) is used in high-risk activities, including the operation of nuclear facilities, aircraft navigation, air traffic control, weapons systems, life support or medical applications for use in any circumstance in which the failure of the Software could lead directly to death, personal injury or damage to properties or the environment.

7. LIMITATION OF LIABILITY AND REMEDIES

NOTWITHSTANDING ANY DAMAGES THAT YOU MIGHT INCUR FOR ANY REASON WHATSOEVER (INCLUDING, WITHOUT LIMITATION ALL INDERECT, SPECIAL, INCIDENTIAL OR CONSEQUENTIAL DAMAGES OR MULTIPLE DAMAGES SUCH AS BUT NOT LIMITED TO, LOST BUSINESS OR PROFITS, LOSS OF GOODWILL, WORK STOPPAGE AND DATALOSS), THE ENTIRE LIABILITY OF EYE4SOFTWARE AND ANY OF ITS SUPPLIERS UNDER ANY PROVISION OF THIS LICENSE AGREEMENT AND YOUR EXCLUSIVE REMEDY FOR ALL OF THE FOREGOING (EXCEPT FOR ANY REMEDY OF REPAIR OR REPLACEMENT ELECTED BY EYE4SOFTWARE WITH RESPECT TO ANY BREACH OF THE LIMITED WARRANTY) SHALL BE LIMITED TO THE GREATER OF THE AMOUNT ACTUALLY PAID BY YOU FOR THE SOFTWARE OR U.S.$5.00. EYE4SOFTWARE IS RELIEVED OF ANY OBLIGATION TO PAY DAMAGES IF THE CUSTOMER HAS NOT UPGRADED THE SOFWARE WHEN POSSIBLE. THE FOREGOING LIMITATIONS, EXCLUSIONS AND DISCLAIMERS (INCLUDING SECTIONS 4, 5 AND 6 ABOVE) SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EVEN IF ANY REMEDY FAILS ITS ESSENTIAL PURPOSE.

8. ENTIRE AGREEMENT

This License Agreement (including any addendum or amendment to this License Agreements which is included with the Software) is the entire agreement between you and Eye4Software relating to the Software and the support services (if any) and they supersede all prior or contemporaneous oral or written communications, proposals and representations with respect to the Software or any other subject matter covered by this License Agreement. To the extent the terms of any Eye4Software policies or programs for support services conflict with the terms of this License Agreement, the terms of this License Agreement shall control. The Customer is not allowed to alienate or transfer any rights relating to this License Agreement without the written approval of Eye4Software. THIS AGREEMENT SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS OF THE NETHERLANDS AND THE DUTCH COURTS SHALL HAVE SOLE JURISDICTION IN ANY DISPUTE RELATING TO THESE CONDITIONS. ALL DISPUTES HEREUNDER SHALL BE RESOLVED EXCLUSIVELY IN THE APPROPRIATE COURT IN THE CITY OF ALMELO, THE NETHERLANDS. If any part of these conditions shall be or become invalid or unenforceable in any way and to any extent by any existing or future rule of law, order, statute or regulation applicable thereto, then the other conditions shall remain in full force and effect as all other provisions. The conditions of this License Agreement remain applicable after the termination of this License Agreement if this results from the nature of the condition. THE UNITED NATIONS CONVENTION ON CONTRACTS FOR THE INTERNATIONAL SALE OF GOODS (THE "CONVENTION" OR "CISG") IS EXCLUDED AND DOES NOT APPLY.

9. COPYRIGHT

The Software is protected by copyright and other intellectual property laws and treaties. Eye4Software or its suppliers own the title, copyright, and other intellectual property rights in the Software. The granting of a license does not constitute a transfer of any intellectual property right. The Software is licensed, not sold.