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

[seachart] updates

File:
1 edited

Legend:

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

    r31704 r31731  
    11501150 }
    11511151
    1152  public static Integer encodeValue(String val, Att att) { // Convert OSM attribute value string to S57 attribute value
    1153   EnumMap<?, ?> map = keys.get(att).map;
    1154   for (Object item : map.keySet()) {
    1155    if (((S57enum)map.get(item)).val.equals(val))
    1156     return ((S57enum)map.get(item)).atvl;
    1157   }
    1158   return 0;
    1159  }
    1160 
    1161  public static String stringValue(AttVal<?> attval, Att att) { // Convert SCM value object to OSM attribute value string
     1152 public static String encodeValue(AttVal<?> attval, Att att) { // Convert SCM attribute value to S57 attribute value string
     1153          if (attval != null) {
     1154                String str = stringValue(attval, att);
     1155                if ((attval.conv == Conv.E) || (attval.conv == Conv.L)) {
     1156                        String[] vals = str.split(";");
     1157                        str = "";
     1158                        for (String val : vals) {
     1159                                if (!str.isEmpty()) str += ",";
     1160                                EnumMap<?, ?> map = keys.get(att).map;
     1161                                for (Object item : map.keySet()) {
     1162                                        if (((S57enum)map.get(item)).val.equals(val))
     1163                        str += ((S57enum)map.get(item)).atvl.toString();
     1164                      }
     1165                        }
     1166                }
     1167                return str;
     1168          }
     1169  return "";
     1170 }
     1171
     1172 public static String stringValue(AttVal<?> attval, Att att) { // Convert SCM attribute value to OSM attribute value string
    11621173  if (attval != null) {
    11631174   switch (attval.conv) {
Note: See TracChangeset for help on using the changeset viewer.