2011-07-03 15:08:34 +02:00
|
|
|
package net.osmand.router;
|
|
|
|
|
2012-06-09 00:34:13 +02:00
|
|
|
import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteDataObject;
|
2011-07-03 15:08:34 +02:00
|
|
|
import net.osmand.osm.LatLon;
|
2012-06-11 22:28:57 +02:00
|
|
|
import net.osmand.osm.MapUtils;
|
2011-07-03 15:08:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
public class RouteSegmentResult {
|
2012-06-11 22:28:57 +02:00
|
|
|
private RouteDataObject object;
|
|
|
|
private int startPointIndex;
|
|
|
|
private int endPointIndex;
|
|
|
|
private float segmentTime;
|
|
|
|
|
|
|
|
public RouteSegmentResult(RouteDataObject object, int startPointIndex, int endPointIndex) {
|
|
|
|
this.object = object;
|
|
|
|
this.startPointIndex = startPointIndex;
|
|
|
|
this.endPointIndex = endPointIndex;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public RouteDataObject getObject() {
|
|
|
|
return object;
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getSegmentTime() {
|
|
|
|
return segmentTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setSegmentTime(float segmentTime) {
|
|
|
|
this.segmentTime = segmentTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
public LatLon getStartPoint() {
|
|
|
|
return convertPoint(object, startPointIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getStartPointIndex() {
|
|
|
|
return startPointIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getEndPointIndex() {
|
|
|
|
return endPointIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
public LatLon getPoint(int i) {
|
|
|
|
return convertPoint(object, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
public LatLon getEndPoint() {
|
|
|
|
return convertPoint(object, endPointIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
private LatLon convertPoint(RouteDataObject o, int ind){
|
|
|
|
return new LatLon(MapUtils.get31LatitudeY(o.getPoint31YTile(ind)), MapUtils.get31LongitudeX(o.getPoint31XTile(ind)));
|
|
|
|
}
|
2011-07-03 15:08:34 +02:00
|
|
|
}
|