Package org.ka2ddo.aprs
Class NWSMultiLine
java.lang.Object
org.ka2ddo.aprs.NWSMultiLine
- All Implemented Interfaces:
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:
letter | color | line type | meaning |
---|---|---|---|
a | red | solid | tornado warning |
b | red | dashed | tornado watch |
c | red | double-dashed | |
d | yellow | solid | severe thunderstorm warning |
e | yellow | dashed | severe thunderstorm watch |
f | yellow | double-dashed | |
g | blue | solid | test warning |
h | blue | dashed | test watch |
i | blue | double-dashed | |
j | green | solid | |
k | green | dashed | mesoscale discussion area |
l | green | double-dashed | |
m | orange | wide solid | Aloha circle for YAAC |
n | orange | wide dashed | incomplete Aloha circle for YAAC |
The next byte indicates the type of figure:
character | meaning |
---|---|
0 | closed polygon |
1 | line segment |
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
Modifier and TypeFieldDescriptionchar
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
ModifierConstructorDescriptionprotected
NWSMultiLine
(double[] lats, double[] lons, boolean isClosed) Create an NWSMultiLine data structure from a set of latitude/lomgitude points. -
Method Summary
Modifier and TypeMethodDescriptionstatic NWSMultiLine
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
isClosed()
Test whether this is a polyline or polygon.toString()
Returns a string representation of the object.
-
Field Details
-
dataType
public char dataTypeThe extracted data type for the MultiLine polygon. -
lineType
public char lineTypeIndicates whether closed polygon or open polyline. -
scale
public char scaleScale factor character. -
lats
public int[] latsArray of decoded latitudes in millionths of degrees North, -
lons
public int[] lonsArray 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 Northlons
- array of longitudes in fractional degrees EastisClosed
- boolean true if this is for a closed polygon, false for open polyline
-
-
Method Details
-
extract
Extract an NWSMultiLine from the specified position in a PositionMessage's comment.- Parameters:
pm
- PositionMessage to extract reference latitude and longitude frombody
- byte array of AX.25 message bodyoffset
- 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
Create an ObjectReport containing the encoding of this NWSMultiLine.- Parameters:
name
- name to assign to the ObjectsymTableId
- APRS symbol table ID (or overlay character) to associate with the ObjectsymbolCode
- APRS symbol code to associated with the ObjectfreeText
- free-text comment to append to the Object report- Returns:
- constructed transmittable ObjectReport
-
toString
Returns a string representation of the object.
-