Update tests

This commit is contained in:
Victor Shcherb 2016-07-28 23:39:19 +02:00
parent a7ecbe3401
commit 9429fc9aab
2 changed files with 17 additions and 28 deletions

View file

@ -2021,15 +2021,16 @@ public class BinaryMapIndexReader {
private static boolean testMapSearch = false; private static boolean testMapSearch = false;
private static boolean testAddressSearch = false; private static boolean testAddressSearch = false;
private static boolean testAddressSearchName = true; private static boolean testAddressSearchName = false;
private static boolean testAddressJustifySearch = false; private static boolean testAddressJustifySearch = false;
private static boolean testPoiSearch = false; private static boolean testPoiSearch = false;
private static boolean testPoiSearchOnPath = false; private static boolean testPoiSearchOnPath = false;
private static boolean testTransportSearch = false; private static boolean testTransportSearch = true;
private static int sleft = MapUtils.get31TileNumberX(6.3);
private static int sright = MapUtils.get31TileNumberX(6.5); private static int sleft = MapUtils.get31TileNumberX(4.7495);
private static int stop = MapUtils.get31TileNumberY(49.9); private static int sright = MapUtils.get31TileNumberX(4.8608);
private static int sbottom = MapUtils.get31TileNumberY(49.7); private static int stop = MapUtils.get31TileNumberY(52.3395);
private static int sbottom = MapUtils.get31TileNumberY(52.2589);
private static int szoom = 15; private static int szoom = 15;
private static void println(String s) { private static void println(String s) {
@ -2037,8 +2038,9 @@ public class BinaryMapIndexReader {
} }
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
// File fl = new File(System.getProperty("maps") + /Synthetic_test_rendering.obf"); File fl = new File(System.getProperty("maps") + "/Synthetic_test_rendering.obf");
File fl = new File(System.getProperty("maps") + "/Map.obf"); fl = new File(System.getProperty("maps") + "/Netherlands_noord-holland_europe.obf");
RandomAccessFile raf = new RandomAccessFile(fl, "r"); RandomAccessFile raf = new RandomAccessFile(fl, "r");
BinaryMapIndexReader reader = new BinaryMapIndexReader(raf, fl); BinaryMapIndexReader reader = new BinaryMapIndexReader(raf, fl);
@ -2219,8 +2221,8 @@ public class BinaryMapIndexReader {
for (TransportIndex i : reader.transportIndexes) { for (TransportIndex i : reader.transportIndexes) {
println("Transport bounds : " + i.left + " " + i.right + " " + i.top + " " + i.bottom); println("Transport bounds : " + i.left + " " + i.right + " " + i.top + " " + i.bottom);
} }
{ for (TransportStop s : reader.searchTransportIndex(buildSearchTransportRequest(sleft, sright, stop, sbottom,
for (TransportStop s : reader.searchTransportIndex(buildSearchTransportRequest(sleft, sright, stop, sbottom, 15, null))) { -1, null))) {
println(s.getName()); println(s.getName());
TIntObjectHashMap<TransportRoute> routes = reader.getTransportRoutes(s.getReferencesToRoutes()); TIntObjectHashMap<TransportRoute> routes = reader.getTransportRoutes(s.getReferencesToRoutes());
for (net.osmand.data.TransportRoute route : routes.valueCollection()) { for (net.osmand.data.TransportRoute route : routes.valueCollection()) {
@ -2229,17 +2231,6 @@ public class BinaryMapIndexReader {
} }
} }
} }
{
for (TransportStop s : reader.searchTransportIndex(buildSearchTransportRequest(sleft, sright, stop, sbottom, 16, null))) {
println(s.getName());
TIntObjectHashMap<TransportRoute> routes = reader.getTransportRoutes(s.getReferencesToRoutes());
for (net.osmand.data.TransportRoute route : routes.valueCollection()) {
println(" " + route.getRef() + " " + route.getName() + " " + route.getDistance() + " "
+ route.getAvgBothDistance());
}
}
}
}
private static void updateFrequence(Map<String, Integer> street, String key) { private static void updateFrequence(Map<String, Integer> street, String key) {
if (!street.containsKey(key)) { if (!street.containsKey(key)) {

View file

@ -67,8 +67,6 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
if (latLonBounds == null) { if (latLonBounds == null) {
return new ArrayList<>(); return new ArrayList<>();
} }
int z = (int) Math.floor(tileBox.getZoom() + Math.log(view.getSettings().MAP_DENSITY.get()) / Math.log(2));
List<TransportStop> res = view.getApplication().getResourceManager().searchTransportSync(latLonBounds.top, latLonBounds.left, List<TransportStop> res = view.getApplication().getResourceManager().searchTransportSync(latLonBounds.top, latLonBounds.left,
latLonBounds.bottom, latLonBounds.right, new ResultMatcher<TransportStop>() { latLonBounds.bottom, latLonBounds.right, new ResultMatcher<TransportStop>() {