Changeset 4522 in josm
- Timestamp:
- 2011-10-17T00:11:45+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Bounds.java
r4521 r4522 82 82 } 83 83 84 int minLatIndex;85 int minLonIndex;86 int maxLatIndex;87 int maxLonIndex;88 89 84 switch (parseMethod) { 90 85 case LEFT_BOTTOM_RIGHT_TOP: 91 minLatIndex = 1;92 minLonIndex = 0;93 maxLatIndex = 3;94 maxLonIndex = 2;86 this.minLat = initLat(values[1]); 87 this.minLon = initLon(values[0]); 88 this.maxLat = initLat(values[3]); 89 this.maxLon = initLon(values[2]); 95 90 break; 96 91 case MINLAT_MINLON_MAXLAT_MAXLON: 97 92 default: 98 minLatIndex = 0; 99 minLonIndex = 1; 100 maxLatIndex = 2; 101 maxLonIndex = 3; 102 } 103 104 if (!LatLon.isValidLat(values[minLatIndex])) 105 throw new IllegalArgumentException(tr("Illegal latitude value ''{0}''", values[minLatIndex])); 106 if (!LatLon.isValidLon(values[minLonIndex])) 107 throw new IllegalArgumentException(tr("Illegal longitude value ''{0}''", values[minLonIndex])); 108 if (!LatLon.isValidLat(values[maxLatIndex])) 109 throw new IllegalArgumentException(tr("Illegal latitude value ''{0}''", values[maxLatIndex])); 110 if (!LatLon.isValidLon(values[maxLonIndex])) 111 throw new IllegalArgumentException(tr("Illegal longitude value ''{0}''", values[maxLonIndex])); 112 113 this.minLat = LatLon.roundToOsmPrecision(values[minLatIndex]); 114 this.minLon = LatLon.roundToOsmPrecision(values[minLonIndex]); 115 this.maxLat = LatLon.roundToOsmPrecision(values[maxLatIndex]); 116 this.maxLon = LatLon.roundToOsmPrecision(values[maxLonIndex]); 93 this.minLat = initLat(values[0]); 94 this.minLon = initLon(values[1]); 95 this.maxLat = initLat(values[2]); 96 this.maxLon = initLon(values[3]); 97 } 98 } 99 100 protected static double initLat(double value) { 101 if (!LatLon.isValidLat(value)) 102 throw new IllegalArgumentException(tr("Illegal latitude value ''{0}''", value)); 103 return LatLon.roundToOsmPrecision(value); 104 } 105 106 protected static double initLon(double value) { 107 if (!LatLon.isValidLon(value)) 108 throw new IllegalArgumentException(tr("Illegal longitude value ''{0}''", value)); 109 return LatLon.roundToOsmPrecision(value); 117 110 } 118 111
Note:
See TracChangeset
for help on using the changeset viewer.