AIS to KML LCDR Rich Morrison rbmorrisnps edu
AIS to KML LCDR Rich Morrison rbmorris@nps. edu 18 Sep 2009 MV 4250 – Advanced XML
Overview • Automatic Information Service (AIS) – USCG AIS website: http: //www. navcen. uscg. gov/enav/ais/default. htm • AIS is a binary format specification – AIS is intended to assist the vessel's watchstanding officers and allow maritime authorities to track and monitor vessel movements • AIS Receiver at NPS can produce logfile. txt • Python source code from Prof. Kurt Schwehr at UNH – Transform AIS input to KML, HTML output. • Python extension code from LCDR Morrison – Extends source code above to convert AIS logfile to XML – Allows AIS input to Tactical Data Conversion Hub – Code located at: • AISpython sourcenoaadata-py-0. 43aismv 4250_AISto. XMLconverter. py
Example AIS Position Message • AIS message type 1: ais_msg_1. html • AIS message type 2: ais_msg_2. html • AIS message type 3: ais_msg_3. html
AIS-KML Method • AIS input: AIS log 080901. txt – obtained from the NPS AIS feed – POC: John Joseph at NPS: jejoseph@nps. edu • Python code reads logfile and transforms to KML – KML file includes position reports for one vessel ID – logfile. txt contains 24 hours of data • The HTML description of each position point was also generated by the python code.
AIS-KML Output
AIS-KML Output
AIS-KML Output (HTML view)
AIS-XML • Prof. Kurt Schwehr version: ais. xsd • LCDR Morrison version: AIS-XML. xsd • Other queries for AIS-XML have no responses.
Sample AIS-XML <? xml version="1. 0" encoding="UTF-8"? > <!--Sample XML file generated by XMLSpy v 2008 rel. 2 sp 2 (http: //www. altova. com)--> <tns: ais-messages xsi: schema. Location="http: //xml. netbeans. org/schema/AIS-XML. xsd" xmlns: xsi="http: //www. w 3. org/2001/XMLSchema-instance" xmlns: tns="http: //xml. netbeans. org/schema/AIS-XML"> <tns: ais-message titlefield="219145000" name="position" aismsgnum="2"> <tns: Message. ID Units="Unsigned integer: 1 -3" Type="uint" Number. Of. Bits="6">1</tns: Message. ID> <tns: Repeat. Indicator Units="1 = repeat, 3 = Do not repeat" Type="uint" Number. Of. Bits="2">0</tns: Repeat. Indicator> <tns: User. ID Units="Unsigned integer: 9 digits" Type="uint" Number. Of. Bits="30">219145000</tns: User. ID> <tns: Navigation. Status Units="Navigation status codes" Type="uint" Number. Of. Bits="4">0</tns: Navigation. Status> <tns: ROT Units=“degrees/minute” Type="int" Number. Of. Bits="8">0</tns: ROT> <tns: SOG Units="knots" Type="udecimal" Number. Of. Bits="10">22. 1</tns: SOG> <tns: Position. Accuracy Units=“ 1 indicates a DGPS-quality fix with an accuracy of < 10 ms. 0, the default, indicates an unaugmented GNSS fix with accuracy > 10 m. " Type="uint" Number. Of. Bits="1">0</tns: Position. Accuracy> <tns: longitude Units=“degrees, East + and West -" Type="decimal" Number. Of. Bits="28">-121. 826965</tns: longitude> <tns: latitude Units=“degrees, North +, South -" Type="decimal" Number. Of. Bits="27">35. 2175433333333333</tns: latitude> <tns: COG Units="Course over ground will be 3600 (0 x. E 10) if that data is not available. " Type="udecimal" Number. Of. Bits="12">325</tns: COG> <tns: True. Heading Units="True heading (relative to true North)" Type="uint" Number. Of. Bits="9">325</tns: True. Heading> <tns: Time. Stamp Units="seconds" Type="uint" Number. Of. Bits="6">18</tns: Time. Stamp> <tns: Regional. Reserved Units="String" Type="uint" Number. Of. Bits="4">0</tns: Regional. Reserved> <tns: Spare Units="String" Type="uint" Number. Of. Bits="1">0</tns: Spare> <tns: RAIM Units="boolean" Type="uint" Number. Of. Bits="1">false</tns: RAIM> <tns: state_syncstate Units="frames" Type="uint" Number. Of. Bits="2">0</tns: state_syncstate> <tns: state_slottimeout Units="frames" Type="uint" Number. Of. Bits="3">3</tns: state_slottimeout> <tns: state_slotoffset Units="String" Type="uint" Number. Of. Bits="14">29</tns: state_slotoffset> </tns: ais-messages>
Issues • AIS spec is proprietary • No direct AIS-binary to AIS-XML yet. • Incomplete understanding of AIS spec leads to potential for inaccurate transformation. • No standard for AIS-XML schema defined. – Currently using self-generated schema for position reports ( AIS message types 1, 2, 3 )
References • AIS format notes from specification. By far the most complete reference I've found for this project: AIVDM. txt – – – Author: Kurt Schwehr Home Page: http: //vislab-ccom. unh. edu/~schwehr/software/noaadata Download URL: http: //vislab-ccom. unh. edu/~schwehr/software/noaadata/downloads/noaadata-py-0. 43. tar. bz 2 Keywords: axis, soap, marine, NOAA, AIS, N-AIS, binary messages, NMEA License: GPL v 3 Platform: All platforms • USCG AIS website: http: //www. navcen. uscg. gov/enav/ais/default. htm • NOAA AIS information: – diagram: http: //celebrating 200 years. noaa. gov/visions/nautical_charts/image 3. html – Web Services for data: http: //opendap. co-ops. noaa. gov/axis/
References http: //www. navicon. dk/ais - This provides a class interface for handling AIS messages encoded in NMEA 0183 VDM and VDO messages. Does not produce XML output http: //www. itu. int/rec/R-REC-M. 1371/e - The M. 1371 provides technical characteristics for an automatic identification system using time division multiple access (TDMA) in the VHF maritime mobile band. This is a link to the current document in force. http: //site. ialathree. org/pages/publications/docpdf/ais/A 124. PDF -IALA Recommendation A-124 on Automatic Identification System (AIS) Shore Station and Networking Aspected relating to the AIS Service Edition 1. 1 December 2003.
References AIS Java Decoder - sourceforge open-source project AIS message decoder package. Decodes AIS 6 bit ascii encoded messages into information for AIS usage. http: //grou. ps/aisdecoder http: //aisdecoder. sourceforge. net
- Slides: 13