2 Copyright (C) 2001, 2006 United States Government as represented by
3 the Administrator of the National Aeronautics and Space Administration.
6 package gov
.nasa
.worldwind
.formats
.rpf
;
8 import gov
.nasa
.worldwind
.*;
11 import static java
.util
.logging
.Level
.*;
15 * @version $Id: RpfDataSeries.java 1762 2007-05-07 19:43:55Z dcollins $
17 public enum RpfDataSeries
19 /* [Section 5.1.4, MIL-STD-2411-1] */
20 DataSeriesGN("GN", "GNC", "1:5,000,000", "Global Navigation Chart", "CADRG", 5000000),
21 DataSeriesJN("JN", "JNC", "1:2,000,000", "Jet Navigation Chart", "CADRG", 2000000),
22 DataSeriesOH("OH", "VHRC", "1:1,000,000", "VFR Helicopter Route Chart", "CADRG", 1000000),
23 DataSeriesON("ON", "ONC", "1:1,000,000", "Operational Navigation Chart", "CADRG", 1000000),
24 DataSeriesOW("OW", "WAC", "1:1,000,000", "High Flying Chart - Host Nation", "CADRG", 1000000),
25 DataSeriesTP("TP", "TPC", "1:500,000", "Tactical Pilotage Chart", "CADRG", 500000),
26 DataSeriesLF("LF", "LFC-FR (Day)", "1:500,000", "Low Flying Chart (Day)- Host Nation", "CADRG", 500000),
27 DataSeriesL1("L1", "LFC-1", "1:500,000", "Low Flying Chart (TBD #1)", "CADRG", 500000),
28 DataSeriesL2("L2", "LFC-2", "1:500,000", "Low Flying Chart (TBD #2)", "CADRG", 500000),
29 DataSeriesL3("L3", "LFC-3", "1:500,000", "Low Flying Chart (TBD #3)", "CADRG", 500000),
30 DataSeriesL4("L4", "LFC-4", "1:500,000", "Low Flying Chart (TBD #4)", "CADRG", 500000),
31 DataSeriesL5("L5", "LFC-5", "1:500,000", "Low Flying Chart (TBD #5)", "CADRG", 500000),
32 DataSeriesLN("LN", "LFC (Night)", "1:500,000", "Low Flying Chart (Night) - Host Nation", "CADRG", 500000),
33 DataSeriesJG("JG", "JOG", "1:250,000", "Joint Operations Graphic", "CADRG", 250000),
34 DataSeriesJA("JA", "JOG-A", "1:250,000", "Joint Operations Graphic - Air", "CADRG", 250000),
35 DataSeriesJR("JR", "JOG-R", "1:250,000", "Joint Operations Graphic - Radar", "CADRG", 250000),
36 DataSeriesJO("JO", "OPG", "1:250,000", "Operational Planning Graphic", "CADRG", 250000),
37 DataSeriesVT("VT", "VTAC", "1:250,000", "VFR Terminal Area Chart", "CADRG", 250000),
38 DataSeriesF1("F1", "TFC-1", "1:250,000", "Transit Flying Chart (TBD #1)", "CADRG", 250000),
39 DataSeriesF2("F2", "TFC-2", "1:250,000", "Transit Flying Chart (TBD #2)", "CADRG", 250000),
40 DataSeriesF3("F3", "TFC-3", "1:250,000", "Transit Flying Chart (TBD #3)", "CADRG", 250000),
41 DataSeriesF4("F4", "TFC-4", "1:250,000", "Transit Flying Chart (TBD #4)", "CADRG", 250000),
42 DataSeriesF5("F5", "TFC-5", "1:250,000", "Transit Flying Chart (TBD #5)", "CADRG", 250000),
43 DataSeriesAT("AT", "ATC", "1:200,000", "Series 200 Air Target Chart", "CADRG", 200000),
44 DataSeriesVH("VH", "HRC", "1:125,000", "Helicopter Route Chart", "CADRG", 125000),
45 DataSeriesTN("TN", "TFC (Night)", "1:250,000", "Transit Flying Chart(Night)- Host nation", "CADRG", 250000),
46 DataSeriesTR("TR", "TLM200", "1:200,000", "Topographic Line Map 1:200,000 scale", "CADRG", 200000),
47 DataSeriesTC("TC", "TLM 100", "1:100,000", "Topographic Line Map 1:100,0000 scale", "CADRG", 100000),
48 DataSeriesRV("RV", "Riverine", "1:50,000", "Riverine Map 1:50,000 scale", "CADRG", 50000),
49 DataSeriesTL("TL", "TLM 50", "1:50,000", "Topographic Line Map", "CADRG", 50000),
50 DataSeriesUL("UL", "TLM50-Other", "1:50,000", "Topographic Line Map (other 1:50,000 scale)", "CADRG", 50000),
51 DataSeriesTT("TT", "TLM25", "1:25,000", "Topographic Line Map 1:25,000 scale", "CADRG", 25000),
52 DataSeriesTQ("TQ", "TLM24", "1:24,000", "Topographic Line Map 1:24,000 scale", "CADRG", 24000),
53 // DataSeriesHA("HA", "HA", "Various", "Harbor and Approach Charts", "CADRG", -1),
54 // DataSeriesCO("CO", "CO", "Various", "Coastal Charts", "CADRG", -1),
55 // DataSeriesOA("OA", "OPAREA", "Various", "Naval Range Operating Area Chart", "CADRG", -1),
56 // DataSeriesCG("CG", "CG", "Various", "City Graphics", "CADRG", -1),
57 DataSeriesC1("C1", "CG", "1:10,000", "City Graphics", "CADRG", 10000),
58 DataSeriesC2("C2", "CG", "1:10,560", "City Graphics", "CADRG", 10560),
59 DataSeriesC3("C3", "CG", "1:11,000", "City Graphics", "CADRG", 11000),
60 DataSeriesC4("C4", "CG", "1:11,800", "City Graphics", "CADRG", 11800),
61 DataSeriesC5("C5", "CG", "1:12,000", "City Graphics", "CADRG", 12000),
62 DataSeriesC6("C6", "CG", "1:12,500", "City Graphics", "CADRG", 12500),
63 DataSeriesC7("C7", "CG", "1:12,800", "City Graphics", "CADRG", 12800),
64 DataSeriesC8("C8", "CG", "1:14,000", "City Graphics", "CADRG", 14000),
65 DataSeriesC9("C9", "CG", "1:14,700", "City Graphics", "CADRG", 14700),
66 DataSeriesCA("CA", "CG", "1:15,000", "City Graphics", "CADRG", 15000),
67 DataSeriesCB("CB", "CG", "1:15,500", "City Graphics", "CADRG", 15500),
68 DataSeriesCC("CC", "CG", "1:16,000", "City Graphics", "CADRG", 16000),
69 DataSeriesCD("CD", "CG", "1:16,666", "City Graphics", "CADRG", 16666),
70 DataSeriesCE("CE", "CG", "1:17,000", "City Graphics", "CADRG", 17000),
71 DataSeriesCF("CF", "CG", "1:17,500", "City Graphics", "CADRG", 17500),
72 DataSeriesCH("CH", "CG", "1:18,000", "City Graphics", "CADRG", 18000),
73 DataSeriesCJ("CJ", "CG", "1:20,000", "City Graphics", "CADRG", 20000),
74 DataSeriesCK("CK", "CG", "1:21,000", "City Graphics", "CADRG", 21000),
75 DataSeriesCL("CL", "CG", "1:21,120", "City Graphics", "CADRG", 21120),
76 DataSeriesCN("CN", "CG", "1:22,000", "City Graphics", "CADRG", 22000),
77 DataSeriesCP("CP", "CG", "1:23,000", "City Graphics", "CADRG", 23000),
78 DataSeriesCQ("CQ", "CG", "1:25,000", "City Graphics", "CADRG", 25000),
79 DataSeriesCR("CR", "CG", "1:26,000", "City Graphics", "CADRG", 26000),
80 DataSeriesCS("CS", "CG", "1:35,000", "City Graphics", "CADRG", 35000),
81 DataSeriesCT("CT", "CG", "1:36,000", "City Graphics", "CADRG", 36000),
82 // DataSeriesCM("CM", "CM", "Various", "Combat Charts", "CADRG", -1),
83 DataSeriesA1("A1", "CM", "1:10,000", "Combat Charts, 1:10,000 scale", "CADRG", 10000),
84 DataSeriesA2("A2", "CM", "1:25,000", "Combat Charts, 1:25,000 scale", "CADRG", 25000),
85 DataSeriesA3("A3", "CM", "1:50,000", "Combat Charts, 1:50,000 scale", "CADRG", 50000),
86 DataSeriesA4("A4", "CM", "1:100,000", "Combat Charts, 1:100,000 scale", "CADRG", 100000),
87 DataSeriesMI("MI", "MIM", "1:50,000", "Military Installation Maps", "CADRG", 50000),
88 // DataSeriesM1("M1", "MIM", "Various", "Military Installation Map (TBD #1)", "CADRG", -1),
89 // DataSeriesM2("M2", "MIM", "Various", "Military Installation Map (TBD #2)", "CADRG", -1),
90 DataSeriesVN("VN", "VNC", "1:500,000", "Visual Navigation Charts", "CADRG", 500000),
91 DataSeriesMM("MM", "---", "Various", "(Miscellaneous Maps & Charts)", "CADRG", 12500),
92 DataSeriesI1("I1", "---", "10m", "Imagery, 10 meter resolution", "CIB", 10.0),
93 DataSeriesI2("I2", "---", "5m", "Imagery, 5 meter resolution", "CIB", 5.0),
94 DataSeriesI3("I3", "---", "2m", "Imagery, 2 meter resolution", "CIB", 2.0),
95 DataSeriesI4("I4", "---", "1m", "Imagery, 1 meter resolution", "CIB", 1.0),
96 DataSeriesI5("I5", "---", ".5m", "Imagery, .5 (half) meter resolution", "CIB", 0.5),
97 // DataSeriesIV("IV", "---", "Various>10m", "Imagery, greater than 10 meter resolution", "CIB", -1),
99 DataSeriesTF("TF", "---", "1:250000", "Transit Fly (UK)", "CADRG", 250000),;
101 public final String seriesCode
;
102 public final String seriesAbbreviation
;
103 public final String scaleOrResolution
;
104 public final String dataSeries
;
105 public final String rpfDataType
;
106 public final double scaleOrGSD
;
108 private RpfDataSeries(String seriesCode
, String seriesAbbreviation
, String scaleOrResolution
, String dataSeries
,
109 String rpfDataType
, double scaleOrGSD
)
111 validateScaleOrGSD(scaleOrGSD
);
112 this.rpfDataType
= validateRpfDataType(rpfDataType
);
113 this.seriesCode
= seriesCode
;
114 this.seriesAbbreviation
= seriesAbbreviation
;
115 this.scaleOrResolution
= scaleOrResolution
;
116 this.dataSeries
= dataSeries
;
117 this.scaleOrGSD
= scaleOrGSD
;
120 private static Map
<String
, RpfDataSeries
> enumConstantDirectory
= null;
122 private static Map
<String
, RpfDataSeries
> enumConstantDirectory()
124 if (enumConstantDirectory
== null)
126 RpfDataSeries
[] universe
= RpfDataSeries
.class.getEnumConstants();
127 enumConstantDirectory
= new HashMap
<String
, RpfDataSeries
>(2 * universe
.length
);
128 for (RpfDataSeries dataSeries
: universe
)
130 enumConstantDirectory
.put(dataSeries
.seriesCode
, dataSeries
);
133 return enumConstantDirectory
;
136 public static RpfDataSeries
dataSeriesFor(String seriesCode
)
138 if (seriesCode
== null)
140 String message
= WorldWind
.retrieveErrMsg("nullValue.StringIsNull");
141 WorldWind
.logger().log(FINE
, message
);
142 throw new IllegalArgumentException(message
);
144 RpfDataSeries dataSeries
= enumConstantDirectory().get(seriesCode
);
145 if (dataSeries
== null)
147 String message
= WorldWind
.retrieveErrMsg("generic.EnumNotFound") + seriesCode
;
148 WorldWind
.logger().log(FINE
, message
);
149 throw new EnumConstantNotPresentException(RpfDataSeries
.class, message
);
154 public static String
[] validDataTypes
= null;
156 public static String
[] validDataTypes()
158 if (validDataTypes
== null)
159 validDataTypes
= new String
[] {"CADRG", "CIB"};
160 return validDataTypes
;
163 private static String
validateRpfDataType(String rpfDataType
)
165 if (rpfDataType
== null)
167 String message
= WorldWind
.retrieveErrMsg("RpfDataSeries.InavlidRpfDataType") + rpfDataType
;
168 WorldWind
.logger().log(FINE
, message
);
169 throw new IllegalArgumentException(message
);
171 for (String validType
: validDataTypes())
173 if (validType
.equalsIgnoreCase(rpfDataType
))
176 String message
= WorldWind
.retrieveErrMsg("RpfDataSeries.InavlidRpfDataType") + rpfDataType
;
177 WorldWind
.logger().log(FINE
, message
);
178 throw new IllegalArgumentException(message
);
181 private static void validateScaleOrGSD(double scaleOrGSD
)
185 String message
= WorldWind
.retrieveErrMsg("RpfDataSeries.InvalidScaleOrGSD") + scaleOrGSD
;
186 WorldWind
.logger().log(FINE
, message
);
187 throw new IllegalArgumentException(message
);