1 |
package dk.daoas.fulddaekning;
|
2 |
|
3 |
import com.jwetherell.algorithms.data_structures.KdTree;
|
4 |
|
5 |
public class Adresse extends KdTree.XYZPoint {
|
6 |
public int id;
|
7 |
public short postnr;
|
8 |
public String vejnavn;
|
9 |
public int gadeid;
|
10 |
public short husnr;
|
11 |
public String husnrbogstav;
|
12 |
public String rute;
|
13 |
public short ho;
|
14 |
|
15 |
public double latitude;
|
16 |
public double longitude;
|
17 |
|
18 |
public double xyz[] = new double[3];
|
19 |
|
20 |
public Adresse(double latitude, double longitude) {
|
21 |
super(latitude, longitude);
|
22 |
|
23 |
this.latitude = latitude;
|
24 |
this.longitude = longitude;
|
25 |
|
26 |
xyz[0] = Math.cos(Math.toRadians(latitude)) * Math.cos(Math.toRadians(longitude));
|
27 |
xyz[1] = Math.cos(Math.toRadians(latitude)) * Math.sin(Math.toRadians(longitude));
|
28 |
xyz[2] = Math.sin(Math.toRadians(latitude));
|
29 |
|
30 |
}
|
31 |
|
32 |
|
33 |
@Override
|
34 |
public String toString() {
|
35 |
return "Adresse id=" + id+ " postnr=" + postnr + " adresse=" + vejnavn + " " + husnr + husnrbogstav + " ho=" + ho;
|
36 |
}
|
37 |
|
38 |
public String getPosString() {
|
39 |
return "" + latitude + ", " + longitude + " " + xyz[0] + "/" + xyz[1] + "/" + xyz[2];
|
40 |
}
|
41 |
|
42 |
}
|