/[projects]/dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/BoundingBox.java
ViewVC logotype

Annotation of /dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/BoundingBox.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2145 - (hide annotations) (download)
Wed Apr 30 08:15:48 2014 UTC (10 years, 1 month ago) by torben
File size: 1169 byte(s)
Initial import.
1 torben 2145 package dk.daoas.fulddaekning;
2    
3     public class BoundingBox {
4    
5     public static class BoundingBoxException extends Exception{
6     public BoundingBoxException(String reason) {
7     super(reason);
8     }
9    
10     private static final long serialVersionUID = 1L;
11     }
12    
13     public static final double LATITUDE_MARGIN = 0.02702703;
14     public static final double LONGUTUDE_MARGIN = 0.046875;
15    
16     public double latitudeMax;
17     public double latitudeMin;
18    
19     public double longitudeMax;
20     public double longitudeMin;
21    
22    
23     @Override
24     public String toString() {
25     return "bbox: Latitude=" + latitudeMax +"/" + latitudeMin + " longitude=" + longitudeMax + "/" + longitudeMin;
26     }
27    
28     public void validateBbox() throws BoundingBoxException {
29     if ( Math.abs(latitudeMax-latitudeMin)> 1.0)
30     throw new BoundingBoxException("For stor latitude forskel");
31    
32     if ( Math.abs(longitudeMax-longitudeMin)> 1.0)
33     throw new BoundingBoxException("For stor longitude forskel");
34     }
35    
36     public void adjustToMargin() {
37     latitudeMax += LATITUDE_MARGIN;
38     latitudeMin -= LATITUDE_MARGIN;
39    
40     longitudeMax += LONGUTUDE_MARGIN;
41     longitudeMin -= LONGUTUDE_MARGIN;
42     }
43    
44    
45     }

  ViewVC Help
Powered by ViewVC 1.1.20