--- dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/BoundingBox.java 2014/09/11 20:44:20 2211 +++ dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/BoundingBox.java 2015/02/10 16:34:55 2264 @@ -27,18 +27,22 @@ } public void validateBbox() throws BoundingBoxException { - - if ( Math.abs(latitudeMax-latitudeMin)> 1.0) - throw new BoundingBoxException("For stor latitude forskel"); - if ( Math.abs(longitudeMax-longitudeMin)> 1.0) - throw new BoundingBoxException("For stor longitude forskel"); + double latDiff = Math.abs(latitudeMax - latitudeMin); + if ( latDiff > 1.1) { + throw new BoundingBoxException("For stor latitude forskel / " + latDiff); + } + + double lngDiff = Math.abs(longitudeMax - longitudeMin); + if ( lngDiff > 1.1) { + throw new BoundingBoxException("For stor longitude forskel / " + lngDiff); + } GeoPoint min = new GeoPoint(latitudeMin, longitudeMin); GeoPoint max = new GeoPoint(latitudeMax, longitudeMax); double afstand = GeoPoint.beregnAfstand(min, max); - if (afstand >= 90.0) { //hvis cross størrelsen er over 90 km - så er postnummeret for stort + if (afstand >= 125.0) { //hvis cross afstand er over 80 km - så er postnummeret for stort throw new BoundingBoxException("For stor cross afstand " + afstand); } } @@ -53,5 +57,17 @@ longitudeMin -= consts.getLongitudeMargin(); } + @Override + public BoundingBox clone() { + BoundingBox bb = new BoundingBox(); + bb.latitudeMax = this.latitudeMax; + bb.longitudeMax = this.longitudeMax; + + bb.latitudeMin = this.latitudeMin; + bb.longitudeMin = this.longitudeMin; + + return bb; + } + }