This commit is contained in:
Victor Shcherb 2015-11-25 16:49:28 +01:00
parent 4934413ac6
commit 87ddee7c84
4 changed files with 12 additions and 9 deletions

View file

@ -68,7 +68,7 @@ public class BinaryInspector {
in.inspector(new String[]{ in.inspector(new String[]{
// "-vpoi", // "-vpoi",
"-vmap","-vmapobjects", // "-vmapcoordinates", "-vmap","-vmapobjects", // "-vmapcoordinates",
// "-vrouting", "-vrouting",
// "-vaddress", "-vcities",//"-vstreetgroups", // "-vaddress", "-vcities",//"-vstreetgroups",
// "-vstreets", "-vbuildings", "-vintersections", // "-vstreets", "-vbuildings", "-vintersections",
// "-zoom=15", // "-zoom=15",

View file

@ -1950,7 +1950,7 @@ public class BinaryMapIndexReader {
private static boolean testMapSearch = false; private static boolean testMapSearch = false;
private static boolean testAddressSearch = true; private static boolean testAddressSearch = false;
private static boolean testPoiSearch = true; private static boolean testPoiSearch = true;
private static boolean testPoiSearchOnPath = false; private static boolean testPoiSearchOnPath = false;
private static boolean testTransportSearch = false; private static boolean testTransportSearch = false;
@ -1965,7 +1965,7 @@ public class BinaryMapIndexReader {
} }
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
File fl = new File("/Users/victorshcherb/osmand/osm-gen/map.obf"); File fl = new File("/Users/victorshcherb/osmand/maps/Synthetic_test_rendering.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);
@ -2109,7 +2109,7 @@ public class BinaryMapIndexReader {
private static void testPoiSearchByName(BinaryMapIndexReader reader) throws IOException { private static void testPoiSearchByName(BinaryMapIndexReader reader) throws IOException {
println("Searching by name..."); println("Searching by name...");
SearchRequest<Amenity> req = buildSearchPoiRequest(0, 0, "кие", SearchRequest<Amenity> req = buildSearchPoiRequest(0, 0, "aBS",
0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null); 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null);
reader.searchPoiByName(req); reader.searchPoiByName(req);
for (Amenity a : req.getSearchResults()) { for (Amenity a : req.getSearchResults()) {

View file

@ -9,9 +9,9 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator; import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import net.osmand.Collator; import net.osmand.Collator;
@ -26,9 +26,7 @@ import net.osmand.data.Amenity.AmenityRoutePoint;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.osm.MapPoiTypes; import net.osmand.osm.MapPoiTypes;
import net.osmand.osm.PoiCategory; import net.osmand.osm.PoiCategory;
import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils; import net.osmand.util.MapUtils;
import net.sf.junidecode.Junidecode;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -553,6 +551,13 @@ public class BinaryMapPoiReaderAdapter {
break; break;
} }
} }
Map<String, String> lt = am.getAdditionalInfo();
for (Entry<String, String> e : lt.entrySet()) {
matches = matcher.matches(e.getValue());
if (matches) {
break;
}
}
} }
if(matches) { if(matches) {
req.publish(am); req.publish(am);

View file

@ -1,13 +1,11 @@
package net.osmand.data; package net.osmand.data;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;