org.ka2ddo.aprs
Class NWSMultiLine

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

public class NWSMultiLine
extends java.lang.Object
implements java.io.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 http://www.aprs-is.net/WX/MultilineProtocol.aspx

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

See Also:
Serialized Form

Field Summary
 char dataType
          The extracted data type for the MultiLine polygon.
 int[] lats
          Array of decoded latitudes in millionths of degrees North,
 char lineType
          Indicates whether closed polygon or open polyline.
 int[] lons
          Array of decoded longitudes in millionths of degrees East.
 char scale
          Scale factor character.
 
Constructor Summary
protected NWSMultiLine()
           
  NWSMultiLine(double[] lats, double[] lons, boolean isClosed)
          Create an NWSMultiLine data structure from a set of latitude/lomgitude points.
 
Method Summary
static NWSMultiLine extract(PositionMessage pm, byte[] body, int offset)
          Extract an NWSMultiLine from the specified position in a PositionMessage's comment.
 ObjectReport generateMessage(java.lang.String name, char symTableId, char symbolCode, java.lang.String freeText)
          Create an ObjectReport containing the encoding of this NWSMultiLine.
 boolean isClosed()
          Test whether this is a polyline or polygon.
 java.lang.String toString()
          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 Detail

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 Detail

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 Detail

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(java.lang.String name,
                                    char symTableId,
                                    char symbolCode,
                                    java.lang.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 java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.