0

I want to work with a JSON file which is generated from one of the software. But the generated JSON file is unwrapped JSON objects. There is no comma separation. I cannot read the file in python and getting an error of Extra data: line 2 column 1 (char 784) mycode is

import json
filename = "swift-gnss-20230308-161315.sbp.json"
with open(filename) as jFile:
    data = json.loads(jFile.read())
    print(data)

This is sample data from json file.

{"crc":9965,"length":50,"msg_type":167,"payload":"WgBydGNtX291dABvdXRwdXRfbW9kZQBNU001AGVudW06TGVnYWN5LE1TTTQsTVNNNQA=","preamble":85,"sender":29000,"index":90,"setting":"rtcm_out\u0000output_mode\u0000MSM5\u0000enum:Legacy,MSM4,MSM5\u0000"}
{"crc":44339,"length":11,"msg_type":258,"payload":"AACcjxoAAAAAAAA=","preamble":85,"sender":29000,"wn":0,"tow":1740700,"ns_residual":0,"flags":0}
{"crc":20832,"length":16,"msg_type":259,"payload":"AJyPGgC8BwEGAB0AACe5KQ==","preamble":85,"sender":29000,"flags":0,"tow":1740700,"year":1980,"month":1,"day":6,"hours":0,"minutes":29,"seconds":0,"ns":700000000}
{"crc":38858,"length":34,"msg_type":522,"payload":"nI8aAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==","preamble":85,"sender":29000,"tow":1740700,"lat":0.0,"lon":0.0,"height":0.0,"h_accuracy":0,"v_accuracy":0,"n_sats":0,"flags":0}
{"crc":54564,"length":22,"msg_type":526,"payload":"nI8aAAAAAAAAAAAAAAAAAAAAAAAAAA==","preamble":85,"sender":29000,"tow":1740700,"n":0,"e":0,"d":0,"h_accuracy":0,"v_accuracy":0,"n_sats":0,"flags":0}
{"crc":54781,"length":15,"msg_type":520,"payload":"nI8aAAAAAAAAAAAAAAAA","preamble":85,"sender":29000,"tow":1740700,"gdop":0,"pdop":0,"tdop":0,"hdop":0,"vdop":0,"flags":0}
{"crc":65512,"length":22,"msg_type":524,"payload":"nI8aAAAAAAAAAAAAAAAAAAAAAAAAAA==","preamble":85,"sender":29000,"tow":1740700,"n":0,"e":0,"d":0,"h_accuracy":0,"v_accuracy":0,"n_sats":0,"flags":0}

How can I extract lat and lon from msg_type is 522?

0 Answers0