All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.esi.metis.aisparser.UtilsNavStatus Maven / Gradle / Ivy

Go to download

This package supports the parsing of AIS messages in Java. AIS, the Automatic Identification System, is a system aiming at improving maritime safety by exchanging messages between ships, other vehicles in particular aircraft involved in search-and-rescue (SAR), and (fixed) base stations. To be precise, this package support the ITU-R M.1371-4 AIS standard. See our extensive javadoc and in particular the class AISParser for more information on how to use this package. The parser was used in the Poseidon project, and is improved in the Metis project to better handle uncertain information. Both projects were led by the Embedded Systems Institute. In both projects Thales Nederlands was the carrying industrial partner, and multiple Dutch universities participated.

The newest version!
package nl.esi.metis.aisparser;
/* ESI AIS Parser
 * 
 * Copyright 2011/2012 by Pierre van de Laar, Pierre America (Embedded Systems Institute)
 * Copyright 2008 by Brian C. Lane 
 * All Rights Reserved
 */

/** This class provides a method to analyze the navigational status as returned by 
 * {@link AISMessagePositionReport#getNavigationalStatus()} or {@link AISMessage27#getNavigationalStatus()}.
 * @author Pierre van de Laar
 * @author Pierre America
 */
public class UtilsNavStatus {

	/** This array keeps the string values corresponding to the navigational status integer values. */
	final static private String[] navStatString = {
		"under way using engine",				// 0
		"at anchor",							// 1
		"not under command",					// 2
		"restricted manoeuvrability",			// 3
		"constrained by her draught",			// 4
		"moored",								// 5
		"aground",								// 6
		"engaged in fishing",					// 7
		"under way sailing",					// 8
		"reserved for future amendment",		// 9
		"reserved for future amendment",		//10
		"reserved for future use",				//11
		"reserved for future use",				//12
		"reserved for future use",				//13
		"AIS-SART (active)",					//14
		"not defined"							//15
};
	
	/** Returns a text string describing the navigational status. 
	 * @param navigationalStatus an integer value describing the navigational status as returned by 
     * {@link AISMessagePositionReport#getNavigationalStatus()} or {@link AISMessage27#getNavigationalStatus()}.
	 * @return a text string describing the navigational status
	 */
	public static String toString(int navigationalStatus) {
		assert (navigationalStatus >= 0 && navigationalStatus <=15);
		return navStatString [navigationalStatus];
	}
	
	/** Not all values are allowed by the standard (yet).
	 * Determines whether the provided value is currently allowed.
	 * @param navigationalStatus
	 * @return Is the provided navigationalStatus semantically correct?
	 */
	public static boolean isNavStatusSemanticallyCorrect( int navigationalStatus )
	{
		return (0 <= navigationalStatus ) && ( navigationalStatus <= 15) &&
			   !( ( 9 <= navigationalStatus ) && ( navigationalStatus <= 13 ) );	//Reserved values should not be used, and are thus considered invalid
	}
	
	/** semantically correct range of navigationalStatus
	 * 
	 */
	public static final String range = "[0,8] + [14,15]";
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy