aisstream / issues

8 stars 3 forks source link

Json data labels - a few issues #91

Open alannz42 opened 3 months ago

alannz42 commented 3 months ago

Issue1:

{"MessageID": 24, "PartNumber": false, "RepeatIndicator": 0, "ReportA": {"Name": "CITY CAT", "Valid": true}, "ReportB": {"CallSign": "", "Dimension": {"A": 0, "B": 0, "C": 0, "D": 0}, "FixType": 0, "ShipType": 0, "Spare": 0, "Valid": false, "VenderIDModel": 0, "VenderIDSerial": 0, "VendorIDName": ""}, "Reserved": 0, "UserID": 512003252, "Valid": true}

Vendor spelt wrong (twice).

Issue2:

{"AisVersion": 2, "CallSign": "ZMF2099", "Destination": "PORT NELSON ", "Dimension": {"A": 12, "B": 12, "C": 5, "D": 6}, "Dte": false, "Eta": {"Day": 18, "Hour": 8, "Minute": 0, "Month": 2}, "FixType": 1, "ImoNumber": 9806031, "MaximumStaticDraught": 5.5, "MessageID": 5, "Name": "HURIA MATENGA II ", "RepeatIndicator": 0, "Spare": false, "Type": 52, "UserID": 512007650, "Valid": true}

{"MessageID": 24, "PartNumber": false, "RepeatIndicator": 0, "ReportA": {"Name": "SEAPATROLLER ", "Valid": true}, "ReportB": {"CallSign": "", "Dimension": {"A": 0, "B": 0, "C": 0, "D": 0}, "FixType": 0, "ShipType": 0, "Spare": 0, "Valid": false, "VenderIDModel": 0, "VenderIDSerial": 0, "VendorIDName": ""}, "Reserved": 0, "UserID": 512000183, "Valid": true}

In message 24 the ship type is "ShipType". In message 5 the ship type is "Type". It would be good to be consistent as it makes the decoding much easier.

In message 21 there is also "Type". Is it "Type of aids-to-navigation" or "Type of electronic position fixing device"?

It would be good to use unique and meaningful json labels for each type of data (like "AtoNtype").

Issue 3:

Some ships have an apostrophe in their name. Example 'MA' ARA' mmsi 512004558. This causes the json decoder to crash. Quotes in strings need to be escaped (like 'MA \' ARA').

Thank you for your work on such a useful and interesting project. Alan

alannz42 commented 3 months ago

It lost my escape there, lets try 'MA \' ARA'.