aisstream / issues

7 stars 3 forks source link

Wrong PositionReports #92

Open SylvainGravejat opened 1 month ago

SylvainGravejat commented 1 month ago

Sometimes we see PositionReport messages that are incorrect.

An example I have is a ship moving in the port of Savannah, and then we get 1 wrong position in the port of Norfolk, and then it's back to a correct position.

One minute it's a correct position :

{
   "Message":{
      "PositionReport":{
         "Cog":248.3,
         "CommunicationState":59916,
         "Latitude":32.084983333333334,
         "Longitude":-81.03320833333333,
         "MessageID":1,
         "NavigationalStatus":0,
         "PositionAccuracy":false,
         "Raim":false,
         "RateOfTurn":0,
         "RepeatIndicator":0,
         "Sog":8.5,
         "Spare":0,
         "SpecialManoeuvreIndicator":0,
         "Timestamp":42,
         "TrueHeading":247,
         "UserID":311000922,
         "Valid":true
      }
   },
   "MessageType":"PositionReport",
   "MetaData":{
      "MMSI":311000922,
      "MMSI_String":311000922,
      "ShipName":"CMA CGM MUSCA",
      "latitude":32.084983333333334,
      "longitude":-81.03320833333333,
      "time_utc":"2024-07-30 06:17:43.375540658 +0000 UTC"
   }
}

Next minute it's wrong. Same MMSI, same ship name, but we see the latitude and longitude changed a lot :

{
   "Message":{
      "PositionReport":{
         "Cog":347,
         "CommunicationState":59916,
         "Latitude":36.87421833333334,
         "Longitude":-76.34897166666666,
         "MessageID":3,
         "NavigationalStatus":5,
         "PositionAccuracy":false,
         "Raim":false,
         "RateOfTurn":0,
         "RepeatIndicator":0,
         "Sog":0,
         "Spare":0,
         "SpecialManoeuvreIndicator":0,
         "Timestamp":54,
         "TrueHeading":347,
         "UserID":311000922,
         "Valid":true
      }
   },
   "MessageType":"PositionReport",
   "MetaData":{
      "MMSI":311000922,
      "MMSI_String":311000922,
      "ShipName":"CMA CGM MUSCA",
      "latitude":36.87421833333334,
      "longitude":-76.34897166666666,
      "time_utc":"2024-07-30 06:18:05.211413408 +0000 UTC"
   }
}

And the next minute it's back to a good position again.

Do you know how this happens? It looks like that wrong information is coming directly from the AIS message, but I'm not sure how that could happen. Is it another vessel getting somehow mixed up? I'm just trying to understand these cases better. The end goal for us being to be able to detect and reject these wrong position reports.