A java program decoding metar and taf
This java lib provides a Metar and TAF decoder.
This project is divided into multiple maven module
To add the service module :
<dependency>
<groupId>io.github.mivek</groupId>
<artifactId>metarParser-services</artifactId>
<version>latest</version>
</dependency>
Or check here if you are not using maven.
The class diagrams are generated by IntelliJ When updating classes, regenerate the diagrams and save the images in the project.
The application contains numerous enumerations to represent data.
The airport class is composed of
In this application a cloud is composed of
A country is represented by its name.
The icing are only available in TAF and in TAFTrends. It is composed of
The runway information can represent either a visual range or a deposit.
If the object represents a visual range the field minRange
is non-null.
The runway information is composed of
The turbulence are only available in TAF and in TAFTrends. It is composed of:
The visibility class is composed of
The weather condition is class to represent a meteorological phenomenon. A weather condition is composed of
The wind class is composed of
This class is a subclass of Wind. It is composed of
Both METAR and TAF objects have a list of trends
.
For the METAR object the MetarTrend
represents the trend.
For TAF object the trends can be FMTafTrend
, TafTrend
and TafProbTrend
.
It is possible to get a specific type of Trend for TAF with methods:
Trends inherit from AbstractWeatherContainer
so they have the following fields:
By default, airports are loaded from the temporary file airport.dat It is possible to provide your own source of airports via spi. See spi module for details.
Instantiate the metarFacade and use its method parse.
String code = "LFPG 131830Z 19005KT 170V250 9999 -SHRA FEW040TCU SCT086 16/08 Q1011";
MetarService service = MetarService.getInstance();
Metar metar = service.decode(code);
Instantiate the metarFacade. Use the MetarService and its method retrieveFromAirport with the ICAO code of the airport.
String icao = "LFPG";
MetarService service = MetarService.getInstance();
Metar metar = service.retrieveFromAirport(icao);
Use the TAFFacade to decode the taf.
String message = "TAF LFPG 150500Z 1506/1612 17005KT 6000 SCT012 \n"
+"TEMPO 1506/1509 3000 BR BKN006 PROB40 \n"
+"TEMPO 1506/1508 0400 BCFG BKN002 PROB40 \n"
+"TEMPO 1512/1516 4000 -SHRA FEW030TCU BKN040 \n"
+"BECMG 1520/1522 CAVOK \n"
+"TEMPO 1603/1608 3000 BR BKN006 PROB40 \n"
+"TEMPO 1604/1607 0400 BCFG BKN002 TX17/1512Z TN07/1605Z";
TAFService service = TAFService.getInstance();
TAF taf = service.decode(message);
Lines of the message have to be separated by a "\n" character.
Use the TAFFacade and the method retrieveFromAirport with the ICAO code of the airport.
String icao = "LFPG";
TAFService service = TAFService.getInstance();
TAF taf = service.retrieveFromAirport(icao);
The default locale is english. The following locales are also available in the project but may not be fully translated:
To change the locale use the method setLocale(Locale)
of the class Messages.java
Messages.getInstance().setLocale(Locale.FRENCH); // Changes the locale to french.
If you are willing to add a new locale or contribute to the project please see Contributing.md file.
Jetbrains open source project.