Ignore:
Timestamp:
2015-11-05T13:43:10+01:00 (11 years ago)
Author:
malcolmh
Message:

[seachart] updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/src/s57/S57att.java

    r31704 r31731  
    8686  AttIENC.put(Att.LC_DR1, 18022); AttIENC.put(Att.LC_DR2, 18023); AttIENC.put(Att.LC_SP1, 18024); AttIENC.put(Att.LC_SP2, 18025); AttIENC.put(Att.LC_WD1, 18026);
    8787  AttIENC.put(Att.LC_WD2, 18027); AttIENC.put(Att.SHPTYP, 33066); AttIENC.put(Att.UPDMSG, 40000); AttIENC.put(Att.BNKWTW, 17999);
    88  }
    89  
    90  private static final HashMap<Integer, Att> S57Att = new HashMap<Integer, Att>();
    91  static {
    92   for (Map.Entry<Att, Integer> entry : AttS57.entrySet()) {
    93    S57Att.put(entry.getValue(), entry.getKey());
    94   }
    95   for (Map.Entry<Att, Integer> entry : AttIENC.entrySet()) {
    96    S57Att.put(entry.getValue(), entry.getKey());
    97   }
    9888 }
    9989 
     
    354344 }
    355345
    356  public static Att decodeAttribute(long attribute) { // Convert S57 attribute code to SCM attribute enumeration
    357   Att att = S57Att.get((int)attribute);
    358   return (att != null) ? att : Att.UNKATT;
     346 public static Att decodeAttribute(long attl) { // Convert S57 attribute code to SCM attribute enumeration
     347                for (Att att : AttS57.keySet()) {
     348                        if (AttS57.get(att) == attl) return att;
     349                }
     350                for (Att att : AttIENC.keySet()) {
     351                        if (AttIENC.get(att) == attl) return att;
     352                }
     353  return Att.UNKATT;
    359354 }
    360355 
Note: See TracChangeset for help on using the changeset viewer.