Changeset 35033 in osm


Ignore:
Timestamp:
2019-06-17T12:00:15+02:00 (5 years ago)
Author:
gerdp
Message:

don't creae error "SEVERE: Invalid Bounds: Bounds[0.0,0.0,0.0,0.0]" for pbf file without bounds

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pbf/src/org/openstreetmap/josm/plugins/pbf/io/PbfReader.java

    r34858 r35033  
    7373            }
    7474
    75             HeaderBBox bbox = header.getBbox();
    76             if (bbox != null) {
    77                 double minlat = parseRawDegrees(bbox.getBottom());
    78                 double minlon = parseRawDegrees(bbox.getLeft());
    79                 double maxlat = parseRawDegrees(bbox.getTop());
    80                 double maxlon = parseRawDegrees(bbox.getRight());
    81                 Bounds b = new Bounds(minlat, minlon, maxlat, maxlon);
    82                 if (!b.isCollapsed() && areCoordinatesValid(minlat, minlon, maxlat, maxlon)) {
    83                     ds.addDataSource(new DataSource(b, header.getSource()));
    84                 } else {
    85                     Logging.error("Invalid Bounds: "+b);
    86                 }
     75            if (header.hasBbox()) {
     76                HeaderBBox bbox = header.getBbox();
     77                if (bbox != null) {
     78                        double minlat = parseRawDegrees(bbox.getBottom());
     79                        double minlon = parseRawDegrees(bbox.getLeft());
     80                        double maxlat = parseRawDegrees(bbox.getTop());
     81                        double maxlon = parseRawDegrees(bbox.getRight());
     82                        Bounds b = new Bounds(minlat, minlon, maxlat, maxlon);
     83                        if (!b.isCollapsed() && areCoordinatesValid(minlat, minlon, maxlat, maxlon)) {
     84                                ds.addDataSource(new DataSource(b, header.getSource()));
     85                        } else {
     86                                Logging.error("Invalid Bounds: "+b);
     87                        }
     88                }
    8789            }
    8890        }
Note: See TracChangeset for help on using the changeset viewer.