Ignore:
Timestamp:
2020-03-21T09:42:31+01:00 (6 years ago)
Author:
malcolmh
Message:

add new jchart utility

Location:
applications/editors/josm/plugins/seachart/src/s57
Files:
2 edited

Legend:

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

    r34652 r35388  
    112112                    for (String token : ln.split("[ ]+")) {
    113113                        if (token.matches("^minlat=.+")) {
    114                             map.bounds.minlat = Math.toRadians(Double.parseDouble(token.split("[\"\']")[1]));
     114                            map.bounds.minlat = Math.toRadians(Double.parseDouble(token.split("[\"]")[1]));
    115115                            map.nodes.get(2L).lat = map.bounds.minlat;
    116116                            map.nodes.get(3L).lat = map.bounds.minlat;
    117117                        } else if (token.matches("^minlon=.+")) {
    118                             map.bounds.minlon = Math.toRadians(Double.parseDouble(token.split("[\"\']")[1]));
     118                            map.bounds.minlon = Math.toRadians(Double.parseDouble(token.split("[\"]")[1]));
    119119                            map.nodes.get(1L).lon = map.bounds.minlon;
    120120                            map.nodes.get(2L).lon = map.bounds.minlon;
    121121                        } else if (token.matches("^maxlat=.+")) {
    122                             map.bounds.maxlat = Math.toRadians(Double.parseDouble(token.split("[\"\']")[1]));
     122                            map.bounds.maxlat = Math.toRadians(Double.parseDouble(token.split("[\"]")[1]));
    123123                            map.nodes.get(1L).lat = map.bounds.maxlat;
    124124                            map.nodes.get(4L).lat = map.bounds.maxlat;
    125125                        } else if (token.matches("^maxlon=.+")) {
    126                             map.bounds.maxlon = Math.toRadians(Double.parseDouble(token.split("[\"\']")[1]));
     126                            map.bounds.maxlon = Math.toRadians(Double.parseDouble(token.split("[\"]")[1]));
    127127                            map.nodes.get(3L).lon = map.bounds.maxlon;
    128128                            map.nodes.get(4L).lon = map.bounds.maxlon;
     
    133133                        k = v = "";
    134134                        String[] token = ln.split("k=");
    135                         k = token[1].split("[\"\']")[1];
     135                        k = token[1].split("[\"]")[1];
    136136                        token = token[1].split("v=");
    137                         v = token[1].split("[\"\']")[1];
     137                        v = token[1].split("[\"]")[1];
    138138                        if (!k.isEmpty() && !v.isEmpty()) {
    139139                            map.addTag(k, v);
     
    148148                        for (String token : ln.split("[ ]+")) {
    149149                            if (token.matches("^id=.+")) {
    150                                 id = Long.parseLong(token.split("[\"\']")[1]);
     150                                id = Long.parseLong(token.split("[\"]")[1]);
    151151                            } else if (token.matches("^lat=.+")) {
    152                                 lat = Double.parseDouble(token.split("[\"\']")[1]);
     152                                lat = Double.parseDouble(token.split("[\"]")[1]);
    153153                            } else if (token.matches("^lon=.+")) {
    154                                 lon = Double.parseDouble(token.split("[\"\']")[1]);
     154                                lon = Double.parseDouble(token.split("[\"]")[1]);
    155155                            }
    156156                        }
     
    166166                            for (String token : ln.split("[ ]+")) {
    167167                                if (token.matches("^ref=.+")) {
    168                                     ref = Long.parseLong(token.split("[\"\']")[1]);
     168                                    ref = Long.parseLong(token.split("[\"]")[1]);
    169169                                }
    170170                            }
     
    182182                        for (String token : ln.split("[ ]+")) {
    183183                            if (token.matches("^id=.+")) {
    184                                 id = Long.parseLong(token.split("[\"\']")[1]);
     184                                id = Long.parseLong(token.split("[\"]")[1]);
    185185                            }
    186186                        }
     
    202202                            for (String token : ln.split("[ ]+")) {
    203203                                if (token.matches("^ref=.+")) {
    204                                     ref = Long.parseLong(token.split("[\"\']")[1]);
     204                                    ref = Long.parseLong(token.split("[\"]")[1]);
    205205                                } else if (token.matches("^type=.+")) {
    206                                     type = token.split("[\"\']")[1];
     206                                    type = token.split("[\"]")[1];
    207207                                } else if (token.matches("^role=.+")) {
    208                                     String[] str = token.split("[\"\']");
     208                                    String[] str = token.split("[\"]");
    209209                                    if (str.length > 1) {
    210                                         role = token.split("[\"\']")[1];
     210                                        role = token.split("[\"]")[1];
    211211                                    }
    212212                                }
     
    222222                        for (String token : ln.split("[ ]+")) {
    223223                            if (token.matches("^id=.+")) {
    224                                 id = Long.parseLong(token.split("[\"\']")[1]);
     224                                id = Long.parseLong(token.split("[\"]")[1]);
    225225                            }
    226226                        }
  • applications/editors/josm/plugins/seachart/src/s57/S57val.java

    r34906 r35388  
    661661        SPM_NOTC, SPM_TSS, SPM_NANC, SPM_NBRT, SPM_NOTK, SPM_NTWT, SPM_RWAK, SPM_SPDL, SPM_STOP, SPM_WRNG, SPM_SSSN, SPM_RVCL, SPM_MVDT, SPM_RHCL, SPM_SCNT, SPM_BRTH, SPM_OHPC, SPM_CHEG, SPM_TELE, SPM_FCRS,
    662662        SPM_MTRL, SPM_PLIN, SPM_ANCH, SPM_CLRG, SPM_CTRL, SPM_DIVG, SPM_RBCN, SPM_FGND, SPM_YCHT, SPM_HPRT, SPM_GPS, SPM_SLDG, SPM_NENT, SPM_WRKP, SPM_UKPP, SPM_WELH, SPM_CHSP, SPM_MFRM, SPM_AREF,
    663         SPM_ICE, SPM_NATR, SPM_FAD, SPM_WREK, SPM_CUST, SPM_CSWY, SPM_WAVR, }
     663        SPM_ICE, SPM_NATR, SPM_FAD, SPM_WREK, SPM_CUST, SPM_CSWY, SPM_WAVR, SPM_NJET }
    664664
    665665    private static final EnumMap<CatSPM, S57enum> Catspm = new EnumMap<>(CatSPM.class); static {
     
    686686        Catspm.put(CatSPM.SPM_AREF, new S57enum(56, "artificial_reef")); Catspm.put(CatSPM.SPM_ICE, new S57enum(57, "ice")); Catspm.put(CatSPM.SPM_NATR, new S57enum(58, "nature_reserve"));
    687687        Catspm.put(CatSPM.SPM_FAD, new S57enum(59, "fish_aggregator")); Catspm.put(CatSPM.SPM_WREK, new S57enum(60, "wreck")); Catspm.put(CatSPM.SPM_CUST, new S57enum(61, "customs"));
    688         Catspm.put(CatSPM.SPM_CSWY, new S57enum(62, "causeway")); Catspm.put(CatSPM.SPM_WAVR, new S57enum(63, "wave_recorder"));
     688        Catspm.put(CatSPM.SPM_CSWY, new S57enum(62, "causeway")); Catspm.put(CatSPM.SPM_WAVR, new S57enum(63, "wave_recorder")); Catspm.put(CatSPM.SPM_NJET, new S57enum(64, "no_jetski"));
    689689    }
    690690
Note: See TracChangeset for help on using the changeset viewer.