From c7dddc3f23217b6460bf4586ad6131ec2564df0b Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 15:19:45 +0200 Subject: [PATCH] removed unused methods --- .../plus/resources/ResourceManager.java | 39 +--------------- .../plus/wikivoyage/data/TravelObfHelper.java | 46 +++++++++---------- 2 files changed, 25 insertions(+), 60 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 7d6bbd82f1..5d5ca05c96 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -803,28 +803,11 @@ public class ResourceManager { private void collectTravelFiles(BinaryMapIndexReader mapReader, BinaryMapReaderResource resource) { BinaryMapIndexReader index = mapReader; - for (BinaryIndexPart p : index.getIndexes()) { - if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { - transportRepositories.put(index.getFile().getName(), resource); - } + for (BinaryIndexPart p : index.getPoiIndexes()) { + travelRepositories.put(index.getFile().getName(), resource); } } - private List getTravelRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { - List fileNames = new ArrayList<>(travelRepositories.keySet()); - Collections.sort(fileNames, Algorithms.getStringVersionComparator()); - List res = new ArrayList<>(); - for (String fileName : fileNames) { - BinaryMapReaderResource r = travelRepositories.get(fileName); - if (r != null && r.isUseForPublicTransport() && - r.getShallowReader().containTransportData(topLat, leftLon, bottomLat, rightLon)) { - res.add(r.getReader(BinaryMapReaderResourceType.POI)); - } - } - return res; - } - - public void initMapBoundariesCacheNative() { File indCache = context.getAppPath(INDEXES_CACHE); if (indCache.exists()) { @@ -1115,24 +1098,6 @@ public class ResourceManager { fileReaders.clear(); } - public List getTravelFiles() { - Collection fileReaders = getFileReaders(); - List readers = new ArrayList<>(fileReaders.size()); - for (BinaryMapReaderResource res : fileReaders) { - if (!res.filename.toString().toLowerCase() - .contains(IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)) { - continue; - } - BinaryMapIndexReader index = res.getReader(BinaryMapReaderResourceType.POI); - for (BinaryIndexPart p : index.getIndexes()) { - if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { - readers.add(index); - } - } - } - return readers; - } - public BinaryMapIndexReader[] getRoutingMapFiles() { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 7fc4995804..b162fa8698 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -69,30 +69,30 @@ public class TravelObfHelper implements TravelHelper { @NonNull public List search(final String searchQuery) { // TODO remove - this.files = application.getResourceManager().getTravelFiles(); + //this.files = application.getResourceManager().getTravelFiles(); List res = new ArrayList<>(); - List searchObjects = new ArrayList<>(); - for (BinaryMapIndexReader reader : files) { - try { - BinaryMapIndexReader.SearchRequest searchRequest = BinaryMapIndexReader. - buildSearchPoiRequest(0, 0, searchQuery, - 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null); - - searchObjects = reader.searchPoiByName(searchRequest); - } catch (IOException e) { - LOG.error(e); - } - } - for (MapObject obj : searchObjects) { - //TODO map - WikivoyageSearchResult r = new WikivoyageSearchResult(); - r.articleTitles = Collections.singletonList(obj.getName()); - r.langs = Collections.singletonList(obj.getName()); - r.imageTitle = (obj.getName()); - r.isPartOf = Collections.singletonList(obj.getName()); - r.routeId = "routeid";//obj.getId(); - res.add(r); - } +// List searchObjects = new ArrayList<>(); +// for (BinaryMapIndexReader reader : files) { +// try { +// BinaryMapIndexReader.SearchRequest searchRequest = BinaryMapIndexReader. +// buildSearchPoiRequest(0, 0, searchQuery, +// 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null); +// +// searchObjects = reader.searchPoiByName(searchRequest); +// } catch (IOException e) { +// LOG.error(e); +// } +// } +// for (MapObject obj : searchObjects) { +// //TODO map +// WikivoyageSearchResult r = new WikivoyageSearchResult(); +// r.articleTitles = Collections.singletonList(obj.getName()); +// r.langs = Collections.singletonList(obj.getName()); +// r.imageTitle = (obj.getName()); +// r.isPartOf = Collections.singletonList(obj.getName()); +// r.routeId = "routeid";//obj.getId(); +// res.add(r); +// } return res; }