rtcm-react-native
v1.0.0
Published
RTCM 3.3 decoder/encoder
Downloads
68
Maintainers
Readme
RTCM 3 Decoder/Encoder
Decoder/encoder for all RTCM 3 message types up to RTCM 3.3 Amendment 1 (c10403.3).
Installing
npm install -S @gnss/rtcm
Basic Usage
Decoding
let buffer: Buffer = ...; // Raw bytes of message to be decoded
let message: RtcmMessage; // Decoded message
let length: number; // Length of decoded message in bytes
[message, length] = RtcmTransport.decode(buffer);
// ...
buffer = buffer.slice(length); // Move to next message
Encoding
let message = ...; // Message to be encoded
let buffer: Buffer = Buffer.allocUnsafe(RtcmTransport.MAX_PACKET_SIZE);
let length: number; // Length of encoded message in bytes
length = RtcmTransport.encode(message, buffer);
// ...
buffer = buffer.slice(0, length); // Encoded message
Creating
Messages can be manually constructed using RtcmMessage???.construct({})
, which requires all message properties to be provided.
RtcmMessagePhysicalReferenceStationPosition.construct({
nonPhysicalReferenceStationId: 1,
physicalReferenceStationId: 0,
itrfEpochYear: 0,
arpEcefX: 37927650000,
arpEcefY: -4160650000,
arpEcefZ: 50938770000
})
Streams
Transform streams to convert from RtcmMessage
s to raw bytes and vice-versa.
let input: stream.Readable = ...;
let output: stream.Writable = ...;
input // Stream of raw data
.pipe(new RtcmDecodeTransformStream()) // Stream of RtcmMessage objects
.pipe(new RtcmEncodeTransformStream()) // Stream of (identical) raw data
.pipe(output);
RtcmDecodeTransformStream
can optionally synchronize with the raw data stream e.g. if it starts receiving data from the middle of a message.
Messages Supported
- MT1001 (RtcmMessageGpsL1Observables)
- MT1002 (RtcmMessageGpsL1ObservablesExtended)
- MT1003 (RtcmMessageGpsL1L2Observables)
- MT1004 (RtcmMessageGpsL1L2ObservablesExtended)
- MT1005 (RtcmMessageStationaryArp)
- MT1006 (RtcmMessageStationaryArpHeight)
- MT1007 (RtcmMessageAntennaDescriptor)
- MT1008 (RtcmMessageAntennaDescriptorSerial)
- MT1009 (RtcmMessageGlonassL1Observables)
- MT1010 (RtcmMessageGlonassL1ObservablesExtended)
- MT1011 (RtcmMessageGlonassL1L2Observables)
- MT1012 (RtcmMessageGlonassL1L2ObservablesExtended)
- MT1013 (RtcmMessageAuxiliaryOperationInformation)
- MT1014 (RtcmMessageNetworkAuxiliaryStationData)
- MT1015 (RtcmMessageGpsIonosphericCorrectionDifferences)
- MT1016 (RtcmMessageGpsGeometricCorrectionDifferences)
- MT1017 (RtcmMessageGpsCombinedCorrectionDifferences)
- MT1019 (RtcmMessageGpsSatelliteEphemeris)
- MT1020 (RtcmMessageGlonassSatelliteEphemerisData)
- MT1021 (RtcmMessageHelmertAbridgedMolodenskiTransformationParameters)
- MT1022 (RtcmMessageMolodenskiBadekasTransformationParameters)
- MT1023 (RtcmMessageResidualsEllipsoidalGridRepresentation)
- MT1024 (RtcmMessageResidualsPlaneGridRepresentation)
- MT1025 (RtcmMessageProjectionParametersExceptLcc2spOm)
- MT1026 (RtcmMessageProjectionParametersLcc2sp)
- MT1027 (RtcmMessageProjectionParametersOm)
- MT1029 (RtcmMessageUnicodeTextString)
- MT1030 (RtcmMessageGpsNetworkRtkResidual)
- MT1031 (RtcmMessageGlonassNetworkRtkResidual)
- MT1032 (RtcmMessagePhysicalReferenceStationPosition)
- MT1033 (RtcmMessageReceiverAntennaDescriptor)
- MT1034 (RtcmMessageGpsNetworkFkpGradient)
- MT1035 (RtcmMessageGlonassNetworkFkpGradient)
- MT1037 (RtcmMessageGlonassIonosphericCorrectionDifferences)
- MT1038 (RtcmMessageGlonassGeometricCorrectionDifferences)
- MT1039 (RtcmMessageGlonassCombinedCorrectionDifferences)
- MT1041 (RtcmMessageIrnssSatelliteEphemerisData)
- MT1042 (RtcmMessageBdsSatelliteEphemerisData)
- MT1044 (RtcmMessageQzssSatelliteEphemerisData)
- MT1045 (RtcmMessageGalileoFNavSatelliteEphemerisData)
- MT1046 (RtcmMessageGalileoINavSatelliteEphemerisData)
- MT1057 (RtcmMessageSsrGpsOrbitCorrection)
- MT1058 (RtcmMessageSsrGpsClockCorrection)
- MT1059 (RtcmMessageSsrGpsCodeBias)
- MT1060 (RtcmMessageSsrGpsCombinedCorrection)
- MT1061 (RtcmMessageSsrGpsUra)
- MT1062 (RtcmMessageSsrGpsHighRateClockCorrection)
- MT1063 (RtcmMessageSsrGlonassOrbitCorrection)
- MT1064 (RtcmMessageSsrGlonassClockCorrection)
- MT1065 (RtcmMessageSsrGlonassCodeBias)
- MT1066 (RtcmMessageSsrGlonassCombinedCorrection)
- MT1067 (RtcmMessageSsrGlonassUra)
- MT1068 (RtcmMessageSsrGlonassHighRateClockCorrection)
- MT1071 (RtcmMessageMsm1Gps)
- MT1072 (RtcmMessageMsm2Gps)
- MT1073 (RtcmMessageMsm3Gps)
- MT1074 (RtcmMessageMsm4Gps)
- MT1075 (RtcmMessageMsm5Gps)
- MT1076 (RtcmMessageMsm6Gps)
- MT1077 (RtcmMessageMsm7Gps)
- MT1081 (RtcmMessageMsm1Glonass)
- MT1082 (RtcmMessageMsm2Glonass)
- MT1083 (RtcmMessageMsm3Glonass)
- MT1084 (RtcmMessageMsm4Glonass)
- MT1085 (RtcmMessageMsm5Glonass)
- MT1086 (RtcmMessageMsm6Glonass)
- MT1087 (RtcmMessageMsm7Glonass)
- MT1091 (RtcmMessageMsm1Galileo)
- MT1092 (RtcmMessageMsm2Galileo)
- MT1093 (RtcmMessageMsm3Galileo)
- MT1094 (RtcmMessageMsm4Galileo)
- MT1095 (RtcmMessageMsm5Galileo)
- MT1096 (RtcmMessageMsm6Galileo)
- MT1097 (RtcmMessageMsm7Galileo)
- MT1101 (RtcmMessageMsm1Sbas)
- MT1102 (RtcmMessageMsm2Sbas)
- MT1103 (RtcmMessageMsm3Sbas)
- MT1104 (RtcmMessageMsm4Sbas)
- MT1105 (RtcmMessageMsm5Sbas)
- MT1106 (RtcmMessageMsm6Sbas)
- MT1107 (RtcmMessageMsm7Sbas)
- MT1111 (RtcmMessageMsm1Qzss)
- MT1112 (RtcmMessageMsm2Qzss)
- MT1113 (RtcmMessageMsm3Qzss)
- MT1114 (RtcmMessageMsm4Qzss)
- MT1115 (RtcmMessageMsm5Qzss)
- MT1116 (RtcmMessageMsm6Qzss)
- MT1117 (RtcmMessageMsm7Qzss)
- MT1121 (RtcmMessageMsm1Bds)
- MT1122 (RtcmMessageMsm2Bds)
- MT1123 (RtcmMessageMsm3Bds)
- MT1124 (RtcmMessageMsm4Bds)
- MT1125 (RtcmMessageMsm5Bds)
- MT1126 (RtcmMessageMsm6Bds)
- MT1127 (RtcmMessageMsm7Bds)
- MT1131 (RtcmMessageMsm1Irnss)
- MT1132 (RtcmMessageMsm2Irnss)
- MT1133 (RtcmMessageMsm3Irnss)
- MT1134 (RtcmMessageMsm4Irnss)
- MT1135 (RtcmMessageMsm5Irnss)
- MT1136 (RtcmMessageMsm6Irnss)
- MT1137 (RtcmMessageMsm7Irnss)
- MT1230 (RtcmMessageGlonassL1L2CodePhaseBiases)
Testing
npm test
License
GPLv3
Contributions
Contributions of new message types, bug fixes and general improvements via pull requests are welcome. Please ensure that code style matches that of the existing files.