Ignore:
Timestamp:
2017-07-12T21:41:19+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #15012 - Support WMS endpoint in Imagery -> Rectified Image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java

    r11747 r12469  
    345345            bboxElem = getChild(element, "LatLonBoundingBox");
    346346            if (bboxElem != null) {
    347                 double left = Double.parseDouble(bboxElem.getAttribute("minx"));
    348                 double top = Double.parseDouble(bboxElem.getAttribute("maxy"));
    349                 double right = Double.parseDouble(bboxElem.getAttribute("maxx"));
    350                 double bot = Double.parseDouble(bboxElem.getAttribute("miny"));
     347                double left = getDecimalDegree(bboxElem ,"minx");
     348                double top = getDecimalDegree(bboxElem, "maxy");
     349                double right = getDecimalDegree(bboxElem, "maxx");
     350                double bot = getDecimalDegree(bboxElem, "miny");
    351351                bounds = new Bounds(bot, left, top, right);
    352352            }
     
    357357
    358358        return new LayerDetails(name, ident, crsList, josmSupportsThisLayer, bounds, childLayers);
     359    }
     360
     361    private static double getDecimalDegree(Element elem, String attr) {
     362        // Some real-world WMS servers use a comma instead of a dot as decimal separator (seen in Polish WMS server)
     363        return Double.parseDouble(elem.getAttribute(attr).replace(',', '.'));
    359364    }
    360365
Note: See TracChangeset for help on using the changeset viewer.