Getting AIS into Global Mapper
marky9074
Global Mapper User
in GPS Features
I thought I would share my solution for getting AIS into Global Mapper. Firstly some research was needed to find examples of the sentences that GM was supposed to support. I could only find $PRAVE and $PCDLI ($GPWGT does not see to exist, and I didn't readily find information on $HID sentences). Waypoint NMEA $GPWPL would require more formatting that I was prepared to do.
Example $PRAVE Sentence:
$PRAVE,0001,0001,3308.9051,-11713.1164,195348,1,10,168,31,13.3,3,-83,0,0,,*66
Example $PCDLI Sentence:
$PCDLI,1016,20120406,184012.50,29.8043519295,-95.56066857583,0.9,312.5,-0.5,1.5,-1.2, 2,8,1.1,9,005.5,309.1,0133,20.5,13.2*7F<cr><lf>
So, I had a standard AIS 38400 baud serial connection into the workstation. I then download and configured AISDecoder (http://www.arundale.com/docs/ais/ais_decoder.html). This took some work, as the string needs to be 'tagged' and reformatted. In the end I had the format set as 'GIS filtered' and 'Tagged'. Within the 'Output Tags' I selected the following:
lon_1_2
lat_1_2
mmsi_0_2
vesselname_0_2
receivedtime_0_2
heading_1_2
speed_1_2
course_1_2
To use the tagged format, one has to create a 'Tag Template File'. This was a lot of trial and error, but eventually I worked out the nomenclature and created a formatted string to output, saved as PCDLI.xml, then loaded into AISDecoder:
$PCDLI,[mmsi_0_2],,,[lat_1_2],[lon_1_2],,[heading_1_2],,,,,,,,,[course_1_2],,,
As a test I output to file, and tested the output using the GM 'Read From File (NMEA Format Only)' option. I was very surprised to find that this worked (even though I had seemingly broken the format description by placing the MMSI number in the ID field, which documentation implied was only four characters long). Also worthy of note, is that GM seemingly ignores missing fields, so it is not strict compliance (thankfully!).
Following this, I installed NMEARouter (http://www.arundale.com/docs/ais/nmearouter.html) and created a virtual serial port (configure/VCP/create), then configured AISDecoder to output to UDP (127.0.0.1 port 39421) and in turn configured a UDP input connection within NMEARouter (configure/connection/new). The next bit was a little trial and error.
I had to create a new connection, using the virtual COM port. I could see lots of new ports, but the one that worked was labelled CNCA <-> COM5 (I already had a physical COM4 from a USB to serial adapter). This 'Connection' needs to be set to Input/Output. Then within NMEARouter you need to configure a route (configure/route/new) which is literally pointing the input to the desired output.
All that remains is to hit 'Start' on both AISDecoder & NMEARouter, then configure GM to pick up on the virtual COM port (before this I tested in PuTTy just to make sure I was getting data incoming on the virtual serial port). To my surprise it all worked!!
Example $PRAVE Sentence:
$PRAVE,0001,0001,3308.9051,-11713.1164,195348,1,10,168,31,13.3,3,-83,0,0,,*66
Example $PCDLI Sentence:
$PCDLI,1016,20120406,184012.50,29.8043519295,-95.56066857583,0.9,312.5,-0.5,1.5,-1.2, 2,8,1.1,9,005.5,309.1,0133,20.5,13.2*7F<cr><lf>
So, I had a standard AIS 38400 baud serial connection into the workstation. I then download and configured AISDecoder (http://www.arundale.com/docs/ais/ais_decoder.html). This took some work, as the string needs to be 'tagged' and reformatted. In the end I had the format set as 'GIS filtered' and 'Tagged'. Within the 'Output Tags' I selected the following:
lon_1_2
lat_1_2
mmsi_0_2
vesselname_0_2
receivedtime_0_2
heading_1_2
speed_1_2
course_1_2
To use the tagged format, one has to create a 'Tag Template File'. This was a lot of trial and error, but eventually I worked out the nomenclature and created a formatted string to output, saved as PCDLI.xml, then loaded into AISDecoder:
$PCDLI,[mmsi_0_2],,,[lat_1_2],[lon_1_2],,[heading_1_2],,,,,,,,,[course_1_2],,,
As a test I output to file, and tested the output using the GM 'Read From File (NMEA Format Only)' option. I was very surprised to find that this worked (even though I had seemingly broken the format description by placing the MMSI number in the ID field, which documentation implied was only four characters long). Also worthy of note, is that GM seemingly ignores missing fields, so it is not strict compliance (thankfully!).
Following this, I installed NMEARouter (http://www.arundale.com/docs/ais/nmearouter.html) and created a virtual serial port (configure/VCP/create), then configured AISDecoder to output to UDP (127.0.0.1 port 39421) and in turn configured a UDP input connection within NMEARouter (configure/connection/new). The next bit was a little trial and error.
I had to create a new connection, using the virtual COM port. I could see lots of new ports, but the one that worked was labelled CNCA <-> COM5 (I already had a physical COM4 from a USB to serial adapter). This 'Connection' needs to be set to Input/Output. Then within NMEARouter you need to configure a route (configure/route/new) which is literally pointing the input to the desired output.
All that remains is to hit 'Start' on both AISDecoder & NMEARouter, then configure GM to pick up on the virtual COM port (before this I tested in PuTTy just to make sure I was getting data incoming on the virtual serial port). To my surprise it all worked!!
Tagged:
Comments
-
And here is one of my 'Options' page within AISDecoder:
-
I have now edited the main template file, because I believe GM is decoding the wrong field for COG (so have removed it). GM seems to think that field is SOG (field 17).
$PCDLI,[mmsi_0_2],,,[lat_1_2],[lon_1_2],,[heading_1_2],,,,,,,,,,,,
-
Thanks, you start me to find solutions!
In case could be helpful for someone, i found this:
http://linux.geodatapub.com/shipwebpages/winfrog-all/WinFrog 3.10/Documents/WinFrog 3.10 User's Guide/WFUG App C - Device Documentation/GPS/INStar.pdf
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website