Table of Contents
Introduction
- Overview
- Supported programming languages
- Requirements
- Supported GPS hardware
- Installation
Getting Started
- Overview
- Visual C++
- Visual Basic
- Visual Basic .NET
- Visual C# .NET
- VBScript
The GpsConstants object
- Overview
- Dataformat constants
- NMEA filter constants
- Speed units constants
- Altitude units constants
- Latitude and Longitude format constants
- Projection constants
- Projection units constants
The GpsSatelliteInfo object
- Overview
- Properties
- Functions
The Gps object
- Overview
- Properties
- Functions
The GpsDatumParameters object
- Overview
- Properties
- Functions
The GpsGridParameters object
- Overview
- Properties
- Functions
The GpsProjection object
- Overview
- Properties
- Functions
Introduction
Overview
The Eye4Software GPS Toolkit, is a software component that helps you developing your own GPS applications, like Track and Trace, Navigation, Positioning, Hydrographic, construction and much more. The core of the toolkit is the "GpsCtrl.dll" file. This is a COM/ActiveX control which handles everything, including: reading the serial port, decoding the data, converting data in various formats / units.
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 latitude and longitude as both decimal and (user defined) string representations;
- Conversion between units, like km/h, mph, feet, knots, meters;
- Conversion between geodetic map datums and reference ellipsoids;
- Conversion between latitude / longitude and map projections.
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.
Supported GPS hardware
You can use all GPS devices equiped with a NMEA0183 port, or Garmin GPS devices equiped 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 wan 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 platorm) 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.
Getting Started
Overview
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;
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_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 );
For more info about using the Eye4Software GPS Toolkit with Visual C++, please visit
this document.
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 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 objGpsProjection = CreateObject ("Eye4Software.GpsProjection")
Set objGpsDatumParameters = CreateObject ("Eye4Software.GpsDatumParameters")
Set objGpsGridParameters = CreateObject ("Eye4Software.GpsGridParameters")
Set objGpsConstants = CreateObject ("Eye4Software.GpsConstants")
For more info about using the Eye4Software GPS Toolkit with Visual Basic, please visit
this document.
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 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
objGpsProjection = New GpsProjection
objGpsDatumParameters = New GpsDatumParameters
objGpsGridParameters = New GpsGridParameters
objGpsConstants = New GpsConstants
For more info about using the Eye4Software GPS Toolkit with Visual Basic .NET, please visit
this document.
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 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();
objGpsProjection = new GpsProjection();
objGpsDatumParameters = new GpsDatumParameters();
objGpsGridParameters = new GpsGridParameters();
objGpsConstants = new GpsConstants();
For more info about using the Eye4Software GPS Toolkit with Visual C# .NET, please visit
this document.
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 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 objGpsProjection = CreateObject ("Eye4Software.GpsProjection")
Set objGpsDatumParameters = CreateObject ("Eye4Software.GpsDatumParameters")
Set objGpsGridParameters = CreateObject ("Eye4Software.GpsGridParameters")
Set objGpsConstants = CreateObject ("Eye4Software.GpsConstants")
For more info about using the Eye4Software GPS Toolkit with VBScript, please visit
this document.
The 'GpsConstants' object
Overview
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 Units
| 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
|
2
|
Return speed in meters per second
|
Altitude Units
| 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
|
Grid Projections
| Constant |
Value |
Description |
|
GPS_PROJECTION_NONE
|
0
|
Do not use grid, just use latitude and longitude
|
|
GPS_PROJECTION_LAMBERT1SP
|
100
|
Use Lambert Conformal Conic projection with one standard parallel
|
|
GPS_PROJECTION_LAMBERT2SP
|
110
|
Use Lambert Conformal Conic projection with two standard parallels
|
|
GPS_PROJECTION_LAMBERTAEA
|
120
|
Use Lambert Azimuthal Equal Area projection
|
|
GPS_PROJECTION_ALBERSEQUALAREA
|
130
|
Use Albers Equal Area Conic projection
|
|
GPS_PROJECTION_MERCATOR1SP
|
140
|
Use Mercator projection with one standard parallel
|
|
GPS_PROJECTION_MERCATOR2SP
|
150
|
Use Mercator projection with two standard parallels
|
|
GPS_PROJECTION_TRANSVERSEMERCATOR
|
160
|
Use Transverse Mercator projection
|
|
GPS_PROJECTION_OBLIQUEMERCATOR
|
170
|
Use Oblique Mercator projection
|
|
GPS_PROJECTION_HOTINEOBLIQUEMERCATOR
|
180
|
Use Hotine Oblique Mercator projection
|
|
GPS_PROJECTION_SWISSOBLIQUEMERCATOR
|
190
|
Use Swiss Oblique Mercator projection
|
|
GPS_PROJECTION_STEREOGRAPHIC
|
210
|
Use Stereographic projection
|
|
GPS_PROJECTION_POLARSTEREOGRAPHIC
|
220
|
Use Polar Stereographic projection
|
|
GPS_PROJECTION_CASSINI
|
230
|
Use Cassini projection
|
|
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
|
Projection Units
| Constant |
Value |
Description |
|
GPS_PROJECTION_UNITS_M
|
0
|
Meter
|
|
GPS_PROJECTION_UNITS_KM
|
1
|
Kilometer
|
|
GPS_PROJECTION_UNITS_FT
|
10
|
Foot
|
|
GPS_PROJECTION_UNITS_FTBR
|
11
|
British Foot
|
|
GPS_PROJECTION_UNITS_FTCLA
|
12
|
Clarke's Foot
|
|
GPS_PROJECTION_UNITS_FTGC
|
13
|
Gold Coast Foot
|
|
GPS_PROJECTION_UNITS_FTIND
|
14
|
Indian Foot
|
|
GPS_PROJECTION_UNITS_FTSE
|
15
|
British Foot (Sears)
|
|
GPS_PROJECTION_UNITS_FTUS
|
16
|
U.S. Survey Foot
|
|
GPS_PROJECTION_UNITS_LK
|
20
|
Link
|
|
GPS_PROJECTION_UNITS_LKCLA
|
21
|
Clarke's Link
|
|
GPS_PROJECTION_UNITS_LKSE
|
22
|
British Link (Sears)
|
|
GPS_PROJECTION_UNITS_LKUS
|
23
|
U.S. Survey Link
|
|
GPS_PROJECTION_UNITS_MI
|
30
|
Statute Mile
|
|
GPS_PROJECTION_UNITS_MIUS
|
31
|
U.S. Survey Mile
|
|
GPS_PROJECTION_UNITS_CH
|
40
|
Chain
|
|
GPS_PROJECTION_UNITS_CHCLA
|
41
|
Clarke's Chain
|
|
GPS_PROJECTION_UNITS_CHSE
|
42
|
British Chain (Sears)
|
|
GPS_PROJECTION_UNITS_CHUS
|
43
|
U.S. Survey Chain
|
The 'GpsSatelliteInfo' object
Overview
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.
Object Properties
| Property Name |
Type |
Description |
| ID |
String |
ID or PRN # of this satellite |
| Elevation |
String |
Elevation of this satellite |
| Azimuth |
String |
Azimuth of this satellite |
| SignalNoiseRatio |
String |
Signal strength of this satellite |
| UsedForFix |
String |
Specifies whether this satellite has been used to calculate the current position fix |
Object Functions
| Function Name |
Description |
| Clear |
Clears all property values |
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
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
The 'Gps' object
Overview
The Gps object is the core of the component, it handles the serial communication and the decoding of the received NMEA sentences.
Below is a list of all the properties of this object:
Object Properties
| Property Name |
Type |
Description |
| Version |
String |
Can be used to retrieve the version of the control used |
| RegistrationCode |
String |
To activate your product, use this property to set the registrationcode received |
| Registered |
String |
Displays the number of days left for evaluation, or just registered when the software has been purchased |
| LastError |
Number |
The result of the last operation (numeric error code) |
| LastErrorDescription |
String |
The result of the last operation (textual description) |
| LogFile |
String |
File used to log all operations and GPS data |
| DeviceSerialPort |
Number |
COMxx number of serial port the GPS is connected to |
| DeviceBaudrate |
Number |
Speed to be used on serial port |
| DeviceDataFormat |
Number |
Dataformat to be used on serial port (Databits, Parity, Stopbits) |
| DeviceTimeout |
Number |
Time in milliseconds after when the read operation will timeout |
| TalkerID |
String |
Only NMEA sentences with talker ID's as specified in this property will be decoded |
| Filter |
Number |
This property allows you to specify which types of sentences should be decoded, and which are discarded |
| EnableChecksum |
Boolean |
Turn NMEA0183 CRC functionality on or off |
| UnitsSpeed |
Number |
Units used to represent speed (Knots, Kmh, mph) |
| UnitsAltitude |
Number |
Units used to represent altitude (feet, meters) |
| LatLonStringFormat |
Number |
Format used to display latitude and longitude in string format |
| LogGpsData |
Boolean |
Turn GPS data logging to file on or off |
| gpsLatitude |
Float |
Current Latitude |
| gpsLongitude |
Float |
Current Longitude |
| gpsAltitude |
Float |
Current Altitude |
| gpsSpeed |
Float |
Current Speed over Ground |
| gpsCourse |
Float |
Current Course over Ground |
| gpsTime |
Number |
Current (Atomic) GPS Time |
| gpsLatitudeString |
String |
Formatted Latitude String |
| gpsLongitudeString |
String |
Formatted Longitude String |
| gpsTimeString |
String |
Formatted GPS Time string |
| gpsQuality |
Number |
GPS fix quality indication |
| gpsSatellites |
Number |
Number of satellites used in fix |
| gpsDifferentialID |
Number |
ID of DGPS reference station |
| gpsDifferentialAge |
Number |
Age of DGPS reference station data |
| gpsPDOP |
Float |
Current PDOP |
| gpsHDOP |
Float |
Current HDOP |
| gpsVDOP |
Float |
Current VDOP |
| gpsEOPE |
Float |
Current estimated overall position error (Garmin only) |
| gpsEHPE |
Float |
Current estimated horizontal position error (Garmin only) |
| gpsEVPE |
Float |
Current estimated vertical position error (Garmin only) |
Object Functions
| Function Name |
Description |
| Clear |
Resets the values of all properties to their defaults |
| Open |
Opens the serial port, and start receiving and decoding incoming GPS data |
| Close |
Stop receiving and decoding GPS data, and close serial port |
| GetFirstSatellite |
Get information about the first satellite used for fix |
| GetNextSatellite |
Get information about the next satellite used for fix |
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"
gpsTime property
Type:
Number
In/Out:
Out
Optional:
Yes
Description:
Use this property to retrieve the currect 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 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 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 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
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
The 'GpsDatumParameters' object
Overview
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.
The GpsDatumParameters object holds both ellipsoid and the Helmert-7 parameters used to transform to WGS84.
Object Properties
| Property Name |
Type |
Description |
| Axis |
Float |
Semi-major axis of the ellipsoid used for this map datum |
| Flattening |
Float |
Flattening of the ellipsoid used for this map datum |
| TranslationX |
Float |
X translation to transform to WGS84, in meters |
| TranslationY |
Float |
Y translation to transform to WGS84, in meters |
| TranslationZ |
Float |
Z translation to transform to WGS84, in meters |
| RotationX |
Float |
X rotation to transform to WGS84, in arcseconds |
| RotationY |
Float |
Y rotation to transform to WGS84, in arcseconds |
| RotationZ |
Float |
Z rotation to transform to WGS84, in arcseconds |
| RotationZ |
Float |
Z rotation to transform to WGS84, in arcseconds |
| ScaleFactor |
Float |
Scalefactor in ppm (parts per million or e-06) |
Object Functions
| Function Name |
Description |
| Clear |
Clears all property values |
| SaveToDisk |
Saves all property values to a file |
| LoadFromDisk |
Reads all property values from a file |
Axis property
Type:
Float
In/Out:
In/Out
Optional:
No
Description:
The semi-major axis of the ellipsoid defined for this datum.
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
Flattening property
Type:
Float
In/Out:
In/Out
Optional:
No
Description:
The flattening of the ellipsoid defined for this map datum.
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
TranslationX property
Type:
Float
In/Out:
In/Out
Optional:
No
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 = 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
TranslationY property
Type:
Float
In/Out:
In/Out
Optional:
No
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 objDaum = 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
TranslationZ property
Type:
Float
In/Out:
In/Out
Optional:
No
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 = 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
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:
No
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
Clear Function
Return Value:
Always 0.
Parameters:
None
Optional:
Yes
Description:
Use this function to clear all the values of the GpsDatumParameters object.
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
SaveToDisk 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 LoadFromDisk 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.SaveToDisk "C:\Datums\OSGB36.ini"
ReadFromFile 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.LoadFromDisk "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
The 'GpsGridParameters' object
Overview
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.
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 Conic 1 SP |
x |
x |
x |
x |
x |
- |
- |
- |
- |
| Lambert Conformal Conic 2 SP |
- |
x |
x |
x |
x |
x |
x |
- |
- |
| Lambert Azimuthal Equal Area |
- |
x |
x |
x |
x |
x |
x |
- |
- |
| Transverse Mercator |
x |
x |
x |
x |
x |
- |
- |
- |
- |
| Oblique Stereographic |
x |
x |
x |
x |
x |
- |
- |
- |
- |
| Polar Stereographic |
- |
x |
x |
x |
x |
- |
- |
- |
- |
| Oblique Mercator |
- |
x |
x |
x |
x |
- |
- |
- |
- |
| Hotine Oblique Mercator |
- |
x |
x |
x |
x |
- |
- |
x |
x |
| Swiss Oblique Mercator |
- |
x |
x |
x |
x |
- |
- |
- |
- |
| Albers Equal Area Conic |
- |
x |
x |
x |
x |
x |
x |
- |
- |
| 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 |
- |
Object Properties
Object Functions
| Function Name |
Description |
| Clear |
Clears all property values |
| SaveToFile |
Save all property values to disk |
| LoadFromFile |
Read all property values from disk |
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
The 'GpsProjection' object
Overview
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.
Object Properties
| Property Name |
Type |
Description |
| Version |
String |
Can be used to retrieve the version of the control used |
| RegistrationCode |
String |
To activate your product, use this property to set the registrationcode received |
| Registered |
String |
Displays the number of days left for evaluation, or just registered when the software has been purchased |
| LastError |
Number |
The result of the last operation (numeric error code) |
| LastErrorDescription |
String |
The result of the last operation (textual description) |
| LogFile |
String |
File used to log all the tranformations |
| Latitude |
Float |
Source and/or destination latitude coordinate |
| Longitude |
Float |
Source and/or destination longitude coordinate |
| Easting |
Float |
Source and/or destination easting (or X) coordinate |
| Northing |
Float |
Source and/or destination northing (or Y) coordinate |
Object Functions
| Function Name |
Description |
| Clear |
Clears all property values |
| TransformDatum |
Perform a transformation between two different map datums |
| TransformGrid |
Perform a transformation between two different map grids |
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: " & objProc.Latitude
WScript.Echo "Longitude after datum transformation: " & objProc.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: " & objProc.Latitude
WScript.Echo "Longitude after datum transformation: " & objProc.Longitude
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
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. A list of geodetic datums around the world can be found
here.
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. A list of map grids around the world can be found
here.
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."