public GPSData(JSONObject json){
		this.key = new KeyNames();
		try {
			if(!json.isNull(key.ELEVATION_GAIN)) this.elevationGain=json.getDouble(key.ELEVATION_GAIN);
			if(!json.isNull(key.ELEVATION_LOSS)) this.elevationLoss=json.getDouble(key.ELEVATION_LOSS);
			if(!json.isNull(key.ELEVATION_MAX)) this.elevationMax = json.getDouble(key.ELEVATION_MAX);
			if(!json.isNull(key.ELEVATION_MIN)) this.elevationMin = json.getDouble(key.ELEVATION_MIN);
			if(!json.isNull(key.INTERVAL_METRIC)) this.intervalMetric = json.getInt(key.INTERVAL_METRIC);
			if(!json.isNull(key.INTERVAL_UNIT)) this.intervalUnit = json.getString(key.INTERVAL_UNIT);
			if(!json.isNull(key.WAYPOINTS)){
				JSONArray array = json.getJSONArray(key.WAYPOINTS);
				int size = array.length();
				this.waypoints = new JNWayPoint[size];
				for(int i=0; i<size; i++){
					this.waypoints[i] = new JNWayPoint(array.getJSONObject(i));
				}
			}
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}