email : support@scaryshed.com web : http://www.scaryshed.com
This component suite consists of two GPS communication components and two components to perform coordinate conversion calculations:
TGrmnPosition - communicate with a GPS receiver using Garmin's proprietary communication protocol
TNMEA - communicate with a GPS receiver using the widely supported NMEA-0183 protocol to determine position, speed, bearing and satellite availability
TDat2Dat - datum conversion from one geodetic datum to another
TEllip2Grid - convert geodetic/geographic (latitude and longitude) to Transverse Mercator (Grid) coordinates
To install these components copy the files contained in the distrubution zip file to the following locations
Registration of this product will remove all the nag screens that periodically occur on component creation (at both design and run-time). Registration costs £20 sterling. To register, please visit our web page at www.scaryshed.com
Your attention is also drawn to the disclaimer at the end of this document.
Downloads the current position from a Garmin GPS via the Garmin serial protocol. The Garmin protocol operates on a request/response principle, therefore before reading Latitude and Longitude, there must be a call to GetData.
TGrmnPosition.Port
property Port : integer;Set this property to specify the serial port to which the GPS unit is connected. Default value is 1 (COM1).
TGrmnPosition.Latitude
property Latitude : double;Current GPS latitude in decimal degrees. Datum used is determined by the GPS unit.
TGrmnPosition.Longitude
property Longitude : double;Current GPS longitude in decimal degrees. Datum used is determined by the GPS unit.
TGrmnPosition.OpenPort
function OpenPort : integerOpens the serial port specified by the Port property. Call this function before using the GetData function to read from the GPS receiver. Function returns 1 if port opened successfully, 0 otherwise
TGrmnPosition.ClosePort
function ClosePort : integerCloses the serial port currently in use Returns 1 if port closed successfully, 0 otherwise
TGrmnPosition.GetData
function GetData : integerCauses the current GPS position to be downloaded and the component's Latitude and Longitude properties to be updated Returns 1 if successful, 0 otherwise
The TNMEA component provides an interface to any GPS receiver implementing the NMEA-0183 protocol. This protocol specifies that data should be transmitted in the form of "sentences" from the GPS device (the "talker") to the "listeners". This makes the TNMEA component particularly easy to use, as there is no requirement on the listener to request data from the GPS device. Once the com port is opened, all that is required is to respond to the events corresponding to the receipt of the different sentences.
TNMEA.OnPosition
property OnPosition : TNotifyEvent;Event is fired when the NMEA message GGA ("Global positioning system fix data") is received. On receipt of this message from the GPS device, the contents are parsed into the GPSFix property before this event is fired.
TNMEA.OnSatelliteData
property OnSatelliteData : TNotifyEvent;Event is fired when the NMEA message GSV ("Satellites in view") is received. On receipt of this message from the GPS device, the contents are parsed into the GPSSatellites property before this event is fired.
TNMEA.OnTransit
property OnTransit : TNotifyEvent;Event is fired when the NMEA message RMC ("Recommended minimum specific GPS/transit data") is received. On receipt of this message from the GPS device, the contents are parsed into the GPSTransit property before this event is fired
TNMEA.OnError
property OnError : TNotifyEvent;
Event is fired when an error occurs in processing an incoming NMEA string
TNMEA.ComPort
property ComPort : byte;Com port number that the GPS receiver is connected to. Set this to the required value before calling the TNMEA.Open.
TNMEA.BaudRate
property BaudRate : TBaudRate;Baud rate for the com port the receiver is connected to. Must match the baud rate set on the GPS device. Default value 4800.
TNMEA.GPSFix
property GPSFix : TGPSFix;Hold the result of a successful decoding of a GGA message sent by the GPS device. This property is set immediately prior to the firing of the TNMEA.OnPosition event.
TGPSFix = record UTCTime : TTime; Latitude : double; Longitude : double; Quality : integer; SatelliteCount : integer; Altitude : single; end;
Parameter Meaning UTCTime Time the position was obtained Latitude Current Latitude Longitude Current longitude Quality Quality of the position fix 0=invalid; 1=GPS Fix; 2=DGPS Fix SatelliteCount Number of satellites being tracked Altitude Current altitude in metres above mean sea level
TNMEA.GPSTransit
property GPSTransit : TGPSTransit;Hold the result of a successful decoding of a RMC message sent by the GPS device. This property is set immediately prior to the firing of the TNMEA.OnTransit event and gives details of the current position, speed and bearing of the receiver.
TGPSTransit = record UTCDateTime : TTime; Warning : boolean; Latitude : double; Longitude : double; Speed : single; Course : single; MagneticVariation : single; end;
Parameter Meaning UTCDateTime
Date and time message of fix
Warning
Navigation receiver warning, true if the fix is invalid
Latitude
Current latitude
Longitude
Current longitude
Speed
Speed over ground (in miles per hour)
Course
Course made good
MagneticVariation
Magnetic variation
TNMEA.GPSSatellites
property GPSSatellites : TGPSSatellites;Gives the result of a decoded GSV message (satellite data). This property is set immediately prior to the firing of the TNMEA.OnSatellite event and gives details of the number of satellites in view, and their position.
TGPSSatellites = record SatelliteCount : integer; SatelliteData : array [1..12] of TSatellite; end;
Parameter Meaning SatelliteCount Number of satellites currently in view SatelliteData Array of satellite data. Relevant data is held in SatelliteData[1..SatelliteCount] TSatellite = record SatelliteID : integer; Elevation : integer; Azimuth : integer; Signal : integer; end;
Parameter Meaning SatelliteID Satellite PRN number Elevation Elevation in degrees Azimuth Azimuthal angle in degrees Signal Signal strength
TNMEA.Open
function Open : boolean;Opens the communication port and starts processing incoming data. Note that, unlike the Garmin protocol used in the TGRMNPosition component, the NMEA protocol requires that the GPS device continually sends out position information. Therefore, the only action required to receive data is to open the com port and process incoming data.
TNMEA.close
function close : integer;Cease processing incoming data and close the com port.
Converts Latitude and Longitude to Transverse Mercator (Grid) coordinates, and vice versa.
TEllip2Grid.Action
property Action : TAction;Determines whether the Evaluate procedure performs an Ellipsoid to Grid conversion or vice versa
type TAction = (EllipsToGrid,GridToEllips);
Value Meaning EllipsToGrid Calling TEllip2Grid.Evaluate will convert elliptical to grid coordinates GridToEllips Calling TEllip2Grid.Evaluate will convert grid to elliptical coordinates
TEllip2Grid.Grid
property Grid : TGrid;Grid to use in conversion
TEllip2Grid.Latitude
property Latitude : doubleEllipsoidal coordinate. To convert these to grid coordinates, set the Action property to EllipsToGrid, and call the Evaluate method
TEllip2Grid.Longitude
property Longitude : doubleEllipsoidal coordinate. To convert these to grid coordinates, set the Action property to EllipsToGrid, and call the Evaluate method
TEllip2Grid.Easting
property Easting : integerCoordinates relative to the specified Grid. To convert these to ellipsiodal coordinates, set the Action property to GridToEllips, and call the Evaluate method.
TEllip2Grid.Northing
property Northing : integerCoordinates relative to the specified Grid. To convert these to ellipsiodal coordinates, set the Action property to GridToEllips, and call the Evaluate method.
TEllip2Grid.Evaluate
procedure Evaluate;Carries out the required conversion according to the current setting of the Action property.
Component converts Latitude and Longitude from one map datum to another by means of the Molodensky transformation
TDatumChange.SourceDatum
property SourceDatum : TDatum;Defines the datum for InputLatitude and InputLongitude
TDatumChange.TargetDatum
property TargetDatum : TDatum;Defines the datum for OutputLatitude and OutputLongitude
TDatumChange.InputLatitude
property InputLatitude : double;Source data for the conversion
TDatumChange.InputLongitude
property InputLongitude : double;Source data for the conversion
TDatumChange.OutputLatitude
property OutputLatitude : double;Results of the conversion
TDatumChange.OutputLongitude
property OutputLongitude : double;Results of the conversion
TDatumChange.evaluate
procedure evaluate : double;Performs the conversion from SourceDatum to TargetDatum
TGrid.GridName
property GridName : TGridName;type TGridName = (grGB, grIrish, grUTM29, grUTM30, grUTM31, grUser);Five pre-defined grids are available, plus one user specified. TGrid. Other properties of TGrid are read-only, unless Grid.GridName = grUser.
Supplied grids are those relevant to the UK although, through the use of grUser, any grid can be defined. The parameters for the five pre-defined grids are listed here.
Value Meaning grGB OS GB National Grid grIrish Irish National Grid grUTM29 UTM Zone 29 grUTM30 UTM Zone 30 grUTM31 UTM Zone 31 grUser User-specified grid
TGrid.Ellipsoid
property Ellipsoid : TEllipsoid;The ellipsoid used for the projection.
TGrid.OriginLat
property OriginLat : Double;Latitude of the true origin of the grid
TGrid.OriginLong
property OriginLong : Double;Longitude of the true origin of the grid
TGrid.OriginEast
property OriginEast : integer;Map coordinate (Easting) of the true origin, E0
TGrid.OriginNorth
property OriginNorth : integer;Map coordinate (Northing) of the true origin, N0
TGrid.ScaleFactor
property ScaleFactor : double;Scale factor on the central meridian, F0
TEllipsoid.Name
type TEllipsoidName = (elAiry30,elAiryMod,elAustNat,elBess41,elBess41Namib,elClarke66, elClarke80,elEver30,elEverMod,elFisch60,elFisch60Mod,elFisch68, elGRS67,elGRS75,elGRS80,elHough56,elInter,elKrass40, elSAm69,elWGS60,elWGS66,elWGS72,elWGS84);property Name : TEllipsoidName;Selects an ellipsoid from the list of 23 pre-defined ellipsoids.
TEllipsoid.FullName
property FullName : string;The full name of the ellipsoid.
TEllipsoid.a
property a : double;Ellipsoid semi-major axis, a (in metres).
TEllipsoid.b
property b : double;Ellipsoid semi-minor axis, b (in metres). b can be derived from the parameters a and f by the formula b = a * (1 - f)
TEllipsoid.f_recip
property f_recip : double;The reciprocal of the ellipsoid flattening parameter, f.
TDatum.Name
Short name for the datumproperty Name : TDatumName;type TDatumName = (dtAdin,dtAEA,dtAfgo,dtAnAst,dtARC50,dtARC60, dtAscI58,dtAst52,dtAstB4,dtAstBeacE,dtAstDos714,dtAust84, dtBelleIGN,dtBerm57,dtBogObs,dtCampInch,dtCantAst,dtCape, dtCapeCan,dtCart,dtCH03,dtChat71,dtChuAst,dtCorrAleg, dtCypr,dtDjakBat,dtDOS68,dtEastIsl67,dtEuro50,dtEuro79,dtFin, dtGandBase,dtGeoDat49,dtGuam63,dtGunSer62,dtGUX1Ast,dtHjor55, dtHK63,dtHTS,dtIndia,dtIre65,dtISTS73Ast,dtJohnIsl, dtKergIsl,dtKert48,dtLC5Ast,dtLib64,dtLuz,dtMah71, dtMarcAst,dtMass,dtMerch,dtMidAst61,dtMinn,dtNAD27, dtNAD27Alas{,dtNAD27Alas},dtNAD27Bah,dtNAD27Cub, dtNAD27Green,dtNAD83,dtNahr,dtNapBWI,dtObs66,dtOldHawa, dtOman,dtOSGB,dtPico,dtPitc67,dtPSthAm56,dtPSthChi63,dtPuerto, dtQatar,dtQorn,dtRome40,dtSAD69Br,dtSanDOS,dtSap43,dtSchw, dtSEBase,dtSthAm69,dtSthAs,dtSWBase,dtThai,dtTimb48, dtTokyo,dtTrist68,dtVitiLev16,dtWake60,dtWGS72,dtWGS84, dtZand);
TDatum.FullName
property FullName : stringFull name of the datum.
TDatum.Ellipsoid
property Ellipsoid : TEllipsoidEllipsoid used for this datum.
TDatum.dx
property dx : singleDatum offset x
TDatum.dy
property dy : singleDatum offset y
TDatum.dz
property dz : singleDatum offset z
24 Nov 1999 | 1.0.0 | initial release |
1 Mar 2000 | 1.0.1 | TEllip2Grid iterative tolerance bug fixed |
dtFin datum added | ||
21 June 2001 | 1.1 | TNMEA component added |
TGPSTime removed | ||
TGPSPosition renamed TGrmnPosition | ||
added Delphi 5 support |
Use of the components supplied as part of this package is entirely at the user's own risk. The author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The author assumes no liability for damages, direct or consequential, which may result from the use of these components.