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