Class NWSMultiLine

java.lang.Object
org.ka2ddo.aprs.NWSMultiLine
All Implemented Interfaces:
Serializable

public class NWSMultiLine extends Object implements Serializable
This class defines the lat/lon data within a NWS MultiLine encoded poly-figure. It can extract a MultiLine object from a PositionMessage's raw data.

The first two bytes are space and '}'. The next byte is a code for the type of data to plot:

lettercolorline typemeaning
aredsolidtornado warning
breddashedtornado watch
creddouble-dashed
dyellowsolidsevere thunderstorm warning
eyellowdashedsevere thunderstorm watch
fyellowdouble-dashed
gbluesolidtest warning
hbluedashedtest watch
ibluedouble-dashed
jgreensolid
kgreendashedmesoscale discussion area
lgreendouble-dashed
morangewide solidAloha circle for YAAC
norangewide dashedincomplete Aloha circle for YAAC
NWS Multiline display codes

The next byte indicates the type of figure:

charactermeaning
0closed polygon
1line segment
Figure type codes

The next byte indicates the scale value for the offsets relative to the record's position values.
Scale character (ascii value) = (integer(log to base 10 of the scale factor relative to .0001 degree) X 20 ) + 33

For more information, see https://www.aprs-is.net/WX/MultilineProtocol.aspx

Note that NWSMultiLine does not work for polygons and polylines spanning the International Date Line.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    char
    The extracted data type for the MultiLine polygon.
    int[]
    Array of decoded latitudes in millionths of degrees North,
    char
    Indicates whether closed polygon or open polyline.
    int[]
    Array of decoded longitudes in millionths of degrees East.
    char
    Scale factor character.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
     
    NWSMultiLine(double[] lats, double[] lons, boolean isClosed)
    Create an NWSMultiLine data structure from a set of latitude/lomgitude points.
  • Method Summary

    Modifier and Type
    Method
    Description
    extract(PositionMessage pm, byte[] body, int offset)
    Extract an NWSMultiLine from the specified position in a PositionMessage's comment.
    generateMessage(String name, char symTableId, char symbolCode, String freeText)
    Create an ObjectReport containing the encoding of this NWSMultiLine.
    boolean
    Test whether this is a polyline or polygon.
    Returns a string representation of the object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • dataType

      public char dataType
      The extracted data type for the MultiLine polygon.
    • lineType

      public char lineType
      Indicates whether closed polygon or open polyline.
    • scale

      public char scale
      Scale factor character.
    • lats

      public int[] lats
      Array of decoded latitudes in millionths of degrees North,
    • lons

      public int[] lons
      Array of decoded longitudes in millionths of degrees East.
  • Constructor Details

    • NWSMultiLine

      protected NWSMultiLine()
    • NWSMultiLine

      public NWSMultiLine(double[] lats, double[] lons, boolean isClosed)
      Create an NWSMultiLine data structure from a set of latitude/lomgitude points.
      Parameters:
      lats - array of latitudes in fractional degrees North
      lons - array of longitudes in fractional degrees East
      isClosed - boolean true if this is for a closed polygon, false for open polyline
  • Method Details

    • extract

      public static NWSMultiLine extract(PositionMessage pm, byte[] body, int offset)
      Extract an NWSMultiLine from the specified position in a PositionMessage's comment.
      Parameters:
      pm - PositionMessage to extract reference latitude and longitude from
      body - byte array of AX.25 message body
      offset - starting position in body array where NWSMultiLine encoding begins
      Returns:
      decoded NWSMultiLine, or null if specified message position does not contain a NWSMultiLine
    • isClosed

      public boolean isClosed()
      Test whether this is a polyline or polygon.
      Returns:
      boolean true if a closed polygon
    • generateMessage

      public ObjectReport generateMessage(String name, char symTableId, char symbolCode, String freeText)
      Create an ObjectReport containing the encoding of this NWSMultiLine.
      Parameters:
      name - name to assign to the Object
      symTableId - APRS symbol table ID (or overlay character) to associate with the Object
      symbolCode - APRS symbol code to associated with the Object
      freeText - free-text comment to append to the Object report
      Returns:
      constructed transmittable ObjectReport
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.