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

add new jchart utility

File:
1 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                        }
Note: See TracChangeset for help on using the changeset viewer.