ais-dotnet / Ais.Net.Receiver

A simple .NET AIS Receiver for capturing the Norwegian Coastal Administration AIS network data (available under Norwegian license for public data (NLOD)) and persisting in Microsoft Azure Blob Storage. Sponsored by endjin.
Apache License 2.0
16 stars 12 forks source link

Add support for Message Types 4 and 21 #158

Open tkreyche opened 2 years ago

tkreyche commented 2 years ago

How about adding support for Message types 4 and 21? These fixed location messages may not be as interesting as mobile, but are important for shipboard navigation. Unclear to me if this app/library was mostly designed as a land-based application. Also I'm using them to study VHF propagation changes.

Currently I'm using python and pyais but my python expertise is not great, and python appears to have less mature support for threading, multiprocessing etc.

idg10 commented 2 years ago

As with #152, the general rule is that if we don't support a message type it's because we don't have real world examples of them.

Unclear to me if this app/library was mostly designed as a land-based application

Not by design. It's just that nobody has previously expressed an interest in these message types, and we have not encountered them in any of the sources we use for test data.

So far, when we add the tests for message types, in addition to creating synthetic examples we have also incorporated real messages. I don't have a source for types 4 or 21. We need the sources to be something we can incorporate in the repository without intellectual property issues. (A lot of the sources of AIS data have stringent rules for you can do with messages from them.)

Do you know of a source of example messages that would enable us to copy suitable exemplars into this repository?

tkreyche commented 2 years ago

My fixed station is in Seattle, Washington USA. From my location I receive messages from about 25x Type 4 stations and 25x Type 21 stations. At the moment I'm not saving raw messages (only decoded), but I'll start saving them to file and send them to you after a few days of accumulation. Thanks for all your continuing work on this project!

tkreyche commented 2 years ago

I just started saving the raw NMEA for message types 4 and 21, here are a few samples, I presume this will be ok:

!AIVDM,1,1,,A,ENkb9TfaSh@@@@@@@@@@@@@@@@@;Wdo0=`e>H00003vP000,0*09
!AIVDM,1,1,,A,403OwpivJFhlDo=sgrK=BTO02H<<,0*5B
!AIVDM,1,1,,B,403OwpivJFhlDo=sgrK=BTO02H<>,0*5A
!AIVDM,1,1,,B,403OvjivJFhlEo?upDK>h5w02<6n,0*3B
!AIVDM,1,1,,B,ENkb9MNb0h@@@@@@@@@@@@@@@@@;Wm`w=Tjw000003vP000,0*10
!AIVDM,1,1,,A,403Ot`1vJFhlFo=sefK=BT?02<BT,0*16
!AIVDM,1,1,,A,ENkb9TfaSh@@@@@@@@@@@@@@@@@;Wdo0=`e>H00003vP000,0*09
!AIVDM,1,1,,B,ENkb9TfaSh@@@@@@@@@@@@@@@@@;Wdo0=`e>H00003vP000,0*0A
!AIVDM,1,1,,A,ENkb9MNb0h@@@@@@@@@@@@@@@@@;Wm`w=Tjw000003vP000,0*13
!AIVDM,1,1,,B,E>kb:Ew0Wh@@@@@@@@@@@@@@@@@;`<mR=fW=P00003vP100,0*0D
mwadams commented 2 years ago

Thanks for that.

We just need you to verify the source and the license agreement that you have for the data from that source before we can use it as part of the project.

Most sources have explicit licensing and we can't use commercially sourced data without a suitable license.

tkreyche commented 2 years ago

I'm receiving the data directly from the broadcasting stations. It is not coming through any 3rd party data acquisition or aggregation sites. According to https://unstats.un.org/wiki/display/AIS/Overview+of+AIS+dataset "AIS messages are considered in the public domain" I'm making this data collected directly from my station available freely and without any licensing restrictions whatsoever.

HowardvanRooijen commented 2 years ago

I just started saving the raw NMEA for message types 4 and 21, here are a few samples, I presume this will be ok:

!AIVDM,1,1,,A,ENkb9TfaSh@@@@@@@@@@@@@@@@@;Wdo0=`e>H00003vP000,0*09
!AIVDM,1,1,,A,403OwpivJFhlDo=sgrK=BTO02H<<,0*5B
!AIVDM,1,1,,B,403OwpivJFhlDo=sgrK=BTO02H<>,0*5A
!AIVDM,1,1,,B,403OvjivJFhlEo?upDK>h5w02<6n,0*3B
!AIVDM,1,1,,B,ENkb9MNb0h@@@@@@@@@@@@@@@@@;Wm`w=Tjw000003vP000,0*10
!AIVDM,1,1,,A,403Ot`1vJFhlFo=sefK=BT?02<BT,0*16
!AIVDM,1,1,,A,ENkb9TfaSh@@@@@@@@@@@@@@@@@;Wdo0=`e>H00003vP000,0*09
!AIVDM,1,1,,B,ENkb9TfaSh@@@@@@@@@@@@@@@@@;Wdo0=`e>H00003vP000,0*0A
!AIVDM,1,1,,A,ENkb9MNb0h@@@@@@@@@@@@@@@@@;Wm`w=Tjw000003vP000,0*13
!AIVDM,1,1,,B,E>kb:Ew0Wh@@@@@@@@@@@@@@@@@;`<mR=fW=P00003vP100,0*0D

Hi!

We currently have a sample dataset in https://github.com/ais-dotnet/Ais.Net/blob/master/ExampleData/ais.kystverket.no/Ais1000Lines.nm4 - this is Norwegian Costal Administration data released under the Norwegian licence for Open Government data (NLOD).

Once you've collected some sample data, would you be able to issue a PR into that parent ExampleData folder - this will trigger requiring you to accept the Contribution License Agreement (CLA) - which is managed automatically by a bot. If you could add a license / note saying this data was collected using your receiver, that would be great.

The data needs to be in https://github.com/ais-dotnet/Ais.Net as that's where the high-performance parser repo, whereas this repo containers a Receiver and a set of higher-level domain models for ease of use, but add a performance overhead over the raw data types in the Ais.NET repo.

Once the PR is accepted, we'll implement the message types, and then once that update has been published, we'll update this repo to contain the new message types.

If there's any chance you could capture some type 27 messages, that would also help us close this issue https://github.com/ais-dotnet/Ais.Net.Receiver/issues/152

Many thanks!

Howard

tkreyche commented 1 year ago

I've got the 4 and 21 data but need to run out of town for a week, will issue a PR with it when I get back.

Also am seeing very few 27 messages and they seem to be malformed....need to run the capture for a longer period of time to see what surfaces.

HowardvanRooijen commented 1 year ago

Did you manage to capture any data you can share @tkreyche?

HowardvanRooijen commented 1 year ago

Did you manage to capture any data you can share @tkreyche?

Just another ping @tkreyche to see if you've managed to capture any data we can use to implement these message types?