MetarWeather Component Reference

Methods

  • Function DecodeMetarLine(lpszMetarLine As String) As Boolean
    This method accept one argument that contains METAR report string. If the METAR string is valid, and the MetarWeather component successfully decodes it, this function returns True value. If the METAR string is not valid, the return value is False.
  • Function GetWeatherData(iWeatherField As WEATHER_FIELD) As String
    This method accept one argument that contains the weather field number, and returns the weather report string according to the field number. You should call this method only after decoding a METAR line with DecodeMetarLine method.
    For example:
    strTemperature = objMetar.GetWeatherData(wfTemperature)
    The above method call returns the temperature value according to the report information in the METAR string you have passed to DecodeMetarLine method. There are 15 different weather field values (0 - 14) that you can pass to GetWeatherData method. Click here to view the details about all weather fields.
  • Function GetWeatherFieldName(iWeatherField As WEATHER_FIELD) As String
    This method accept one argument that contains the weather field number, and returns the field name. For example, calling this method with wfTemperature as argument, returns the string "Temperature".
  • Function GetWeatherIcon() As WEATHER_ICON
    This method returns weather icon index that represents the current weather conditions according to the decoded METAR. For details about the values that this method returns, click here

Properties

  • UnitDistance As UNIT_DISTANCE
    Returns or sets the distance unit that MetarWeather uses to display the visibility and station elevation fields. The default value is unMeter.
    You can set the following values to this property:
    • 1 - unMeter
    • 2 - unKilometer
    • 3 - unFeet
    • 4 - unMile
  • UnitPrecipitation As UNIT_PREC
    Returns or sets the precipitation unit that MetarWeather uses to display precipitation amounts.
    You can set the following values to this property:
    • 41 - unPrecMillimeter
    • 42 - unPrecCentimeter
    • 43 - unPrecInch
  • UnitPressure As UNIT_PRESSURE
    Returns or sets the pressure unit that MetarWeather uses to display the barometric pressure.
    You can set the following values to this property:
    • 21 - unMilibar
    • 22 - unMillimeterMercury
    • 23 - unInchOfMercury
  • UnitTemperature As UNIT_TEMPERATURE
    Returns or sets the temperature unit that MetarWeather uses to display temperature and dew point values.
    You can set the following values to this property:
    • 11 - unCelcius
    • 12 - unFahrenheit
  • UnitWinds As UNIT_WINDS
    Returns or sets the speed unit that MetarWeather uses to display wind speed.
    You can set the following values to this property:
    • 31 - unMeterPerSecond
    • 32 - unKilometerPerHour
    • 33 - unKnot
    • 34 - unMilePerHour
  • UnitTime As UNIT_TIME
    Returns or sets the time unit that MetarWeather uses to display the report time.
    You can set the following values to this property:
    • 0 - unGMT
    • 10000 - unLocalTime
  • MultiValuesMode As MULTI_VALUES_MODE
    This property determines how to display weather information with multiples values. It only affects the following fields: Sky Condition (wfSkyCondition = 12), Weather (wfWeather = 13), and Remarks (wfRemarks = 14).
    You can set the following values to this property:
    • 1 - mvCommaDelimited: (Default) The values are separated by comma.
    • 2 - mvLineBreakDelimited: The values are separated by HTML line break. (<BR> tag)
      This value is useful for using in ASP script.
    • 3 - mvCRLFDelimited: The values are separated by CR-LF characters.

Weather Fields

Both GetWeatherData and GetWeatherFieldName methods accept the weather field index as argument. The following table contains a small description about each weather field. Be aware that on ASP page, you can only use the numeric values, not the Constants. On Visual Basic, you can only use the Constants if you add a reference to mweather.dll
ConstantNumeric ValueDescription
wfICAO 0 The ICAO of the station
wfStationName 1 The name of the station. This value is extracted from the internal stations list inside mweather.dll
wfCountry 2 The name of the country. This value is extracted from the internal stations list inside mweather.dll
wfLocation 3 The location of the station (latitude / longitude). This value is extracted from the internal stations list inside mweather.dll
wfElevation 4 The elevation of the station. This value is extracted from the internal stations list inside mweather.dll
wfTime 5 The time that this weather report was issued. The format of this field is: dd/hh:mm
dd is the day of the month, hh is hour of the day (00 - 23), and mm are the minutes of hour (00 - 59)
wfTemperature 6 The temperature.
wfDewPoint 7 The dew point.
wfRelativeHumidity 8 Relative Humidity.
wfWind 9 Wind speed and direction.
wfVisibility 10 Visibility.
wfPressure 11 Barometric Pressure.
wfSkyCondition 12 Description of cloud layers. For example: Scattered Cumulonimbus clouds at 1000m, Broken clouds at 1600m, and so on.
If there is more than one value in this field, the values are separated according to MultiValuesMode property.
wfWeather 13 Weather phenomenons observed in the station. For example: Thunderstorm, Rain, Haze, Fog, and so on...
If there is more than one value in this field, the values are separated according to MultiValuesMode property.
wfRemarks 14 Additional information about the current weather as appeared in the remark section of the METAR report. For Example: Thunderstorm Moving N, Occasional Cloud To Ground Lightnings, and so on.
If there is more than one value in this field, the values are separated according to MultiValuesMode property.

Weather Icons Numbers Returned By GetWeatherIcon()

ConstantNumeric ValueIcon Description
wiClear 1 Clear Skies
wiPartlySunny 2 Partly Sunny
wiPartlyCloudy 3 Partly Cloudy
wiMostlyCloudy 4 Mostly Cloudy
wiCloudy 5 Cloudy
wiRain 6 Rain
wiThunder 7 Thunder (Without Rain)
wiRainWithThunder 8 Rain With Thunder
wiPartlyCloudyThunder 9 Partly Cloudy And Thunder
wiPartlyCloudyRainThunder 10 Partly Cloudy And Rain With Thunder
wiPartlyCloudyRain 11 Partly Cloudy And Rain
wiSnow 12 Snow
wiFog 13 Fog
wiHaze 14 Haze