27 |
} |
} |
28 |
|
|
29 |
public void validateBbox() throws BoundingBoxException { |
public void validateBbox() throws BoundingBoxException { |
30 |
|
|
31 |
if ( Math.abs(latitudeMax-latitudeMin)> 1.0) |
if ( Math.abs(latitudeMax-latitudeMin)> 1.0) |
32 |
throw new BoundingBoxException("For stor latitude forskel"); |
throw new BoundingBoxException("For stor latitude forskel"); |
33 |
|
|
34 |
if ( Math.abs(longitudeMax-longitudeMin)> 1.0) |
if ( Math.abs(longitudeMax-longitudeMin)> 1.0) |
35 |
throw new BoundingBoxException("For stor longitude forskel"); |
throw new BoundingBoxException("For stor longitude forskel"); |
36 |
|
|
37 |
|
GeoPoint min = new GeoPoint(latitudeMin, longitudeMin); |
38 |
|
GeoPoint max = new GeoPoint(latitudeMax, longitudeMax); |
39 |
|
double afstand = GeoPoint.beregnAfstand(min, max); |
40 |
|
|
41 |
|
if (afstand >= 90.0) { //hvis cross størrelsen er over 90 km - så er postnummeret for stort |
42 |
|
throw new BoundingBoxException("For stor cross afstand " + afstand); |
43 |
|
} |
44 |
} |
} |
45 |
|
|
46 |
public void adjustToMargin() { |
public void adjustToMargin() { |