fix indexing options
git-svn-id: https://osmand.googlecode.com/svn/trunk@277 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
parent
2c120d7f26
commit
922fa3bdb4
4 changed files with 19 additions and 2 deletions
|
@ -44,6 +44,8 @@ public class ToDoConstants {
|
||||||
|
|
||||||
// BUGS Android
|
// BUGS Android
|
||||||
// FIXME !!!! Check agains ID is not unique ! (for relation/node/way - it could be the same) - checked for data extraction & index creator
|
// 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
|
// TODO swing
|
||||||
// 9. Fix issues with big files (such as netherlands) - save memory (!) - very slow due to transport index !
|
// 9. Fix issues with big files (such as netherlands) - save memory (!) - very slow due to transport index !
|
||||||
|
|
|
@ -15,12 +15,16 @@ public class TransportRoute extends MapObject {
|
||||||
private String ref;
|
private String ref;
|
||||||
private String operator;
|
private String operator;
|
||||||
private String type;
|
private String type;
|
||||||
|
private Integer dist = null;
|
||||||
|
|
||||||
public TransportRoute(Relation r, String ref){
|
public TransportRoute(Relation r, String ref){
|
||||||
super(r);
|
super(r);
|
||||||
this.ref = ref;
|
this.ref = ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TransportRoute(){
|
||||||
|
}
|
||||||
|
|
||||||
public List<TransportStop> getForwardStops() {
|
public List<TransportStop> getForwardStops() {
|
||||||
return forwardStops;
|
return forwardStops;
|
||||||
}
|
}
|
||||||
|
@ -67,6 +71,17 @@ public class TransportRoute extends MapObject {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getDistance(){
|
||||||
|
if(dist == null){
|
||||||
|
dist = getAvgBothDistance();
|
||||||
|
}
|
||||||
|
return dist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistance(Integer dist) {
|
||||||
|
this.dist = dist;
|
||||||
|
}
|
||||||
|
|
||||||
public int getAvgBothDistance(){
|
public int getAvgBothDistance(){
|
||||||
int d = 0;
|
int d = 0;
|
||||||
for(int i=1; i< backwardStops.size(); i++){
|
for(int i=1; i< backwardStops.size(); i++){
|
||||||
|
|
|
@ -340,7 +340,7 @@ public class DataIndexWriter {
|
||||||
assert IndexTransportRouteStop.values().length == 3;
|
assert IndexTransportRouteStop.values().length == 3;
|
||||||
prepRouteStops.setLong(IndexTransportRouteStop.ROUTE.ordinal() + 1, r.getId());
|
prepRouteStops.setLong(IndexTransportRouteStop.ROUTE.ordinal() + 1, r.getId());
|
||||||
prepRouteStops.setLong(IndexTransportRouteStop.STOP.ordinal() + 1, s.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);
|
addBatch(count, prepRouteStops);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -327,7 +327,7 @@ public class IndexConstants {
|
||||||
|
|
||||||
|
|
||||||
public enum IndexTransportRouteStop implements IndexColumn {
|
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;
|
boolean index = false;
|
||||||
String type = null;
|
String type = null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue