diff --git a/app/src/main/java/de/apps4ics/mountainnavigation/DatabaseHandler.java b/app/src/main/java/de/apps4ics/mountainnavigation/DatabaseHandler.java index f85ad95..ecdf3e6 100644 --- a/app/src/main/java/de/apps4ics/mountainnavigation/DatabaseHandler.java +++ b/app/src/main/java/de/apps4ics/mountainnavigation/DatabaseHandler.java @@ -35,12 +35,10 @@ private static final String KEY_POI_TYPE = "_type"; private static final String KEY_POI_TIME = "_time"; - private static final String KEY_LAT_END = "_lat_end"; - private static final String KEY_LON_END = "_lon_end"; - private static final String KEY_ALT_END = "_alt_end"; + private static final String KEY_GP_ID = "_gp_id"; private static final String KEY_FOUNTAIN_SIZE = "_size"; private static final String KEY_PATH_LENGTH = "_length"; - private static final String KEY_PATH_PATH_EXPOSED = "_path_exp"; + private static final String KEY_PATH_EXPOSED = "_path_exp"; private static final String KEY_PATH_DIFF_WET = "_path_diff"; private static final String KEY_PATH_GIDDINESS = "_path_giddiness"; private static final String KEY_PATH_CLIMBING = "_path_climbing"; diff --git a/app/src/main/java/de/apps4ics/mountainnavigation/Poi.java b/app/src/main/java/de/apps4ics/mountainnavigation/Poi.java index 850307d..7dd0bbe 100644 --- a/app/src/main/java/de/apps4ics/mountainnavigation/Poi.java +++ b/app/src/main/java/de/apps4ics/mountainnavigation/Poi.java @@ -1,16 +1,13 @@ package de.apps4ics.mountainnavigation; +import org.osmdroid.util.GeoPoint; + /** * Created by Vinz on 06.10.2015. */ public class Poi { private int _id; - private double _lat; - private double _lon; - private double _alt; private int _type; - private long _time; - private int _ext_poi_id; @Override public boolean equals(Object o) { @@ -20,61 +17,24 @@ Poi poi = (Poi) o; if (_id != poi._id) return false; - if (Double.compare(poi._lat, _lat) != 0) return false; - if (Double.compare(poi._lon, _lon) != 0) return false; - if (Double.compare(poi._alt, _alt) != 0) return false; if (_type != poi._type) return false; - if (_time != poi._time) return false; - return _ext_poi_id == poi._ext_poi_id; - + return true; } @Override public int hashCode() { - int result; - long temp; - result = _id; - temp = Double.doubleToLongBits(_lat); - result = 31 * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(_lon); - result = 31 * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(_alt); - result = 31 * result + (int) (temp ^ (temp >>> 32)); + int result = _id; result = 31 * result + _type; - result = 31 * result + (int) (_time ^ (_time >>> 32)); - result = 31 * result + _ext_poi_id; return result; } - public Poi(){ - - } - - public Poi(double _lat, double _lon, double _alt, int _type, long _time){ - this._lat = _lat; - this._lon = _lon; - this._alt = _alt; + public Poi(int _type){ this._type = _type; - this._time = _time; } - public Poi(double _lat, double _lon, double _alt, int _type, long _time, int _ext_poi_id){ - this._lat = _lat; - this._lon = _lon; - this._alt = _alt; - this._type = _type; - this._time = _time; - this._ext_poi_id = _ext_poi_id; - } - - public Poi(int _id, double _lat, double _lon, double _alt, int _type, long _time, int _ext_poi_id){ + public Poi(int _id, int _type){ this._id = _id; - this._lat = _lat; - this._lon = _lon; - this._alt = _alt; this._type = _type; - this._time = _time; - this._ext_poi_id = _ext_poi_id; } public int getId(){ @@ -83,78 +43,95 @@ @Override public String toString() { - return "Poi{" + + return "Poi {" + "_id=" + _id + - ", _lat=" + _lat + - ", _lon=" + _lon + - ", _alt=" + _alt + ", _type=" + _type + - ", _time=" + _time + - ", _ext_poi_id=" + _ext_poi_id + '}'; } - public double getLat(){ - return _lat; - } - - public double getLon(){ - return _lon; - } - - public double getAlt(){ - return _alt; - } - public int getType(){ return _type; } - public long getTime(){ - return _time; - } - - public int getExtPoiId(){ - return _ext_poi_id; - } } class Fountain extends Poi { - + public Fountain(int _type){ + super(_type); + } } class Path extends Poi { - + public Path(int _type) { + super(_type); + } } class Hut extends Poi { + public Hut(int _type) { + super(_type); + } } class Peak extends Poi { + public Peak(int _type) { + super(_type); + } } class BreakPoint extends Poi { + public BreakPoint(int _type) { + super(_type); + } } class TrashBin extends Poi { + public TrashBin(int _type) { + super(_type); + } } class Image extends Poi { - String asso_type; + + public Image(int _type) { + super(_type); + } } class CellReception extends Poi { + public CellReception(int _type) { + super(_type); + } } class Wifi extends Poi { + public Wifi(int _type) { + super(_type); + } } class Lift extends Poi { + public Lift(int _type) { + super(_type); + } +} +class DbGeoPoint extends GeoPoint{ + private long _time; + + public DbGeoPoint(double aLatitude, double aLongitude, double aAltitude) { + super(aLatitude, aLongitude, aAltitude); + this._time = System.currentTimeMillis(); + } + + public DbGeoPoint(double aLatitude, double aLongitude, double aAltitude, long _time) { + super(aLatitude, aLongitude, aAltitude); + this._time = _time; + } } \ No newline at end of file