--- dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/Adresse.java 2015/07/13 10:16:41 2597 +++ dao/FuldDaekningWorker/src/main/java/dk/daoas/fulddaekning/Adresse.java 2015/10/07 20:14:10 2747 @@ -1,37 +1,40 @@ package dk.daoas.fulddaekning; -import geocode.GeoPoint; -public class Adresse extends GeoPoint { +public class Adresse { public int id; public short postnr; - public String adresse; + public String vejnavn; public int gadeid; public short husnr; public String husnrbogstav; public String rute; public short ho; - public Adresse(Double latitude, Double longitude) { - super(latitude, longitude); + public double latitude; + public double longitude; + + public double xyz[] = new double[3]; + + public Adresse(double latitude, double longitude) { + + this.latitude = latitude; + this.longitude = longitude; + + xyz[0] = Math.cos(Math.toRadians(latitude)) * Math.cos(Math.toRadians(longitude)); + xyz[1] = Math.cos(Math.toRadians(latitude)) * Math.sin(Math.toRadians(longitude)); + xyz[2] = Math.sin(Math.toRadians(latitude)); + } @Override public String toString() { - return "Adresse id=" + id+ " postnr=" + postnr + " adresse=" + adresse + " ho=" + ho; + return "Adresse id=" + id+ " postnr=" + postnr + " adresse=" + vejnavn + " " + husnr + husnrbogstav + " ho=" + ho; } - /*@Override //Fra KDNodeComparator - protected boolean isNodeCompatible(GeoPoint other) { - if (! (other instanceof Adresse) ) { - System.out.print("How the hell did this happen?"); - System.exit(1); - return false; - } - Adresse addr = (Adresse) other; - - return (this.ho == addr.ho); - }*/ + public String getPosString() { + return "" + latitude + ", " + longitude + " " + xyz[0] + "/" + xyz[1] + "/" + xyz[2]; + } }