Changeset 29209 in osm for applications/editors/josm/plugins/smed2/src
- Timestamp:
- 2013-01-27T17:08:57+01:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src/s57
- Files:
-
- 3 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 } -
applications/editors/josm/plugins/smed2/src/s57/S57obj.java
r29049 r29209 2 2 3 3 import java.util.EnumMap; 4 import java.util.HashMap; 5 import java.util.Map; 4 6 5 7 public class S57obj { … … 62 64 ObjS57.put(Obj.$COMPS,503); ObjS57.put(Obj.$TEXTS,504); 63 65 } 66 64 67 private static final EnumMap<Obj, Integer> ObjIENC = new EnumMap<Obj, Integer>(Obj.class); 65 68 static { … … 78 81 } 79 82 80 private static final EnumMap<Obj, String> ObjSTR = new EnumMap<Obj, String>(Obj.class);83 private static final HashMap<Integer, Obj> S57Obj = new HashMap<Integer, Obj>(); 81 84 static { 82 ObjSTR.put(Obj.UNKOBJ, ""); ObjSTR.put(Obj.ADMARE, "administrative_area"); ObjSTR.put(Obj.AIRARE, "airfield"); ObjSTR.put(Obj.ACHBRT, "anchor_berth"); 83 ObjSTR.put(Obj.ACHARE, "anchorage"); ObjSTR.put(Obj.BCNCAR, "beacon_cardinal"); ObjSTR.put(Obj.BCNISD, "beacon_isolated_danger"); 84 ObjSTR.put(Obj.BCNLAT, "beacon_lateral"); ObjSTR.put(Obj.BCNSAW, "beacon_safe_water"); ObjSTR.put(Obj.BCNSPP, "beacon_special_purpose"); 85 ObjSTR.put(Obj.BERTHS, "berth"); ObjSTR.put(Obj.BRIDGE, "bridge"); ObjSTR.put(Obj.BUISGL, "building"); ObjSTR.put(Obj.BUAARE, "built-up_area"); 86 ObjSTR.put(Obj.BOYCAR, "buoy_cardinal"); ObjSTR.put(Obj.BOYINB, "buoy_installation"); ObjSTR.put(Obj.BOYISD, "buoy_isolated_danger"); 87 ObjSTR.put(Obj.BOYLAT, "buoy_lateral"); ObjSTR.put(Obj.BOYSAW, "buoy_safe_water"); ObjSTR.put(Obj.BOYSPP, "buoy_special_purpose"); 88 ObjSTR.put(Obj.CBLARE, "cable_area"); ObjSTR.put(Obj.CBLOHD, "cable_overhead"); ObjSTR.put(Obj.CBLSUB, "cable_submarine"); ObjSTR.put(Obj.CANALS, "canal"); 89 ObjSTR.put(Obj.CANBNK, "canal_bank"); ObjSTR.put(Obj.CTSARE, "cargo_area"); ObjSTR.put(Obj.CAUSWY, "causeway"); ObjSTR.put(Obj.CTNARE, "caution_area"); 90 ObjSTR.put(Obj.CHKPNT, "checkpoint"); ObjSTR.put(Obj.CGUSTA, "coastguard_station"); ObjSTR.put(Obj.COALNE, "coastline"); ObjSTR.put(Obj.CONZNE, "contiguous_zone"); 91 ObjSTR.put(Obj.COSARE, "continental_shelf"); ObjSTR.put(Obj.CTRPNT, "control_point"); ObjSTR.put(Obj.CONVYR, "conveyor"); ObjSTR.put(Obj.CRANES, "crane"); 92 ObjSTR.put(Obj.CURENT, "current"); ObjSTR.put(Obj.CUSZNE, "custom_zone"); ObjSTR.put(Obj.DAMCON, "dam"); ObjSTR.put(Obj.DAYMAR, "daymark"); 93 ObjSTR.put(Obj.DWRTCL, "deep_water_route_centreline"); ObjSTR.put(Obj.DWRTPT, "deep_water_route"); ObjSTR.put(Obj.DEPARE, "depth_area"); 94 ObjSTR.put(Obj.DEPCNT, "depth_contour"); ObjSTR.put(Obj.DISMAR, "distance_mark"); ObjSTR.put(Obj.DOCARE, "dock"); ObjSTR.put(Obj.DRGARE, "dredged_area"); 95 ObjSTR.put(Obj.DRYDOC, "dry_dock"); ObjSTR.put(Obj.DMPGRD, "dumping_ground"); ObjSTR.put(Obj.DYKCON, "dyke"); ObjSTR.put(Obj.EXEZNE, "exclusive_economic_zone"); 96 ObjSTR.put(Obj.FAIRWY, "fairway"); ObjSTR.put(Obj.FNCLNE, "wall"); ObjSTR.put(Obj.FERYRT, "ferry_route"); ObjSTR.put(Obj.FSHZNE, "fishery_zone"); 97 ObjSTR.put(Obj.FSHFAC, "fishing_facility"); ObjSTR.put(Obj.FSHGRD, "fishing_ground"); ObjSTR.put(Obj.FLODOC, "floating_dock"); ObjSTR.put(Obj.FOGSIG, "fog_signal"); 98 ObjSTR.put(Obj.FORSTC, "fortified_structure"); ObjSTR.put(Obj.FRPARE, "free_port_area"); ObjSTR.put(Obj.GATCON, "gate"); ObjSTR.put(Obj.GRIDRN, "gridiron"); 99 ObjSTR.put(Obj.HRBARE, "harbour_area"); ObjSTR.put(Obj.HRBFAC, "harbour"); ObjSTR.put(Obj.HULKES, "hulk"); ObjSTR.put(Obj.ICEARE, "ice_area"); 100 ObjSTR.put(Obj.ICNARE, "incineration_zone"); ObjSTR.put(Obj.ISTZNE, "inshore_traffic_zone"); ObjSTR.put(Obj.LAKARE, "lake"); ObjSTR.put(Obj.LAKSHR, "lake_shore"); 101 ObjSTR.put(Obj.LNDARE, "land_area"); ObjSTR.put(Obj.LNDELV, "land_elevation"); ObjSTR.put(Obj.LNDRGN, "land_region"); ObjSTR.put(Obj.LNDMRK, "landmark"); 102 ObjSTR.put(Obj.LIGHTS, "light"); ObjSTR.put(Obj.LITFLT, "light_float"); ObjSTR.put(Obj.LITVES, "light_vessel"); ObjSTR.put(Obj.LOCMAG, "local_magnetic_anomaly"); 103 ObjSTR.put(Obj.LOKBSN, "lock_basin"); ObjSTR.put(Obj.LOGPON, "log_pond"); ObjSTR.put(Obj.MAGVAR, "magnetic_variation"); ObjSTR.put(Obj.MARCUL, "marine_farm"); 104 ObjSTR.put(Obj.MIPARE, "military_area"); ObjSTR.put(Obj.MORFAC, "mooring"); ObjSTR.put(Obj.NAVLNE, "navigation_line"); ObjSTR.put(Obj.OBSTRN, "obstruction"); 105 ObjSTR.put(Obj.OFSPLF, "platform"); ObjSTR.put(Obj.OSPARE, "production_area"); ObjSTR.put(Obj.OILBAR, "oil_barrier"); ObjSTR.put(Obj.PILPNT, "pile"); 106 ObjSTR.put(Obj.PILBOP, "pilot_boarding"); ObjSTR.put(Obj.PIPARE, "pipeline_area"); ObjSTR.put(Obj.PIPOHD, "pipeline_overhead"); ObjSTR.put(Obj.PIPSOL, "pipeline_submarine"); 107 ObjSTR.put(Obj.PONTON, "pontoon"); ObjSTR.put(Obj.PRCARE, "precautionary_area"); ObjSTR.put(Obj.PRDARE, "land_production_area");ObjSTR.put(Obj.PYLONS, "pylon"); 108 ObjSTR.put(Obj.RADLNE, "radar_line"); ObjSTR.put(Obj.RADRNG, "radar_range"); ObjSTR.put(Obj.RADRFL, "radar_reflector"); ObjSTR.put(Obj.RADSTA, "radar_station"); 109 ObjSTR.put(Obj.RTPBCN, "radar_transponder"); ObjSTR.put(Obj.RDOCAL, "calling-in_point"); ObjSTR.put(Obj.RDOSTA, "radio_station"); ObjSTR.put(Obj.RAILWY, "railway"); 110 ObjSTR.put(Obj.RAPIDS, "rapids"); ObjSTR.put(Obj.RCRTCL, "recommended_route_centreline"); ObjSTR.put(Obj.RECTRC, "recommended_track"); 111 ObjSTR.put(Obj.RCTLPT, "recommended_traffic_lane"); ObjSTR.put(Obj.RSCSTA, "rescue_station"); ObjSTR.put(Obj.RESARE, "restricted_area"); 112 ObjSTR.put(Obj.RETRFL, "retro_reflector"); ObjSTR.put(Obj.RIVERS, "river"); ObjSTR.put(Obj.RIVBNK, "river_bank"); ObjSTR.put(Obj.ROADWY, "road"); 113 ObjSTR.put(Obj.RUNWAY, "runway"); ObjSTR.put(Obj.SNDWAV, "sand_waves"); ObjSTR.put(Obj.SEAARE, "sea_area"); ObjSTR.put(Obj.SPLARE, "seaplane_landing_area"); 114 ObjSTR.put(Obj.SBDARE, "seabed_area"); ObjSTR.put(Obj.SLCONS, "shoreline_construction"); ObjSTR.put(Obj.SISTAT, "signal_station_traffic"); 115 ObjSTR.put(Obj.SISTAW, "signal_station_warning"); ObjSTR.put(Obj.SILTNK, "tank"); ObjSTR.put(Obj.SLOTOP, "slope_topline"); ObjSTR.put(Obj.SLOGRD, "sloping_ground"); 116 ObjSTR.put(Obj.SMCFAC, "small_craft_facility"); ObjSTR.put(Obj.SOUNDG, "sounding"); ObjSTR.put(Obj.SPRING, "spring"); ObjSTR.put(Obj.SQUARE, "square"); 117 ObjSTR.put(Obj.STSLNE, "territorial_baseline"); ObjSTR.put(Obj.SUBTLN, "submarine_transit_lane"); ObjSTR.put(Obj.SWPARE, "swept_area"); 118 ObjSTR.put(Obj.TESARE, "territorial_area"); ObjSTR.put(Obj.TS_PRH, ""); ObjSTR.put(Obj.TS_PNH, ""); ObjSTR.put(Obj.TS_PAD, ""); ObjSTR.put(Obj.TS_TIS, ""); 119 ObjSTR.put(Obj.T_HMON, ""); ObjSTR.put(Obj.T_NHMN, ""); ObjSTR.put(Obj.T_TIMS, ""); ObjSTR.put(Obj.TIDEWY, "tideway"); ObjSTR.put(Obj.TOPMAR, "topmark"); 120 ObjSTR.put(Obj.TSELNE, "separation_line"); ObjSTR.put(Obj.TSSBND, "separation_boundary"); ObjSTR.put(Obj.TSSCRS, "separation_crossing"); 121 ObjSTR.put(Obj.TSSLPT, "separation_lane"); ObjSTR.put(Obj.TSSRON, "separation_roundabout"); ObjSTR.put(Obj.TSEZNE, "separation_zone"); ObjSTR.put(Obj.TUNNEL, "tunnel"); 122 ObjSTR.put(Obj.TWRTPT, "two-way_route"); ObjSTR.put(Obj.UWTROC, "rock"); ObjSTR.put(Obj.UNSARE, "unsurveyed_area"); ObjSTR.put(Obj.VEGATN, "vegetation"); 123 ObjSTR.put(Obj.WATTUR, "water_turbulence"); ObjSTR.put(Obj.WATFAL, "waterfall"); ObjSTR.put(Obj.WEDKLP, "weed"); ObjSTR.put(Obj.WRECKS, "wreck"); 124 ObjSTR.put(Obj.TS_FEB, "tidal_stream"); ObjSTR.put(Obj.M_ACCY, ""); ObjSTR.put(Obj.M_CSCL, ""); ObjSTR.put(Obj.M_COVR, "coverage"); ObjSTR.put(Obj.M_HDAT, ""); 125 ObjSTR.put(Obj.M_HOPA, ""); ObjSTR.put(Obj.M_NPUB, ""); ObjSTR.put(Obj.M_NSYS, ""); ObjSTR.put(Obj.M_PROD, ""); ObjSTR.put(Obj.M_QUAL, "data_quality"); 126 ObjSTR.put(Obj.M_SDAT, ""); ObjSTR.put(Obj.M_SREL, ""); ObjSTR.put(Obj.M_UNIT, ""); ObjSTR.put(Obj.M_VDAT, ""); ObjSTR.put(Obj.C_AGGR, ""); ObjSTR.put(Obj.C_ASSO, ""); 127 ObjSTR.put(Obj.C_STAC, ""); ObjSTR.put(Obj.$AREAS, ""); ObjSTR.put(Obj.$LINES, ""); ObjSTR.put(Obj.$CSYMB, ""); ObjSTR.put(Obj.$COMPS, ""); ObjSTR.put(Obj.$TEXTS, ""); 128 ObjSTR.put(Obj.NOTMRK, "notice"); ObjSTR.put(Obj.WTWAXS, "waterway_axis"); ObjSTR.put(Obj.WTWPRF, "waterway_profile"); ObjSTR.put(Obj.BRGARE, "bridge_area"); 129 ObjSTR.put(Obj.BUNSTA, "bunker_station"); ObjSTR.put(Obj.COMARE, "communication_area"); ObjSTR.put(Obj.HRBBSN, "harbour_basin"); ObjSTR.put(Obj.LOKARE, "lock_area"); 130 ObjSTR.put(Obj.LKBSPT, "lock_basin_part"); ObjSTR.put(Obj.PRTARE, "port_area"); ObjSTR.put(Obj.BCNWTW, "beacon_waterway"); ObjSTR.put(Obj.BOYWTW, "buoy_waterway"); 131 ObjSTR.put(Obj.REFDMP, "refuse_dump"); ObjSTR.put(Obj.RTPLPT, "route_planning_point"); ObjSTR.put(Obj.TERMNL, "terminal"); ObjSTR.put(Obj.TRNBSN, "turning_basin"); 132 ObjSTR.put(Obj.WTWARE, "waterway_area"); ObjSTR.put(Obj.WTWGAG, "waterway_gauge"); ObjSTR.put(Obj.TISDGE, "time_schedule"); ObjSTR.put(Obj.VEHTRF, "vehicle_transfer"); 133 ObjSTR.put(Obj.EXCNST, "exceptional_structure"); ObjSTR.put(Obj.LG_SDM, ""); ObjSTR.put(Obj.LG_VSP, ""); ObjSTR.put(Obj.LITMAJ, "light_major"); ObjSTR.put(Obj.LITMIN, "light_minor"); 85 for (Map.Entry<Obj, Integer> entry : ObjS57.entrySet()) { 86 S57Obj.put(entry.getValue(), entry.getKey()); 87 } 88 for (Map.Entry<Obj, Integer> entry : ObjIENC.entrySet()) { 89 S57Obj.put(entry.getValue(), entry.getKey()); 90 } 134 91 } 135 136 public static String decodeType(Integer type) { // Convert S57 feature code to OSeaM object string 137 String str = ObjSTR.get(lookupType(type)); 138 return str != null ? str : ""; 92 93 private static final EnumMap<Obj, String> ObjStr = new EnumMap<Obj, String>(Obj.class); 94 static { 95 ObjStr.put(Obj.UNKOBJ, ""); ObjStr.put(Obj.ADMARE, "administrative_area"); ObjStr.put(Obj.AIRARE, "airfield"); ObjStr.put(Obj.ACHBRT, "anchor_berth"); 96 ObjStr.put(Obj.ACHARE, "anchorage"); ObjStr.put(Obj.BCNCAR, "beacon_cardinal"); ObjStr.put(Obj.BCNISD, "beacon_isolated_danger"); 97 ObjStr.put(Obj.BCNLAT, "beacon_lateral"); ObjStr.put(Obj.BCNSAW, "beacon_safe_water"); ObjStr.put(Obj.BCNSPP, "beacon_special_purpose"); 98 ObjStr.put(Obj.BERTHS, "berth"); ObjStr.put(Obj.BRIDGE, "bridge"); ObjStr.put(Obj.BUISGL, "building"); ObjStr.put(Obj.BUAARE, "built-up_area"); 99 ObjStr.put(Obj.BOYCAR, "buoy_cardinal"); ObjStr.put(Obj.BOYINB, "buoy_installation"); ObjStr.put(Obj.BOYISD, "buoy_isolated_danger"); 100 ObjStr.put(Obj.BOYLAT, "buoy_lateral"); ObjStr.put(Obj.BOYSAW, "buoy_safe_water"); ObjStr.put(Obj.BOYSPP, "buoy_special_purpose"); 101 ObjStr.put(Obj.CBLARE, "cable_area"); ObjStr.put(Obj.CBLOHD, "cable_overhead"); ObjStr.put(Obj.CBLSUB, "cable_submarine"); ObjStr.put(Obj.CANALS, "canal"); 102 ObjStr.put(Obj.CANBNK, "canal_bank"); ObjStr.put(Obj.CTSARE, "cargo_area"); ObjStr.put(Obj.CAUSWY, "causeway"); ObjStr.put(Obj.CTNARE, "caution_area"); 103 ObjStr.put(Obj.CHKPNT, "checkpoint"); ObjStr.put(Obj.CGUSTA, "coastguard_station"); ObjStr.put(Obj.COALNE, "coastline"); ObjStr.put(Obj.CONZNE, "contiguous_zone"); 104 ObjStr.put(Obj.COSARE, "continental_shelf"); ObjStr.put(Obj.CTRPNT, "control_point"); ObjStr.put(Obj.CONVYR, "conveyor"); ObjStr.put(Obj.CRANES, "crane"); 105 ObjStr.put(Obj.CURENT, "current"); ObjStr.put(Obj.CUSZNE, "custom_zone"); ObjStr.put(Obj.DAMCON, "dam"); ObjStr.put(Obj.DAYMAR, "daymark"); 106 ObjStr.put(Obj.DWRTCL, "deep_water_route_centreline"); ObjStr.put(Obj.DWRTPT, "deep_water_route"); ObjStr.put(Obj.DEPARE, "depth_area"); 107 ObjStr.put(Obj.DEPCNT, "depth_contour"); ObjStr.put(Obj.DISMAR, "distance_mark"); ObjStr.put(Obj.DOCARE, "dock"); ObjStr.put(Obj.DRGARE, "dredged_area"); 108 ObjStr.put(Obj.DRYDOC, "dry_dock"); ObjStr.put(Obj.DMPGRD, "dumping_ground"); ObjStr.put(Obj.DYKCON, "dyke"); ObjStr.put(Obj.EXEZNE, "exclusive_economic_zone"); 109 ObjStr.put(Obj.FAIRWY, "fairway"); ObjStr.put(Obj.FNCLNE, "wall"); ObjStr.put(Obj.FERYRT, "ferry_route"); ObjStr.put(Obj.FSHZNE, "fishery_zone"); 110 ObjStr.put(Obj.FSHFAC, "fishing_facility"); ObjStr.put(Obj.FSHGRD, "fishing_ground"); ObjStr.put(Obj.FLODOC, "floating_dock"); ObjStr.put(Obj.FOGSIG, "fog_signal"); 111 ObjStr.put(Obj.FORSTC, "fortified_structure"); ObjStr.put(Obj.FRPARE, "free_port_area"); ObjStr.put(Obj.GATCON, "gate"); ObjStr.put(Obj.GRIDRN, "gridiron"); 112 ObjStr.put(Obj.HRBARE, "harbour_area"); ObjStr.put(Obj.HRBFAC, "harbour"); ObjStr.put(Obj.HULKES, "hulk"); ObjStr.put(Obj.ICEARE, "ice_area"); 113 ObjStr.put(Obj.ICNARE, "incineration_zone"); ObjStr.put(Obj.ISTZNE, "inshore_traffic_zone"); ObjStr.put(Obj.LAKARE, "lake"); ObjStr.put(Obj.LAKSHR, "lake_shore"); 114 ObjStr.put(Obj.LNDARE, "land_area"); ObjStr.put(Obj.LNDELV, "land_elevation"); ObjStr.put(Obj.LNDRGN, "land_region"); ObjStr.put(Obj.LNDMRK, "landmark"); 115 ObjStr.put(Obj.LIGHTS, "light"); ObjStr.put(Obj.LITFLT, "light_float"); ObjStr.put(Obj.LITVES, "light_vessel"); ObjStr.put(Obj.LOCMAG, "local_magnetic_anomaly"); 116 ObjStr.put(Obj.LOKBSN, "lock_basin"); ObjStr.put(Obj.LOGPON, "log_pond"); ObjStr.put(Obj.MAGVAR, "magnetic_variation"); ObjStr.put(Obj.MARCUL, "marine_farm"); 117 ObjStr.put(Obj.MIPARE, "military_area"); ObjStr.put(Obj.MORFAC, "mooring"); ObjStr.put(Obj.NAVLNE, "navigation_line"); ObjStr.put(Obj.OBSTRN, "obstruction"); 118 ObjStr.put(Obj.OFSPLF, "platform"); ObjStr.put(Obj.OSPARE, "production_area"); ObjStr.put(Obj.OILBAR, "oil_barrier"); ObjStr.put(Obj.PILPNT, "pile"); 119 ObjStr.put(Obj.PILBOP, "pilot_boarding"); ObjStr.put(Obj.PIPARE, "pipeline_area"); ObjStr.put(Obj.PIPOHD, "pipeline_overhead"); ObjStr.put(Obj.PIPSOL, "pipeline_submarine"); 120 ObjStr.put(Obj.PONTON, "pontoon"); ObjStr.put(Obj.PRCARE, "precautionary_area"); ObjStr.put(Obj.PRDARE, "land_production_area");ObjStr.put(Obj.PYLONS, "pylon"); 121 ObjStr.put(Obj.RADLNE, "radar_line"); ObjStr.put(Obj.RADRNG, "radar_range"); ObjStr.put(Obj.RADRFL, "radar_reflector"); ObjStr.put(Obj.RADSTA, "radar_station"); 122 ObjStr.put(Obj.RTPBCN, "radar_transponder"); ObjStr.put(Obj.RDOCAL, "calling-in_point"); ObjStr.put(Obj.RDOSTA, "radio_station"); ObjStr.put(Obj.RAILWY, "railway"); 123 ObjStr.put(Obj.RAPIDS, "rapids"); ObjStr.put(Obj.RCRTCL, "recommended_route_centreline"); ObjStr.put(Obj.RECTRC, "recommended_track"); 124 ObjStr.put(Obj.RCTLPT, "recommended_traffic_lane"); ObjStr.put(Obj.RSCSTA, "rescue_station"); ObjStr.put(Obj.RESARE, "restricted_area"); 125 ObjStr.put(Obj.RETRFL, "retro_reflector"); ObjStr.put(Obj.RIVERS, "river"); ObjStr.put(Obj.RIVBNK, "river_bank"); ObjStr.put(Obj.ROADWY, "road"); 126 ObjStr.put(Obj.RUNWAY, "runway"); ObjStr.put(Obj.SNDWAV, "sand_waves"); ObjStr.put(Obj.SEAARE, "sea_area"); ObjStr.put(Obj.SPLARE, "seaplane_landing_area"); 127 ObjStr.put(Obj.SBDARE, "seabed_area"); ObjStr.put(Obj.SLCONS, "shoreline_construction"); ObjStr.put(Obj.SISTAT, "signal_station_traffic"); 128 ObjStr.put(Obj.SISTAW, "signal_station_warning"); ObjStr.put(Obj.SILTNK, "tank"); ObjStr.put(Obj.SLOTOP, "slope_topline"); ObjStr.put(Obj.SLOGRD, "sloping_ground"); 129 ObjStr.put(Obj.SMCFAC, "small_craft_facility"); ObjStr.put(Obj.SOUNDG, "sounding"); ObjStr.put(Obj.SPRING, "spring"); ObjStr.put(Obj.SQUARE, "square"); 130 ObjStr.put(Obj.STSLNE, "territorial_baseline"); ObjStr.put(Obj.SUBTLN, "submarine_transit_lane"); ObjStr.put(Obj.SWPARE, "swept_area"); 131 ObjStr.put(Obj.TESARE, "territorial_area"); ObjStr.put(Obj.TS_PRH, ""); ObjStr.put(Obj.TS_PNH, ""); ObjStr.put(Obj.TS_PAD, ""); ObjStr.put(Obj.TS_TIS, ""); 132 ObjStr.put(Obj.T_HMON, ""); ObjStr.put(Obj.T_NHMN, ""); ObjStr.put(Obj.T_TIMS, ""); ObjStr.put(Obj.TIDEWY, "tideway"); ObjStr.put(Obj.TOPMAR, "topmark"); 133 ObjStr.put(Obj.TSELNE, "separation_line"); ObjStr.put(Obj.TSSBND, "separation_boundary"); ObjStr.put(Obj.TSSCRS, "separation_crossing"); 134 ObjStr.put(Obj.TSSLPT, "separation_lane"); ObjStr.put(Obj.TSSRON, "separation_roundabout"); ObjStr.put(Obj.TSEZNE, "separation_zone"); ObjStr.put(Obj.TUNNEL, "tunnel"); 135 ObjStr.put(Obj.TWRTPT, "two-way_route"); ObjStr.put(Obj.UWTROC, "rock"); ObjStr.put(Obj.UNSARE, "unsurveyed_area"); ObjStr.put(Obj.VEGATN, "vegetation"); 136 ObjStr.put(Obj.WATTUR, "water_turbulence"); ObjStr.put(Obj.WATFAL, "waterfall"); ObjStr.put(Obj.WEDKLP, "weed"); ObjStr.put(Obj.WRECKS, "wreck"); 137 ObjStr.put(Obj.TS_FEB, "tidal_stream"); ObjStr.put(Obj.M_ACCY, ""); ObjStr.put(Obj.M_CSCL, ""); ObjStr.put(Obj.M_COVR, "coverage"); ObjStr.put(Obj.M_HDAT, ""); 138 ObjStr.put(Obj.M_HOPA, ""); ObjStr.put(Obj.M_NPUB, ""); ObjStr.put(Obj.M_NSYS, ""); ObjStr.put(Obj.M_PROD, ""); ObjStr.put(Obj.M_QUAL, "data_quality"); 139 ObjStr.put(Obj.M_SDAT, ""); ObjStr.put(Obj.M_SREL, ""); ObjStr.put(Obj.M_UNIT, ""); ObjStr.put(Obj.M_VDAT, ""); ObjStr.put(Obj.C_AGGR, ""); ObjStr.put(Obj.C_ASSO, ""); 140 ObjStr.put(Obj.C_STAC, ""); ObjStr.put(Obj.$AREAS, ""); ObjStr.put(Obj.$LINES, ""); ObjStr.put(Obj.$CSYMB, ""); ObjStr.put(Obj.$COMPS, ""); ObjStr.put(Obj.$TEXTS, ""); 141 ObjStr.put(Obj.NOTMRK, "notice"); ObjStr.put(Obj.WTWAXS, "waterway_axis"); ObjStr.put(Obj.WTWPRF, "waterway_profile"); ObjStr.put(Obj.BRGARE, "bridge_area"); 142 ObjStr.put(Obj.BUNSTA, "bunker_station"); ObjStr.put(Obj.COMARE, "communication_area"); ObjStr.put(Obj.HRBBSN, "harbour_basin"); ObjStr.put(Obj.LOKARE, "lock_area"); 143 ObjStr.put(Obj.LKBSPT, "lock_basin_part"); ObjStr.put(Obj.PRTARE, "port_area"); ObjStr.put(Obj.BCNWTW, "beacon_waterway"); ObjStr.put(Obj.BOYWTW, "buoy_waterway"); 144 ObjStr.put(Obj.REFDMP, "refuse_dump"); ObjStr.put(Obj.RTPLPT, "route_planning_point"); ObjStr.put(Obj.TERMNL, "terminal"); ObjStr.put(Obj.TRNBSN, "turning_basin"); 145 ObjStr.put(Obj.WTWARE, "waterway_area"); ObjStr.put(Obj.WTWGAG, "waterway_gauge"); ObjStr.put(Obj.TISDGE, "time_schedule"); ObjStr.put(Obj.VEHTRF, "vehicle_transfer"); 146 ObjStr.put(Obj.EXCNST, "exceptional_structure"); ObjStr.put(Obj.LG_SDM, ""); ObjStr.put(Obj.LG_VSP, ""); ObjStr.put(Obj.LITMAJ, "light_major"); ObjStr.put(Obj.LITMIN, "light_minor"); 139 147 } 140 141 public static Integer encodeType(String type) { // Convert OSM object string to S57 feature code 142 if (type != null) { 143 for (Obj obj : ObjSTR.keySet()) { 144 if (ObjSTR.get(obj).equals(type)) { 145 if (ObjS57.get(obj) != null) 146 return ObjS57.get(obj); 147 else if (ObjIENC.get(obj) != null) 148 return ObjIENC.get(obj); 149 else break; 150 } 151 } 148 149 private static final HashMap<String, Obj> StrObj = new HashMap<String, Obj>(); 150 static { 151 for (Map.Entry<Obj, String> entry : ObjStr.entrySet()) { 152 StrObj.put(entry.getValue(), entry.getKey()); 152 153 } 153 return 0; 154 } 155 156 public static Obj decodeType(Integer objl) { // Convert S57 feature code to OSeaM object enumeration 157 Obj obj = S57Obj.get(objl); 158 return (obj != null) ? obj : Obj.UNKOBJ; 154 159 } 155 160 156 161 public static Integer encodeType(Obj type) { // Convert OSM object enumeration to S57 feature code 157 if (ObjS57. get(type) != null)162 if (ObjS57.containsKey(type)) 158 163 return ObjS57.get(type); 159 else if (ObjIENC. get(type) != null)164 else if (ObjIENC.containsKey(type)) 160 165 return ObjIENC.get(type); 161 166 return 0; 162 167 } 163 168 164 public static Obj lookupType(Integer type) { // Convert S57 feature code to OSeaM object enumeration165 if (type < 10000) {166 for (Obj obj : ObjS57.keySet()) {167 if (ObjS57.get(obj).equals(type)) {168 return obj;169 }170 }171 } else {172 for (Obj obj : ObjIENC.keySet()) {173 if (ObjIENC.get(obj).equals(type)) {174 return obj;175 }176 }177 }178 return Obj.UNKOBJ;179 }180 181 169 public static String stringType(Obj type) { // Convert OSeaM object enumeration to OSeaM object string 182 String str = ObjS TR.get(type);170 String str = ObjStr.get(type); 183 171 return str != null ? str : ""; 184 172 } 185 173 186 174 public static Obj enumType(String type) { // Convert OSeaM object string to OSeaM object enumeration 187 for (Obj obj : ObjSTR.keySet()) { 188 if (ObjSTR.get(obj).equals(type)) { 189 return obj; 190 } 191 } 192 return Obj.UNKOBJ; 175 if (StrObj.containsKey(type)) 176 return StrObj.get(type); 177 else 178 return Obj.UNKOBJ; 193 179 } 194 180 -
applications/editors/josm/plugins/smed2/src/s57/S57val.java
r29207 r29209 1109 1109 1110 1110 public static String decodeValue(String val, Integer attl) { // Convert S57 attribute value string to OSeaM attribute value string 1111 Att att = S57att. lookupAttribute(attl);1111 Att att = S57att.decodeAttribute(attl); 1112 1112 switch (keys.get(att).conv) { 1113 1113 case A: … … 1135 1135 1136 1136 1137 public static String stringValue(AttVal attval) { // Convert OSeaM value struct to OSeaM attribute value string1137 public static String stringValue(AttVal attval) { // Convert OSeaM value object to OSeaM attribute value string 1138 1138 switch (attval.conv) { 1139 1139 case A: … … 1171 1171 } 1172 1172 1173 public static AttVal convertValue(String val, Att att) { // Convert OSeaM attribute value string to OSeaM value struct1173 public static AttVal convertValue(String val, Att att) { // Convert OSeaM attribute value string to OSeaM value object 1174 1174 switch (keys.get(att).conv) { 1175 1175 case A:
Note:
See TracChangeset
for help on using the changeset viewer.