Changeset 29209 in osm for applications/editors/josm/plugins/smed2/src/s57/S57att.java
- Timestamp:
- 2013-01-27T17:08:57+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/s57/S57att.java
r29097 r29209 3 3 import java.util.ArrayList; 4 4 import java.util.EnumMap; 5 import java.util.HashMap; 6 import java.util.Map; 5 7 6 8 import s57.S57obj.*; … … 82 84 } 83 85 84 private static final EnumMap<Att, String> AttSTR = new EnumMap<Att, String>(Att.class); 85 static { 86 AttSTR.put(Att.UNKATT, ""); AttSTR.put(Att.AGENCY, "agency"); AttSTR.put(Att.BCNSHP, "shape"); AttSTR.put(Att.BUISHP, "shape"); AttSTR.put(Att.BOYSHP, "shape"); 87 AttSTR.put(Att.BURDEP, "depth_buried"); AttSTR.put(Att.CALSGN, "callsign"); AttSTR.put(Att.CATAIR, "category"); AttSTR.put(Att.CATACH, "category"); 88 AttSTR.put(Att.CATBRG, "category"); AttSTR.put(Att.CATBUA, "category"); AttSTR.put(Att.CATCBL, "category"); AttSTR.put(Att.CATCAN, "category"); 89 AttSTR.put(Att.CATCAM, "category"); AttSTR.put(Att.CATCHP, "category"); AttSTR.put(Att.CATCOA, "category"); AttSTR.put(Att.CATCTR, "category"); 90 AttSTR.put(Att.CATCON, "category"); AttSTR.put(Att.CATCOV, "category"); AttSTR.put(Att.CATCRN, "category"); AttSTR.put(Att.CATDAM, "category"); 91 AttSTR.put(Att.CATDIS, "category"); AttSTR.put(Att.CATDOC, "category"); AttSTR.put(Att.CATDPG, "category"); AttSTR.put(Att.CATFNC, "category"); 92 AttSTR.put(Att.CATFRY, "category"); AttSTR.put(Att.CATFIF, "category"); AttSTR.put(Att.CATFOG, "category"); AttSTR.put(Att.CATFOR, "category"); 93 AttSTR.put(Att.CATGAT, "category"); AttSTR.put(Att.CATHAF, "category"); AttSTR.put(Att.CATHLK, "category"); AttSTR.put(Att.CATICE, "category"); 94 AttSTR.put(Att.CATINB, "category"); AttSTR.put(Att.CATLND, "category"); AttSTR.put(Att.CATLMK, "category"); AttSTR.put(Att.CATLAM, "category"); 95 AttSTR.put(Att.CATLIT, "category"); AttSTR.put(Att.CATMFA, "category"); AttSTR.put(Att.CATMPA, "category"); AttSTR.put(Att.CATMOR, "category"); 96 AttSTR.put(Att.CATNAV, "category"); AttSTR.put(Att.CATOBS, "category"); AttSTR.put(Att.CATOFP, "category"); AttSTR.put(Att.CATOLB, "category"); 97 AttSTR.put(Att.CATPLE, "category"); AttSTR.put(Att.CATPIL, "category"); AttSTR.put(Att.CATPIP, "category"); AttSTR.put(Att.CATPRA, "category"); 98 AttSTR.put(Att.CATPYL, "category"); AttSTR.put(Att.CATQUA, "category"); AttSTR.put(Att.CATRAS, "category"); AttSTR.put(Att.CATRTB, "category"); 99 AttSTR.put(Att.CATROS, "category"); AttSTR.put(Att.CATTRK, "category"); AttSTR.put(Att.CATRSC, "category"); AttSTR.put(Att.CATREA, "category"); 100 AttSTR.put(Att.CATROD, "category"); AttSTR.put(Att.CATRUN, "category"); AttSTR.put(Att.CATSEA, "category"); AttSTR.put(Att.CATSLC, "category"); 101 AttSTR.put(Att.CATSIT, "category"); AttSTR.put(Att.CATSIW, "category"); AttSTR.put(Att.CATSIL, "category"); AttSTR.put(Att.CATSLO, "category"); 102 AttSTR.put(Att.CATSCF, "category"); AttSTR.put(Att.CATSPM, "category"); AttSTR.put(Att.CATTSS, "category"); AttSTR.put(Att.CATVEG, "category"); 103 AttSTR.put(Att.CATWAT, "category"); AttSTR.put(Att.CATWED, "category"); AttSTR.put(Att.CATWRK, "category"); AttSTR.put(Att.CATZOC, "category"); 104 AttSTR.put(Att.COLOUR, "colour"); AttSTR.put(Att.COLPAT, "colour_pattern"); AttSTR.put(Att.COMCHA, "channel"); AttSTR.put(Att.CONDTN, "condition"); 105 AttSTR.put(Att.CONRAD, "reflectivity"); AttSTR.put(Att.CONVIS, "conspicuity"); AttSTR.put(Att.CURVEL, "velocity"); AttSTR.put(Att.DATEND, "end_date"); 106 AttSTR.put(Att.DATSTA, "start_date"); AttSTR.put(Att.DRVAL1, "minimum_depth"); AttSTR.put(Att.DRVAL2, "maximum_depth"); AttSTR.put(Att.DUNITS, "depth_units"); 107 AttSTR.put(Att.ELEVAT, "elevation"); AttSTR.put(Att.ESTRNG, "estimated_range"); AttSTR.put(Att.EXCLIT, "exhibition"); AttSTR.put(Att.EXPSOU, "exposition"); 108 AttSTR.put(Att.FUNCTN, "function"); AttSTR.put(Att.HEIGHT, "height"); AttSTR.put(Att.HUNITS, "height_units"); AttSTR.put(Att.HORACC, "accuracy"); 109 AttSTR.put(Att.HORCLR, "clearance"); AttSTR.put(Att.HORLEN, "length"); AttSTR.put(Att.HORWID, "width"); AttSTR.put(Att.ICEFAC, "factor"); 110 AttSTR.put(Att.INFORM, "information"); AttSTR.put(Att.JRSDTN, "jurisdiction"); AttSTR.put(Att.$JUSTH, ""); AttSTR.put(Att.$JUSTV, ""); 111 AttSTR.put(Att.LIFCAP, "maximum_load"); AttSTR.put(Att.LITCHR, "character"); AttSTR.put(Att.LITVIS, "visibility"); AttSTR.put(Att.MARSYS, "system"); 112 AttSTR.put(Att.MLTYLT, "multiple"); AttSTR.put(Att.NATION, "nationality"); AttSTR.put(Att.NATCON, "construction"); AttSTR.put(Att.NATSUR, "surface"); 113 AttSTR.put(Att.NATQUA, "surface_qualification"); AttSTR.put(Att.NMDATE, "nm_date"); AttSTR.put(Att.OBJNAM, "name"); AttSTR.put(Att.ORIENT, "orientation"); 114 AttSTR.put(Att.PEREND, "end_date"); AttSTR.put(Att.PERSTA, "start_date"); AttSTR.put(Att.PICREP, "representation"); AttSTR.put(Att.PILDST, "pilot_district"); 115 AttSTR.put(Att.PRCTRY, "producing_country"); AttSTR.put(Att.PRODCT, "product"); AttSTR.put(Att.PUBREF, "reference"); AttSTR.put(Att.QUASOU, "quality"); 116 AttSTR.put(Att.RADWAL, "wavelength"); AttSTR.put(Att.RADIUS, "radius"); AttSTR.put(Att.RECDAT, "date"); AttSTR.put(Att.RECIND, "indication"); 117 AttSTR.put(Att.RYRMGV, "year"); AttSTR.put(Att.RESTRN, "restriction"); AttSTR.put(Att.SECTR1, "sector_start"); AttSTR.put(Att.SECTR2, "sector_end"); 118 AttSTR.put(Att.SHIPAM, "shift"); AttSTR.put(Att.SIGFRQ, "frequency"); AttSTR.put(Att.SIGGEN, "generation"); AttSTR.put(Att.SIGGRP, "group"); 119 AttSTR.put(Att.SIGPER, "period"); AttSTR.put(Att.SIGSEQ, "sequence"); AttSTR.put(Att.SOUACC, "accuracy"); AttSTR.put(Att.SDISMX, "maximum_sounding"); 120 AttSTR.put(Att.SDISMN, "minimum_sounding"); AttSTR.put(Att.SORDAT, "source_date"); AttSTR.put(Att.SORIND, "source"); AttSTR.put(Att.STATUS, "status"); 121 AttSTR.put(Att.SURATH, "authority"); AttSTR.put(Att.SUREND, "end_date"); AttSTR.put(Att.SURSTA, "start_date"); AttSTR.put(Att.SURTYP, "survey"); 122 AttSTR.put(Att.TECSOU, "technique"); AttSTR.put(Att.TXTDSC, "description"); AttSTR.put(Att.TIMEND, "end_time"); AttSTR.put(Att.TIMSTA, "start_time"); 123 AttSTR.put(Att.TOPSHP, "shape"); AttSTR.put(Att.TRAFIC, "flow"); AttSTR.put(Att.VALACM, "variation_change"); AttSTR.put(Att.VALDCO, "depth"); 124 AttSTR.put(Att.VALLMA, "anomaly"); AttSTR.put(Att.VALMAG, "variation"); AttSTR.put(Att.VALMXR, "maximum_range"); AttSTR.put(Att.VALNMR, "range"); 125 AttSTR.put(Att.VALSOU, "sounding"); AttSTR.put(Att.VERACC, "vertical_accuracy"); AttSTR.put(Att.VERCLR, "clearance_height"); 126 AttSTR.put(Att.VERCCL, "clearance_height_closed"); AttSTR.put(Att.VERCOP, "clearance_height_open"); AttSTR.put(Att.VERCSA, "clearance_height_safe"); 127 AttSTR.put(Att.VERDAT, "vertical_datum"); AttSTR.put(Att.VERLEN, "vertical_length"); AttSTR.put(Att.WATLEV, "water_level"); AttSTR.put(Att.CAT_TS, "category"); 128 AttSTR.put(Att.PUNITS, "units"); AttSTR.put(Att.NINFOM, "national_information"); AttSTR.put(Att.NOBJNM, "national_name"); AttSTR.put(Att.NPLDST, "national_pilot_district"); 129 AttSTR.put(Att.NTXTDS, "national_description"); AttSTR.put(Att.HORDAT, "horizontal_datum"); AttSTR.put(Att.POSACC, "positional_accuracy"); 130 AttSTR.put(Att.QUAPOS, "position_quality"); AttSTR.put(Att.ADDMRK, "addition"); AttSTR.put(Att.BNKWTW, "bank");AttSTR.put(Att.CATBNK, "category"); 131 AttSTR.put(Att.CATNMK, "category"); AttSTR.put(Att.CLSDNG, "class"); AttSTR.put(Att.DIRIMP, "impact"); AttSTR.put(Att.DISBK1, "distance_start"); 132 AttSTR.put(Att.DISBK2, "distance_end");AttSTR.put(Att.DISIPU, "distance_up"); AttSTR.put(Att.DISIPD, "distance_down"); AttSTR.put(Att.ELEVA1, "minimum_elevation"); 133 AttSTR.put(Att.ELEVA2, "maximum_elevation"); AttSTR.put(Att.FNCTNM, "function"); AttSTR.put(Att.WTWDIS, "distance"); AttSTR.put(Att.BUNVES, "availibility"); 134 AttSTR.put(Att.CATBRT, "category"); AttSTR.put(Att.CATBUN, "category"); AttSTR.put(Att.CATCCL, "category"); AttSTR.put(Att.CATHBR, "category"); 135 AttSTR.put(Att.CATRFD, "category"); AttSTR.put(Att.CATTML, "category"); AttSTR.put(Att.COMCTN, "communication"); AttSTR.put(Att.HORCLL, "clearance_length"); 136 AttSTR.put(Att.HORCLW, "clearance_width"); AttSTR.put(Att.TRSHGD, "goods"); AttSTR.put(Att.UNLOCD, "locode"); AttSTR.put(Att.CATGAG, "category"); 137 AttSTR.put(Att.HIGWAT, "high_value"); AttSTR.put(Att.HIGNAM, "high_name"); AttSTR.put(Att.LOWWAT, "low_value"); AttSTR.put(Att.LOWNAM, "low_name"); 138 AttSTR.put(Att.MEAWAT, "mean_value"); AttSTR.put(Att.MEANAM, "mean_name"); AttSTR.put(Att.OTHWAT, "local_value"); AttSTR.put(Att.OTHNAM, "local_name"); 139 AttSTR.put(Att.REFLEV, "gravity_reference"); AttSTR.put(Att.SDRLEV, "sounding_name"); AttSTR.put(Att.VCRLEV, "vertical_name"); AttSTR.put(Att.CATVTR, "category"); 140 AttSTR.put(Att.CATTAB, "operation"); AttSTR.put(Att.SCHREF, "schedule"); AttSTR.put(Att.USESHP, "use"); AttSTR.put(Att.CURVHW, "high_velocity"); 141 AttSTR.put(Att.CURVLW, "low_velocity"); AttSTR.put(Att.CURVMW, "mean_velocity"); AttSTR.put(Att.CURVOW, "other_velocity"); AttSTR.put(Att.APTREF, "passing_time"); 142 AttSTR.put(Att.CATEXS, "category"); AttSTR.put(Att.CATWWM, "category"); AttSTR.put(Att.SHPTYP, "ship"); AttSTR.put(Att.UPDMSG, "message"); AttSTR.put(Att.LITRAD, "radius"); 86 private static final HashMap<Integer, Att> S57Att = new HashMap<Integer, Att>(); 87 static { 88 for (Map.Entry<Att, Integer> entry : AttS57.entrySet()) { 89 S57Att.put(entry.getValue(), entry.getKey()); 90 } 91 for (Map.Entry<Att, Integer> entry : AttIENC.entrySet()) { 92 S57Att.put(entry.getValue(), entry.getKey()); 93 } 94 } 95 96 private static final EnumMap<Att, String> AttStr = new EnumMap<Att, String>(Att.class); 97 static { 98 AttStr.put(Att.UNKATT, ""); AttStr.put(Att.AGENCY, "agency"); AttStr.put(Att.BCNSHP, "shape"); AttStr.put(Att.BUISHP, "shape"); AttStr.put(Att.BOYSHP, "shape"); 99 AttStr.put(Att.BURDEP, "depth_buried"); AttStr.put(Att.CALSGN, "callsign"); AttStr.put(Att.CATAIR, "category"); AttStr.put(Att.CATACH, "category"); 100 AttStr.put(Att.CATBRG, "category"); AttStr.put(Att.CATBUA, "category"); AttStr.put(Att.CATCBL, "category"); AttStr.put(Att.CATCAN, "category"); 101 AttStr.put(Att.CATCAM, "category"); AttStr.put(Att.CATCHP, "category"); AttStr.put(Att.CATCOA, "category"); AttStr.put(Att.CATCTR, "category"); 102 AttStr.put(Att.CATCON, "category"); AttStr.put(Att.CATCOV, "category"); AttStr.put(Att.CATCRN, "category"); AttStr.put(Att.CATDAM, "category"); 103 AttStr.put(Att.CATDIS, "category"); AttStr.put(Att.CATDOC, "category"); AttStr.put(Att.CATDPG, "category"); AttStr.put(Att.CATFNC, "category"); 104 AttStr.put(Att.CATFRY, "category"); AttStr.put(Att.CATFIF, "category"); AttStr.put(Att.CATFOG, "category"); AttStr.put(Att.CATFOR, "category"); 105 AttStr.put(Att.CATGAT, "category"); AttStr.put(Att.CATHAF, "category"); AttStr.put(Att.CATHLK, "category"); AttStr.put(Att.CATICE, "category"); 106 AttStr.put(Att.CATINB, "category"); AttStr.put(Att.CATLND, "category"); AttStr.put(Att.CATLMK, "category"); AttStr.put(Att.CATLAM, "category"); 107 AttStr.put(Att.CATLIT, "category"); AttStr.put(Att.CATMFA, "category"); AttStr.put(Att.CATMPA, "category"); AttStr.put(Att.CATMOR, "category"); 108 AttStr.put(Att.CATNAV, "category"); AttStr.put(Att.CATOBS, "category"); AttStr.put(Att.CATOFP, "category"); AttStr.put(Att.CATOLB, "category"); 109 AttStr.put(Att.CATPLE, "category"); AttStr.put(Att.CATPIL, "category"); AttStr.put(Att.CATPIP, "category"); AttStr.put(Att.CATPRA, "category"); 110 AttStr.put(Att.CATPYL, "category"); AttStr.put(Att.CATQUA, "category"); AttStr.put(Att.CATRAS, "category"); AttStr.put(Att.CATRTB, "category"); 111 AttStr.put(Att.CATROS, "category"); AttStr.put(Att.CATTRK, "category"); AttStr.put(Att.CATRSC, "category"); AttStr.put(Att.CATREA, "category"); 112 AttStr.put(Att.CATROD, "category"); AttStr.put(Att.CATRUN, "category"); AttStr.put(Att.CATSEA, "category"); AttStr.put(Att.CATSLC, "category"); 113 AttStr.put(Att.CATSIT, "category"); AttStr.put(Att.CATSIW, "category"); AttStr.put(Att.CATSIL, "category"); AttStr.put(Att.CATSLO, "category"); 114 AttStr.put(Att.CATSCF, "category"); AttStr.put(Att.CATSPM, "category"); AttStr.put(Att.CATTSS, "category"); AttStr.put(Att.CATVEG, "category"); 115 AttStr.put(Att.CATWAT, "category"); AttStr.put(Att.CATWED, "category"); AttStr.put(Att.CATWRK, "category"); AttStr.put(Att.CATZOC, "category"); 116 AttStr.put(Att.COLOUR, "colour"); AttStr.put(Att.COLPAT, "colour_pattern"); AttStr.put(Att.COMCHA, "channel"); AttStr.put(Att.CONDTN, "condition"); 117 AttStr.put(Att.CONRAD, "reflectivity"); AttStr.put(Att.CONVIS, "conspicuity"); AttStr.put(Att.CURVEL, "velocity"); AttStr.put(Att.DATEND, "end_date"); 118 AttStr.put(Att.DATSTA, "start_date"); AttStr.put(Att.DRVAL1, "minimum_depth"); AttStr.put(Att.DRVAL2, "maximum_depth"); AttStr.put(Att.DUNITS, "depth_units"); 119 AttStr.put(Att.ELEVAT, "elevation"); AttStr.put(Att.ESTRNG, "estimated_range"); AttStr.put(Att.EXCLIT, "exhibition"); AttStr.put(Att.EXPSOU, "exposition"); 120 AttStr.put(Att.FUNCTN, "function"); AttStr.put(Att.HEIGHT, "height"); AttStr.put(Att.HUNITS, "height_units"); AttStr.put(Att.HORACC, "accuracy"); 121 AttStr.put(Att.HORCLR, "clearance"); AttStr.put(Att.HORLEN, "length"); AttStr.put(Att.HORWID, "width"); AttStr.put(Att.ICEFAC, "factor"); 122 AttStr.put(Att.INFORM, "information"); AttStr.put(Att.JRSDTN, "jurisdiction"); AttStr.put(Att.$JUSTH, ""); AttStr.put(Att.$JUSTV, ""); 123 AttStr.put(Att.LIFCAP, "maximum_load"); AttStr.put(Att.LITCHR, "character"); AttStr.put(Att.LITVIS, "visibility"); AttStr.put(Att.MARSYS, "system"); 124 AttStr.put(Att.MLTYLT, "multiple"); AttStr.put(Att.NATION, "nationality"); AttStr.put(Att.NATCON, "construction"); AttStr.put(Att.NATSUR, "surface"); 125 AttStr.put(Att.NATQUA, "surface_qualification"); AttStr.put(Att.NMDATE, "nm_date"); AttStr.put(Att.OBJNAM, "name"); AttStr.put(Att.ORIENT, "orientation"); 126 AttStr.put(Att.PEREND, "end_date"); AttStr.put(Att.PERSTA, "start_date"); AttStr.put(Att.PICREP, "representation"); AttStr.put(Att.PILDST, "pilot_district"); 127 AttStr.put(Att.PRCTRY, "producing_country"); AttStr.put(Att.PRODCT, "product"); AttStr.put(Att.PUBREF, "reference"); AttStr.put(Att.QUASOU, "quality"); 128 AttStr.put(Att.RADWAL, "wavelength"); AttStr.put(Att.RADIUS, "radius"); AttStr.put(Att.RECDAT, "date"); AttStr.put(Att.RECIND, "indication"); 129 AttStr.put(Att.RYRMGV, "year"); AttStr.put(Att.RESTRN, "restriction"); AttStr.put(Att.SECTR1, "sector_start"); AttStr.put(Att.SECTR2, "sector_end"); 130 AttStr.put(Att.SHIPAM, "shift"); AttStr.put(Att.SIGFRQ, "frequency"); AttStr.put(Att.SIGGEN, "generation"); AttStr.put(Att.SIGGRP, "group"); 131 AttStr.put(Att.SIGPER, "period"); AttStr.put(Att.SIGSEQ, "sequence"); AttStr.put(Att.SOUACC, "accuracy"); AttStr.put(Att.SDISMX, "maximum_sounding"); 132 AttStr.put(Att.SDISMN, "minimum_sounding"); AttStr.put(Att.SORDAT, "source_date"); AttStr.put(Att.SORIND, "source"); AttStr.put(Att.STATUS, "status"); 133 AttStr.put(Att.SURATH, "authority"); AttStr.put(Att.SUREND, "end_date"); AttStr.put(Att.SURSTA, "start_date"); AttStr.put(Att.SURTYP, "survey"); 134 AttStr.put(Att.TECSOU, "technique"); AttStr.put(Att.TXTDSC, "description"); AttStr.put(Att.TIMEND, "end_time"); AttStr.put(Att.TIMSTA, "start_time"); 135 AttStr.put(Att.TOPSHP, "shape"); AttStr.put(Att.TRAFIC, "flow"); AttStr.put(Att.VALACM, "variation_change"); AttStr.put(Att.VALDCO, "depth"); 136 AttStr.put(Att.VALLMA, "anomaly"); AttStr.put(Att.VALMAG, "variation"); AttStr.put(Att.VALMXR, "maximum_range"); AttStr.put(Att.VALNMR, "range"); 137 AttStr.put(Att.VALSOU, "sounding"); AttStr.put(Att.VERACC, "vertical_accuracy"); AttStr.put(Att.VERCLR, "clearance_height"); 138 AttStr.put(Att.VERCCL, "clearance_height_closed"); AttStr.put(Att.VERCOP, "clearance_height_open"); AttStr.put(Att.VERCSA, "clearance_height_safe"); 139 AttStr.put(Att.VERDAT, "vertical_datum"); AttStr.put(Att.VERLEN, "vertical_length"); AttStr.put(Att.WATLEV, "water_level"); AttStr.put(Att.CAT_TS, "category"); 140 AttStr.put(Att.PUNITS, "units"); AttStr.put(Att.NINFOM, "national_information"); AttStr.put(Att.NOBJNM, "national_name"); AttStr.put(Att.NPLDST, "national_pilot_district"); 141 AttStr.put(Att.NTXTDS, "national_description"); AttStr.put(Att.HORDAT, "horizontal_datum"); AttStr.put(Att.POSACC, "positional_accuracy"); 142 AttStr.put(Att.QUAPOS, "position_quality"); AttStr.put(Att.ADDMRK, "addition"); AttStr.put(Att.BNKWTW, "bank");AttStr.put(Att.CATBNK, "category"); 143 AttStr.put(Att.CATNMK, "category"); AttStr.put(Att.CLSDNG, "class"); AttStr.put(Att.DIRIMP, "impact"); AttStr.put(Att.DISBK1, "distance_start"); 144 AttStr.put(Att.DISBK2, "distance_end");AttStr.put(Att.DISIPU, "distance_up"); AttStr.put(Att.DISIPD, "distance_down"); AttStr.put(Att.ELEVA1, "minimum_elevation"); 145 AttStr.put(Att.ELEVA2, "maximum_elevation"); AttStr.put(Att.FNCTNM, "function"); AttStr.put(Att.WTWDIS, "distance"); AttStr.put(Att.BUNVES, "availibility"); 146 AttStr.put(Att.CATBRT, "category"); AttStr.put(Att.CATBUN, "category"); AttStr.put(Att.CATCCL, "category"); AttStr.put(Att.CATHBR, "category"); 147 AttStr.put(Att.CATRFD, "category"); AttStr.put(Att.CATTML, "category"); AttStr.put(Att.COMCTN, "communication"); AttStr.put(Att.HORCLL, "clearance_length"); 148 AttStr.put(Att.HORCLW, "clearance_width"); AttStr.put(Att.TRSHGD, "goods"); AttStr.put(Att.UNLOCD, "locode"); AttStr.put(Att.CATGAG, "category"); 149 AttStr.put(Att.HIGWAT, "high_value"); AttStr.put(Att.HIGNAM, "high_name"); AttStr.put(Att.LOWWAT, "low_value"); AttStr.put(Att.LOWNAM, "low_name"); 150 AttStr.put(Att.MEAWAT, "mean_value"); AttStr.put(Att.MEANAM, "mean_name"); AttStr.put(Att.OTHWAT, "local_value"); AttStr.put(Att.OTHNAM, "local_name"); 151 AttStr.put(Att.REFLEV, "gravity_reference"); AttStr.put(Att.SDRLEV, "sounding_name"); AttStr.put(Att.VCRLEV, "vertical_name"); AttStr.put(Att.CATVTR, "category"); 152 AttStr.put(Att.CATTAB, "operation"); AttStr.put(Att.SCHREF, "schedule"); AttStr.put(Att.USESHP, "use"); AttStr.put(Att.CURVHW, "high_velocity"); 153 AttStr.put(Att.CURVLW, "low_velocity"); AttStr.put(Att.CURVMW, "mean_velocity"); AttStr.put(Att.CURVOW, "other_velocity"); AttStr.put(Att.APTREF, "passing_time"); 154 AttStr.put(Att.CATEXS, "category"); AttStr.put(Att.CATWWM, "category"); AttStr.put(Att.SHPTYP, "ship"); AttStr.put(Att.UPDMSG, "message"); AttStr.put(Att.LITRAD, "radius"); 143 155 } 144 156 … … 211 223 } 212 224 213 public static String decodeAttribute(Integer attribute) { // Convert S57 attribute code to OSeaM attribute string 214 String str = AttSTR.get(lookupAttribute(attribute)); 215 return str != null ? str : ""; 216 } 217 218 public static Integer encodeAttribute(String attribute, Integer objl) { // Convert OSeaM attribute string to S57 attribute code 219 Att atta = enumAttribute(attribute, S57obj.lookupType(objl)); 220 return AttS57.get(atta) != 0 ? AttS57.get(atta) : AttIENC.get(atta); 225 public static Att decodeAttribute(Integer attribute) { // Convert S57 attribute code to OSeaM attribute enumeration 226 Att att = S57Att.get(attribute); 227 return (att != null) ? att : Att.UNKATT; 228 } 229 230 public static Integer encodeAttribute(String attribute) { // Convert OSeaM attribute enumeration to S57 attribute code 231 if (AttS57.containsKey(attribute)) 232 return AttS57.get(attribute); 233 else if (AttIENC.containsKey(attribute)) 234 return AttIENC.get(attribute); 235 return 0; 221 236 } 222 237 … … 225 240 } 226 241 227 public static Att lookupAttribute(Integer attribute) { // Convert S57 attribute code to OSeaM enumeration228 if (attribute < 10000) {229 for (Att att : AttS57.keySet()) {230 if (AttS57.get(att).equals(attribute)) {231 return att;232 }233 }234 } else {235 for (Att att : AttIENC.keySet()) {236 if (AttIENC.get(att).equals(attribute)) {237 return att;238 }239 }240 }241 return Att.UNKATT;242 }243 244 242 public static String stringAttribute(Att attribute) { // Convert OSeaM enumeration to OSeaM attribute string 245 String str = AttS TR.get(attribute);243 String str = AttStr.get(attribute); 246 244 return str != null ? str : ""; 247 245 } … … 249 247 public static Att enumAttribute(String attribute, Obj obj) { // Convert OSeaM attribute string to OSeaM enumeration 250 248 if ((attribute != null) && (attribute.length() > 0)) { 251 for (Att att : AttS TR.keySet()) {252 if (AttS TR.get(att).equals(attribute) && (verifyAttribute(obj, att) != Ver.NON ))249 for (Att att : AttStr.keySet()) { 250 if (AttStr.get(att).equals(attribute) && (verifyAttribute(obj, att) != Ver.NON )) 253 251 return att; 254 252 }
Note:
See TracChangeset
for help on using the changeset viewer.