fix indexing options

git-svn-id: https://osmand.googlecode.com/svn/trunk@277 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-07-02 13:30:30 +00:00
parent 2c120d7f26
commit 922fa3bdb4
4 changed files with 19 additions and 2 deletions

View file

@ -44,6 +44,8 @@ public class ToDoConstants {
// BUGS Android
// FIXME !!!! Check agains ID is not unique ! (for relation/node/way - it could be the same) - checked for data extraction & index creator
// REFACTOR Settings activity ( for check box properties!)
// Download index show current index information
// TODO swing
// 9. Fix issues with big files (such as netherlands) - save memory (!) - very slow due to transport index !

View file

@ -15,12 +15,16 @@ public class TransportRoute extends MapObject {
private String ref;
private String operator;
private String type;
private Integer dist = null;
public TransportRoute(Relation r, String ref){
super(r);
this.ref = ref;
}
public TransportRoute(){
}
public List<TransportStop> getForwardStops() {
return forwardStops;
}
@ -67,6 +71,17 @@ public class TransportRoute extends MapObject {
this.type = type;
}
public int getDistance(){
if(dist == null){
dist = getAvgBothDistance();
}
return dist;
}
public void setDistance(Integer dist) {
this.dist = dist;
}
public int getAvgBothDistance(){
int d = 0;
for(int i=1; i< backwardStops.size(); i++){

View file

@ -340,7 +340,7 @@ public class DataIndexWriter {
assert IndexTransportRouteStop.values().length == 3;
prepRouteStops.setLong(IndexTransportRouteStop.ROUTE.ordinal() + 1, r.getId());
prepRouteStops.setLong(IndexTransportRouteStop.STOP.ordinal() + 1, s.getId());
prepRouteStops.setBoolean(IndexTransportRouteStop.DIRECTION.ordinal() + 1, direction);
prepRouteStops.setInt(IndexTransportRouteStop.DIRECTION.ordinal() + 1, direction ? 1 : 0);
addBatch(count, prepRouteStops);
}
}

View file

@ -327,7 +327,7 @@ public class IndexConstants {
public enum IndexTransportRouteStop implements IndexColumn {
STOP("long", true), ROUTE("long", true), DIRECTION("boolean"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
STOP("long", true), ROUTE("long", true), DIRECTION("short"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
boolean index = false;
String type = null;