Ignore:
Timestamp:
2018-04-07T20:42:34+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16129 - projections rework for new ESRI file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/conversion/LatLonParser.java

    r12838 r13602  
    5050    private static final Pattern P_XML = Pattern.compile(
    5151            "lat=[\"']([+|-]?\\d+[.,]\\d+)[\"']\\s+lon=[\"']([+|-]?\\d+[.,]\\d+)[\"']");
     52
     53    private static final String FLOAT = "(\\d+(\\.\\d*)?)";
     54    /** Degree-Minute-Second pattern **/
     55    private static final String DMS = "(?<neg1>-)?"
     56            + "(?=\\d)(?:(?<single>" + FLOAT + ")|"
     57            + "((?<degree>" + FLOAT + ")d)?"
     58            + "((?<minutes>" + FLOAT + ")\')?"
     59            + "((?<seconds>" + FLOAT + ")\")?)"
     60            + "(?:[NE]|(?<neg2>[SW]))?";
     61    private static final Pattern P_DMS = Pattern.compile("^" + DMS + "$");
    5262
    5363    private static class LatLonHolder {
     
    199209     */
    200210    public static double parseCoordinate(String angleStr) {
    201         final String floatPattern = "(\\d+(\\.\\d*)?)";
    202211        // pattern does all error handling.
    203         Matcher in = Pattern.compile("^(?<neg1>-)?"
    204                 + "(?=\\d)(?:(?<single>" + floatPattern + ")|"
    205                 + "((?<degree>" + floatPattern + ")d)?"
    206                 + "((?<minutes>" + floatPattern + ")\')?"
    207                 + "((?<seconds>" + floatPattern + ")\")?)"
    208                 + "(?:[NE]|(?<neg2>[SW]))?$").matcher(angleStr);
     212        Matcher in = P_DMS.matcher(angleStr);
    209213
    210214        if (!in.find()) {
Note: See TracChangeset for help on using the changeset viewer.