From 87a7b42f66e4d14ade81b68a677ffa494ad96c2e Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 8 May 2020 16:40:58 +0300 Subject: [PATCH 01/91] work in project, crude merge working --- .../java/net/osmand/data/TransportRoute.java | 58 ++++++++ .../java/net/osmand/data/TransportStop.java | 15 +- .../osmand/router/TransportRoutePlanner.java | 136 +++++++++++++++--- 3 files changed, 192 insertions(+), 17 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java index 64839b8649..ba485fa2f7 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java @@ -12,6 +12,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import gnu.trove.map.hash.TLongObjectHashMap; + public class TransportRoute extends MapObject { private List forwardStops = new ArrayList(); private String ref; @@ -22,10 +24,30 @@ public class TransportRoute extends MapObject { private List forwardWays; private TransportSchedule schedule; public static final double SAME_STOP = 40; + private boolean combined = false; + private List routeParts = new ArrayList(); public TransportRoute() { } + public TransportRoute(TransportRoute r, boolean combined) { + this.name = r.name; + this.enName = r.enName; + this.names = r.names; + this.id = r.id; //TODO check if need ways and id here + this.operator = r.operator; + this.ref = r.ref; + this.type = r.type; + this.dist = r.dist; + this.color = r.color; + this.schedule = r.schedule; + this.combined = combined; + + if (combined) { + this.addRoutePart(r, true); + } + } + public TransportSchedule getSchedule() { return schedule; } @@ -38,6 +60,42 @@ public class TransportRoute extends MapObject { } + + public boolean isCombined() { + return combined; + } + + public void setCombined(boolean combined) { + this.combined = combined; + } + + public void addRoutePart(TransportRoute part, boolean forward) { + if (forward) { + routeParts.add(part); + for (int i = 0; i < part.getForwardStops().size(); i++) { + if (!part.getForwardStops().get(i).isMissingStop() && !forwardStops.contains(part.getForwardStops().get(i))) { + forwardStops.add(part.getForwardStops().get(i)); + } + } + } else { + routeParts.add(0, part); + for (int i = part.getForwardStops().size() - 1; i >= 0 ; i--) { + if (!part.getForwardStops().get(i).isMissingStop() && !forwardStops.contains(part.getForwardStops().get(i))) { + forwardStops.add(part.getForwardStops().get(i)); + } + } + } + } + + + public List getRouteParts() { + return routeParts; + } + + public void setRouteParts(List routeParts) { + this.routeParts = routeParts; + } + public List getForwardStops() { return forwardStops; } diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportStop.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportStop.java index b12afad9a1..48eb8e67f7 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportStop.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportStop.java @@ -22,7 +22,8 @@ public class TransportStop extends MapObject { private List exits; private List routes = null; private LinkedHashMap referencesToRoutesMap; - + private boolean missingStop = false; + private TransportStopAggregated transportStopAggregated; public TransportStop() {} @@ -30,7 +31,19 @@ public class TransportStop extends MapObject { public List getRoutes() { return routes; } + + @Override + public void setName(String name) { + super.setName(name); + if (name != null && name.equals("#Missing Stop")) { + missingStop = true; + } + } + public boolean isMissingStop() { + return missingStop; + } + public LinkedHashMap getReferencesToRoutesMap() { return referencesToRoutesMap; } diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 7b0b5b9f67..926fd68473 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -12,7 +12,9 @@ import java.util.Map; import java.util.PriorityQueue; import gnu.trove.iterator.TIntIterator; +import gnu.trove.iterator.TIntObjectIterator; import gnu.trove.list.array.TIntArrayList; +import gnu.trove.map.TIntObjectMap; import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.map.hash.TLongObjectHashMap; @@ -27,18 +29,20 @@ import net.osmand.data.TransportStop; import net.osmand.data.TransportStopExit; import net.osmand.osm.edit.Node; import net.osmand.osm.edit.Way; +import net.osmand.util.Algorithms; import net.osmand.util.MapUtils; public class TransportRoutePlanner { private static final boolean MEASURE_TIME = false; + private static final int MISSING_STOP_SEARCH_RADIUS = 15000; public static final long GEOMETRY_WAY_ID = -1; public static final long STOPS_WAY_ID = -2; public List buildRoute(TransportRoutingContext ctx, LatLon start, LatLon end) throws IOException, InterruptedException { ctx.startCalcTime = System.currentTimeMillis(); - List startStops = ctx.getTransportStops(start); - List endStops = ctx.getTransportStops(end); + List startStops = ctx.getTransportStops(start, true, false); + List endStops = ctx.getTransportStops(end, true, false); TLongObjectHashMap endSegments = new TLongObjectHashMap(); for(TransportRouteSegment s : endStops) { @@ -113,7 +117,7 @@ public class TransportRoutePlanner { break; } sgms.clear(); - sgms = ctx.getTransportStops(stop.x31, stop.y31, true, sgms); + sgms = ctx.getTransportStops(stop.x31, stop.y31, true, sgms, true, stop.isMissingStop()); ctx.visitedStops++; for (TransportRouteSegment sgm : sgms) { if (ctx.calculationProgress != null && ctx.calculationProgress.isCancelled) { @@ -701,7 +705,7 @@ public class TransportRoutePlanner { public RouteCalculationProgress calculationProgress; public TLongObjectHashMap visitedSegments = new TLongObjectHashMap(); public TransportRoutingConfiguration cfg; - + public TLongObjectHashMap combinedRoutes = new TLongObjectHashMap(); public TLongObjectHashMap> quadTree; public final Map> routeMap = @@ -720,7 +724,7 @@ public class TransportRoutePlanner { private final int walkRadiusIn31; private final int walkChangeRadiusIn31; - + private final int missingStopRadiusIn31; @@ -728,6 +732,7 @@ public class TransportRoutePlanner { this.cfg = cfg; walkRadiusIn31 = (int) (cfg.walkRadius / MapUtils.getTileDistanceWidth(31)); walkChangeRadiusIn31 = (int) (cfg.walkChangeRadius / MapUtils.getTileDistanceWidth(31)); + missingStopRadiusIn31 = (int) (MISSING_STOP_SEARCH_RADIUS / MapUtils.getTileDistanceWidth(31)); quadTree = new TLongObjectHashMap>(); this.library = library; for (BinaryMapIndexReader r : readers) { @@ -735,19 +740,22 @@ public class TransportRoutePlanner { } } - public List getTransportStops(LatLon loc) throws IOException { + public List getTransportStops(LatLon loc, boolean completeRoutes, boolean missingStop) throws IOException { int y = MapUtils.get31TileNumberY(loc.getLatitude()); int x = MapUtils.get31TileNumberX(loc.getLongitude()); - return getTransportStops(x, y, false, new ArrayList()); + return getTransportStops(x, y, false, new ArrayList(), completeRoutes, missingStop); } - public List getTransportStops(int x, int y, boolean change, List res) throws IOException { - return loadNativeTransportStops(x, y, change, res); + public List getTransportStops(int x, int y, boolean change, List res, boolean completeRoutes, boolean missingStop) throws IOException { + return loadNativeTransportStops(x, y, change, res, completeRoutes, missingStop); } - private List loadNativeTransportStops(int sx, int sy, boolean change, List res) throws IOException { + private List loadNativeTransportStops(int sx, int sy, boolean change, List res, boolean completeRoutes, boolean missingStop) throws IOException { long nanoTime = System.nanoTime(); int d = change ? walkChangeRadiusIn31 : walkRadiusIn31; + if (missingStop) { + d = missingStopRadiusIn31; + } int lx = (sx - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); int rx = (sx + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); int ty = (sy - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); @@ -757,11 +765,14 @@ public class TransportRoutePlanner { long tileId = (((long)x) << (cfg.ZOOM_TO_LOAD_TILES + 1)) + y; List list = quadTree.get(tileId); if(list == null) { - list = loadTile(x, y); + list = loadTile(x, y, completeRoutes); quadTree.put(tileId, list); } for(TransportRouteSegment r : list) { TransportStop st = r.getStop(r.segStart); +// if (missingStop && st.isMissingStop()) { +// +// } if (Math.abs(st.x31 - sx) > walkRadiusIn31 || Math.abs(st.y31 - sy) > walkRadiusIn31) { wrongLoadedWays++; } else { @@ -776,7 +787,7 @@ public class TransportRoutePlanner { } - private List loadTile(int x, int y) throws IOException { + private List loadTile(int x, int y, boolean completeRoutes) throws IOException { long nanoTime = System.nanoTime(); List lst = new ArrayList(); int pz = (31 - cfg.ZOOM_TO_LOAD_TILES); @@ -792,8 +803,9 @@ public class TransportRoutePlanner { localFileRoutes.clear(); mergeTransportStops(r, loadedTransportStops, stops, localFileRoutes, routeMap.get(r)); - + for (TransportStop stop : stops) { + long stopId = stop.getId(); TransportStop multifileStop = loadedTransportStops.get(stopId); int[] rrs = stop.getReferencesToRoutes(); @@ -807,6 +819,7 @@ public class TransportRoutePlanner { if (rrs != null && !multifileStop.isDeleted()) { for (int rr : rrs) { TransportRoute route = localFileRoutes.get(rr); + TransportRoute combinedRoute = getCombinedRoute(route); if (route == null) { System.err.println(String.format("Something went wrong by loading route %d for stop %s", rr, stop)); } else if (multifileStop == stop || @@ -814,13 +827,14 @@ public class TransportRoutePlanner { !multifileStop.isRouteDeleted(route.getId()))) { // duplicates won't be added multifileStop.addRouteId(route.getId()); - multifileStop.addRoute(route); +// multifileStop.addRoute(route); + multifileStop.addRoute(combinedRoute); //TODO how to add id? } } } } } - + //there should go stops with complete routes: loadTransportSegments(loadedTransportStops.valueCollection(), lst); readTime += System.nanoTime() - nanoTime; @@ -849,7 +863,7 @@ public class TransportRoutePlanner { localRoutesToLoad.addAll(stop.getReferencesToRoutes()); } } else if (multifileStop.isDeleted()){ - // stop has noting to load, so not needed + // stop has nothing to load, so not needed it.remove(); } else { if (delRIds != null) { @@ -903,7 +917,97 @@ public class TransportRoutePlanner { return stops; } + + private TransportRoute getCombinedRoute(TransportRoute route) throws IOException { + TransportRoute c = combinedRoutes.get(route.getId()); + if (c == null) { + c = combineRoute(route); + combinedRoutes.put(route.getId(), c); + } + + return c; + } + + private TransportRoute combineRoute(TransportRoute route) throws IOException { + TransportRoute cr = new TransportRoute(route, true); + TransportRoute missingPart; + if (route.getForwardStops().get(0).isMissingStop()) { + missingPart = loadMissingTransportRoute( + route.getForwardStops().get(0).x31, route.getForwardStops().get(0).y31, route); + if (missingPart != null) { + cr.addRoutePart(missingPart, false); + } + } + if (route.getForwardStops().get(route.getForwardStops().size()-1).isMissingStop()) { + missingPart = loadMissingTransportRoute( + route.getForwardStops().get(route.getForwardStops().size()-1).x31, + route.getForwardStops().get(route.getForwardStops().size()-1).y31, route); + if (missingPart != null) { + cr.addRoutePart(missingPart, true); + } + } + + return cr; + } + + private TransportRoute loadMissingTransportRoute(int sx, int sy, TransportRoute route) throws IOException { + long nanoTime = System.nanoTime(); + List res = new ArrayList(); + TIntObjectHashMap tr = new TIntObjectHashMap(); + int d = missingStopRadiusIn31; + int lx = (sx - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); + int rx = (sx + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); + int ty = (sy - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); + int by = (sy + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); + for(int x = lx; x <= rx; x++) { + for(int y = ty; y <= by; y++) { + long tileId = (((long)x) << (cfg.ZOOM_TO_LOAD_TILES + 1)) + y; +// List list = quadTree.get(tileId); +// if(list == null) { + tr = getRouteParts(x, y); +// quadTree.put(tileId, list); +// } + if (!tr.isEmpty()) { + res.addAll(tr.valueCollection()); + } + + } + } + for (TransportRoute trr : res) { + if ((long)trr.getId() == (long)route.getId()) { + if (trr.getForwardStops() != route.getForwardStops()) { + return trr; + } + } + } + + return null; + } + + private TIntObjectHashMap getRouteParts(int x, int y) throws IOException { + int pz = (31 - cfg.ZOOM_TO_LOAD_TILES); + SearchRequest sr = BinaryMapIndexReader.buildSearchTransportRequest(x << pz, (x + 1) << pz, + y << pz, (y + 1) << pz, -1, null); + + TLongObjectHashMap loadedTransportStops = new TLongObjectHashMap(); + TIntObjectHashMap localFileRoutes = new TIntObjectHashMap<>(); + TIntObjectHashMap res = new TIntObjectHashMap(); + for (BinaryMapIndexReader r : routeMap.keySet()) { + sr.clearSearchResults(); + List stops = r.searchTransportIndex(sr); + + localFileRoutes.clear(); + //search routes here: + mergeTransportStops(r, loadedTransportStops, stops, localFileRoutes, routeMap.get(r)); + if (!localFileRoutes.isEmpty()) { + res.putAll(localFileRoutes); + } + } + return res; + } + + private void loadTransportSegments(Collection stops, List lst) throws IOException { for(TransportStop s : stops) { if (s.isDeleted() || s.getRoutes() == null) { From 2c8824341ad1c4f5df1e87da8de4c9ca9d19b014 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Tue, 12 May 2020 12:42:12 +0300 Subject: [PATCH 02/91] work in progress --- .../osmand/binary/BinaryMapIndexReader.java | 8 +- .../java/net/osmand/data/TransportRoute.java | 4 +- .../osmand/router/TransportRoutePlanner.java | 120 ++++++++++++------ 3 files changed, 91 insertions(+), 41 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java index ce83e15956..dabb1c4959 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -109,7 +109,9 @@ public class BinaryMapIndexReader { /*private*/ List transportIndexes = new ArrayList(); /*private*/ List routingIndexes = new ArrayList(); /*private*/ List indexes = new ArrayList(); - + + private final TLongObjectHashMap incompleteRoutes = new TLongObjectHashMap(); + protected CodedInputStream codedIS; private final BinaryMapTransportReaderAdapter transportAdapter; @@ -2631,5 +2633,9 @@ public class BinaryMapIndexReader { } } + public int[] getIncompleteRoutesPointers(long id) { + return incompleteRoutes.get(id); + } + } diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java index ba485fa2f7..11d5699d4b 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java @@ -34,7 +34,7 @@ public class TransportRoute extends MapObject { this.name = r.name; this.enName = r.enName; this.names = r.names; - this.id = r.id; //TODO check if need ways and id here + this.id = r.id; this.operator = r.operator; this.ref = r.ref; this.type = r.type; @@ -59,8 +59,6 @@ public class TransportRoute extends MapObject { return schedule; } - - public boolean isCombined() { return combined; } diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 926fd68473..b0c1ffcb1e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; @@ -19,6 +20,7 @@ import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.map.hash.TLongObjectHashMap; import net.osmand.NativeLibrary; +import net.osmand.binary.BinaryIndexPart; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.SearchRequest; import net.osmand.data.LatLon; @@ -382,7 +384,7 @@ public class TransportRoutePlanner { public List getGeometry() { List list = new ArrayList<>(); - route.mergeForwardWays(); + route.mergeForwardWays(); //TODO merge ways of all Route parts if (DISPLAY_FULL_SEGMENT_ROUTE) { System.out.println("TOTAL SEGMENTS: " + route.getForwardWays().size()); if (route.getForwardWays().size() > DISPLAY_SEGMENT_IND) { @@ -706,11 +708,13 @@ public class TransportRoutePlanner { public TLongObjectHashMap visitedSegments = new TLongObjectHashMap(); public TransportRoutingConfiguration cfg; public TLongObjectHashMap combinedRoutes = new TLongObjectHashMap(); + public Map> missingStopsCache = new HashMap>(); public TLongObjectHashMap> quadTree; public final Map> routeMap = new LinkedHashMap>(); + // stats public long startCalcTime; public int visitedRoutesCount; @@ -770,9 +774,7 @@ public class TransportRoutePlanner { } for(TransportRouteSegment r : list) { TransportStop st = r.getStop(r.segStart); -// if (missingStop && st.isMissingStop()) { -// -// } + if (Math.abs(st.x31 - sx) > walkRadiusIn31 || Math.abs(st.y31 - sy) > walkRadiusIn31) { wrongLoadedWays++; } else { @@ -796,7 +798,7 @@ public class TransportRoutePlanner { // could be global ? TLongObjectHashMap loadedTransportStops = new TLongObjectHashMap(); - TIntObjectHashMap localFileRoutes = new TIntObjectHashMap<>(); + TIntObjectHashMap localFileRoutes = new TIntObjectHashMap<>(); //reference, route for (BinaryMapIndexReader r : routeMap.keySet()) { sr.clearSearchResults(); List stops = r.searchTransportIndex(sr); @@ -818,17 +820,16 @@ public class TransportRoutePlanner { } if (rrs != null && !multifileStop.isDeleted()) { for (int rr : rrs) { - TransportRoute route = localFileRoutes.get(rr); - TransportRoute combinedRoute = getCombinedRoute(route); - if (route == null) { + //TODO here we should assign only complete routes: + TransportRoute combinedRoute = getCombinedRoute(localFileRoutes.get(rr), r.getFile().getName()); + if (combinedRoute == null) { System.err.println(String.format("Something went wrong by loading route %d for stop %s", rr, stop)); } else if (multifileStop == stop || - (!multifileStop.hasRoute(route.getId()) && - !multifileStop.isRouteDeleted(route.getId()))) { + (!multifileStop.hasRoute(combinedRoute.getId()) && + !multifileStop.isRouteDeleted(combinedRoute.getId()))) { // duplicates won't be added - multifileStop.addRouteId(route.getId()); -// multifileStop.addRoute(route); - multifileStop.addRoute(combinedRoute); //TODO how to add id? + multifileStop.addRouteId(combinedRoute.getId()); + multifileStop.addRoute(combinedRoute); } } } @@ -841,16 +842,22 @@ public class TransportRoutePlanner { return lst; } + public static List mergeTransportStops(BinaryMapIndexReader reader, TLongObjectHashMap loadedTransportStops, List stops, TIntObjectHashMap localFileRoutes, - TIntObjectHashMap loadedRoutes) throws IOException { + TIntObjectHashMap loadedRoutes +// boolean processMissingStop + ) throws IOException { TIntArrayList routesToLoad = new TIntArrayList(); TIntArrayList localRoutesToLoad = new TIntArrayList(); Iterator it = stops.iterator(); while (it.hasNext()) { TransportStop stop = it.next(); +// if (stop.isMissingStop() && !processMissingStop) { +// continue; +// } long stopId = stop.getId(); localRoutesToLoad.clear(); TransportStop multifileStop = loadedTransportStops.get(stopId); @@ -890,10 +897,10 @@ public class TransportRoutePlanner { } } routesToLoad.addAll(localRoutesToLoad); - multifileStop.putReferencesToRoutes(reader.getFile().getName(), localRoutesToLoad.toArray()); + multifileStop.putReferencesToRoutes(reader.getFile().getName(), localRoutesToLoad.toArray()); //add valid stop and references to routes } - // load routes + // load/combine routes if (routesToLoad.size() > 0) { routesToLoad.sort(); TIntArrayList referencesToLoad = new TIntArrayList(); @@ -902,7 +909,7 @@ public class TransportRoutePlanner { while (itr.hasNext()) { int nxt = itr.next(); if (p != nxt) { - if (localFileRoutes != null && loadedRoutes != null && loadedRoutes.contains(nxt)) { + if (localFileRoutes != null && loadedRoutes != null && loadedRoutes.contains(nxt)) { //check if localFileRoutes.put(nxt, loadedRoutes.get(nxt)); } else { referencesToLoad.add(nxt); @@ -918,39 +925,78 @@ public class TransportRoutePlanner { return stops; } - private TransportRoute getCombinedRoute(TransportRoute route) throws IOException { + private TransportRoute getCombinedRoute(TransportRoute route, String fileName) throws IOException { + if (!route.getForwardStops().get(0).isMissingStop() && !route.getForwardStops().get(route.getForwardStops().size()-1).isMissingStop()) { + return route; + } + TransportRoute c = combinedRoutes.get(route.getId()); + if (c == null) { - c = combineRoute(route); + c = combineRoute(route, fileName); combinedRoutes.put(route.getId(), c); } return c; } - private TransportRoute combineRoute(TransportRoute route) throws IOException { + private TIntObjectHashMap findIncompleteRouteParts(TransportRoute baseRoute, String fileName) throws IOException { + int ptrs[]; + TIntObjectHashMap res = new TIntObjectHashMap(); + TIntObjectHashMap localRes = new TIntObjectHashMap(); +// TODO check if valid comparsion by filename + for (BinaryMapIndexReader bmir: routeMap.keySet()) { + if (!bmir.getFile().getName().equals(fileName)) { + /** + * What about situation when one route has several parts in map? + * MB check all readers and then sort it out? + * + * Should I check if those routes already loaded? But they shouldn't, + * else we will already had a combined route and never get there! + */ + localRes.clear(); + ptrs = bmir.getIncompleteRoutesPointers(baseRoute.getId()); + if (ptrs != null && ptrs.length > 0) { + localRes = bmir.getTransportRoutes(ptrs); + + res.putAll(localRes); + } + } + } + return res; + } + + + private TransportRoute combineRoute(TransportRoute route, String fileName) throws IOException { TransportRoute cr = new TransportRoute(route, true); - TransportRoute missingPart; - - if (route.getForwardStops().get(0).isMissingStop()) { - missingPart = loadMissingTransportRoute( - route.getForwardStops().get(0).x31, route.getForwardStops().get(0).y31, route); - if (missingPart != null) { - cr.addRoutePart(missingPart, false); - } - } - if (route.getForwardStops().get(route.getForwardStops().size()-1).isMissingStop()) { - missingPart = loadMissingTransportRoute( - route.getForwardStops().get(route.getForwardStops().size()-1).x31, - route.getForwardStops().get(route.getForwardStops().size()-1).y31, route); - if (missingPart != null) { - cr.addRoutePart(missingPart, true); - } - } + TIntObjectHashMap res = findIncompleteRouteParts(route, fileName); +// for () { + //TODO check for duplicates and subsets + //TODO connect in right order + +// } +// TransportRoute missingPart; +// if (route.getForwardStops().get(0).isMissingStop()) { +// missingPart = loadMissingTransportRoute( +// route.getForwardStops().get(0).x31, route.getForwardStops().get(0).y31, route); +// if (missingPart != null) { +// cr.addRoutePart(missingPart, false); +// } +// } +// if (route.getForwardStops().get(route.getForwardStops().size()-1).isMissingStop()) { +// missingPart = loadMissingTransportRoute( +// route.getForwardStops().get(route.getForwardStops().size()-1).x31, +// route.getForwardStops().get(route.getForwardStops().size()-1).y31, route); +// if (missingPart != null) { +// cr.addRoutePart(missingPart, true); +// } +// } return cr; } + + private TransportRoute loadMissingTransportRoute(int sx, int sy, TransportRoute route) throws IOException { long nanoTime = System.nanoTime(); List res = new ArrayList(); From 7699e2061c75bcf13697145f79f1522c5f40ec79 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Wed, 13 May 2020 15:09:30 +0300 Subject: [PATCH 03/91] add reading of incomplete routes. Add cache - work in progress --- .../osmand/binary/BinaryMapIndexReader.java | 12 ++- .../BinaryMapTransportReaderAdapter.java | 89 ++++++++++++++++++- .../osmand/data/IncompleteTransportRoute.java | 50 +++++++++++ .../java/net/osmand/data/TransportRoute.java | 4 + .../osmand/router/TransportRoutePlanner.java | 79 ++++++++-------- 5 files changed, 192 insertions(+), 42 deletions(-) create mode 100644 OsmAnd-java/src/main/java/net/osmand/data/IncompleteTransportRoute.java diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java index 5fedfc8eae..4ddb58377a 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -19,6 +19,7 @@ import net.osmand.binary.BinaryMapPoiReaderAdapter.PoiRegion; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteSubregion; import net.osmand.binary.BinaryMapTransportReaderAdapter.TransportIndex; +import net.osmand.binary.OsmandOdb.IncompleteTransportRoute; import net.osmand.binary.OsmandOdb.MapDataBlock; import net.osmand.binary.OsmandOdb.OsmAndMapIndex.MapDataBox; import net.osmand.binary.OsmandOdb.OsmAndMapIndex.MapEncodingRule; @@ -54,6 +55,7 @@ import java.io.InputStreamReader; import java.io.RandomAccessFile; import java.io.Reader; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -110,7 +112,8 @@ public class BinaryMapIndexReader { /*private*/ List routingIndexes = new ArrayList(); /*private*/ List indexes = new ArrayList(); - private final TLongObjectHashMap incompleteRoutes = new TLongObjectHashMap(); + private final TLongObjectHashMap incompleteRoutes = + new TLongObjectHashMap(); protected CodedInputStream codedIS; @@ -225,7 +228,7 @@ public class BinaryMapIndexReader { ind.filePointer = codedIS.getTotalBytesRead(); if (transportAdapter != null) { oldLimit = codedIS.pushLimit(ind.length); - transportAdapter.readTransportIndex(ind); + transportAdapter.readTransportIndex(ind, incompleteRoutes); codedIS.popLimit(oldLimit); transportIndexes.add(ind); indexes.add(ind); @@ -2633,9 +2636,12 @@ public class BinaryMapIndexReader { } } - public int[] getIncompleteRoutesPointers(long id) { + public net.osmand.data.IncompleteTransportRoute getIncompleteRoutePointers(long id) { return incompleteRoutes.get(id); } + public Collection getIncompleteRoutes() { + return incompleteRoutes.valueCollection(); + } } diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java index bf3a217306..617bf46f07 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java @@ -1,15 +1,20 @@ package net.osmand.binary; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Map; import com.google.protobuf.CodedInputStream; import com.google.protobuf.WireFormat; +import gnu.trove.list.array.TLongArrayList; import gnu.trove.map.hash.TIntObjectHashMap; +import gnu.trove.map.hash.TLongObjectHashMap; import net.osmand.binary.BinaryMapIndexReader.SearchRequest; +import net.osmand.binary.OsmandOdb.IncompleteTransportRoute; import net.osmand.data.TransportSchedule; import net.osmand.data.TransportStop; import net.osmand.data.TransportStopExit; @@ -43,6 +48,8 @@ public class BinaryMapTransportReaderAdapter { int stopsFileOffset = 0; int stopsFileLength = 0; + int incompleteRoutesOffset = 0; + int incompleteRoutesLength = 0; public String getPartName() { return "Transport"; @@ -67,7 +74,8 @@ public class BinaryMapTransportReaderAdapter { public int getBottom() { return bottom; } - + + IndexStringTable stringTable = null; } @@ -79,7 +87,7 @@ public class BinaryMapTransportReaderAdapter { } - protected void readTransportIndex(TransportIndex ind) throws IOException { + protected void readTransportIndex(TransportIndex ind, TLongObjectHashMap incompleteRoutes) throws IOException { while(true){ int t = codedIS.readTag(); int tag = WireFormat.getTagFieldNumber(t); @@ -108,6 +116,16 @@ public class BinaryMapTransportReaderAdapter { ind.stringTable = st; codedIS.seek(st.length + st.fileOffset); break; + case OsmandOdb.OsmAndTransportIndex.INCOMPLETEROUTES_FIELD_NUMBER : + TIntObjectHashMap stab = new TIntObjectHashMap(); + ind.incompleteRoutesLength = codedIS.readRawVarint32(); + ind.incompleteRoutesOffset = codedIS.getTotalBytesRead(); + int oldl = codedIS.pushLimit(ind.incompleteRoutesLength); + //may be we should start caching stringTable in advance? + readIncompleteRoutesList(incompleteRoutes, ind.incompleteRoutesLength, ind.incompleteRoutesOffset, stab); + codedIS.popLimit(oldl); + break; + default: skipUnknownField(t); break; @@ -240,6 +258,73 @@ public class BinaryMapTransportReaderAdapter { return ((char) i)+""; } + private void readIncompleteRoutesList(TLongObjectHashMap incompleteRoutes, + int length, int offset, TIntObjectHashMap stringTable) throws IOException { + codedIS.seek(offset); + + List irs = new ArrayList<>(); + boolean end = false; + while (!end) { + int t = codedIS.readTag(); + int tag = WireFormat.getTagFieldNumber(t); + switch (tag) { + case 0: + end = true; + break; + case OsmandOdb.IncompleteTransportRoutes.ROUTES_FIELD_NUMBER: + int l = codedIS.readRawVarint32(); + int olds = codedIS.pushLimit(l); + net.osmand.data.IncompleteTransportRoute ir = readIncompleteRoute(stringTable); + incompleteRoutes.put(ir.getRouteId(), ir); + codedIS.popLimit(olds); + break; + default: + skipUnknownField(t); + break; + } + + } + + } + + public net.osmand.data.IncompleteTransportRoute readIncompleteRoute(TIntObjectHashMap stringTable) throws IOException { + net.osmand.data.IncompleteTransportRoute dataObject = new net.osmand.data.IncompleteTransportRoute(); + boolean end = false; + while(!end){ + int t = codedIS.readTag(); + int tag = WireFormat.getTagFieldNumber(t); + switch (tag) { + case 0: + end = true; + break; + case OsmandOdb.IncompleteTransportRoute.ID_FIELD_NUMBER : + dataObject.setRouteId(codedIS.readUInt64()); + break; + case OsmandOdb.IncompleteTransportRoute.ROUTEREF_FIELD_NUMBER : + dataObject.setRouteOffset(codedIS.readRawVarint32()); + break; + case OsmandOdb.IncompleteTransportRoute.OPERATOR_FIELD_NUMBER : + dataObject.setOperator(regStr(stringTable)); + break; + case OsmandOdb.IncompleteTransportRoute.REF_FIELD_NUMBER : + dataObject.setRef(regStr(stringTable)); + break; + case OsmandOdb.IncompleteTransportRoute.TYPE_FIELD_NUMBER : + dataObject.setType(regStr(stringTable)); + break; + case OsmandOdb.IncompleteTransportRoute.MISSINGSTOPS_FIELD_NUMBER : +//// dataObject.getMissingStops().add(codedIS.readSInt32()); //skip for now + skipUnknownField(t); + break; + default: + skipUnknownField(t); + break; + } + } + + return dataObject; + } + public net.osmand.data.TransportRoute getTransportRoute(int filePointer, TIntObjectHashMap stringTable, boolean onlyDescription) throws IOException { codedIS.seek(filePointer); diff --git a/OsmAnd-java/src/main/java/net/osmand/data/IncompleteTransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/IncompleteTransportRoute.java new file mode 100644 index 0000000000..eb84be3453 --- /dev/null +++ b/OsmAnd-java/src/main/java/net/osmand/data/IncompleteTransportRoute.java @@ -0,0 +1,50 @@ +package net.osmand.data; + +import gnu.trove.list.array.TIntArrayList; + +public class IncompleteTransportRoute { + private long routeId; + private int routeOffset = -1; + private String operator; + private String type; + private String ref; +// private TIntArrayList missingStops; //not needed + public long getRouteId() { + return routeId; + } + public void setRouteId(long routeId) { + this.routeId = routeId; + } + public int getRouteOffset() { + return routeOffset; + } + public void setRouteOffset(int routeOffset) { + this.routeOffset = routeOffset; + } + public String getOperator() { + return operator; + } + public void setOperator(String operator) { + this.operator = operator; + } + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public String getRef() { + return ref; + } + public void setRef(String ref) { + this.ref = ref; + } +// public TIntArrayList getMissingStops() { +// return missingStops; +// } +// public void setMissingStops(TIntArrayList missingStops) { +// this.missingStops = missingStops; +// } + + +} \ No newline at end of file diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java index ff49525665..251bb6b867 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java @@ -63,6 +63,10 @@ public class TransportRoute extends MapObject { return combined; } + public boolean isIncomplete() { + return forwardStops.get(0).isMissingStop() || forwardStops.get(forwardStops.size()-1).isMissingStop(); + } + public void setCombined(boolean combined) { this.combined = combined; } diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index b0c1ffcb1e..4be06795ac 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -23,6 +23,7 @@ import net.osmand.NativeLibrary; import net.osmand.binary.BinaryIndexPart; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.SearchRequest; +import net.osmand.data.IncompleteTransportRoute; import net.osmand.data.LatLon; import net.osmand.data.QuadRect; import net.osmand.data.TransportRoute; @@ -707,7 +708,7 @@ public class TransportRoutePlanner { public RouteCalculationProgress calculationProgress; public TLongObjectHashMap visitedSegments = new TLongObjectHashMap(); public TransportRoutingConfiguration cfg; - public TLongObjectHashMap combinedRoutes = new TLongObjectHashMap(); + public TLongObjectHashMap combinedRoutesCache = new TLongObjectHashMap(); public Map> missingStopsCache = new HashMap>(); public TLongObjectHashMap> quadTree; @@ -926,55 +927,31 @@ public class TransportRoutePlanner { } private TransportRoute getCombinedRoute(TransportRoute route, String fileName) throws IOException { - if (!route.getForwardStops().get(0).isMissingStop() && !route.getForwardStops().get(route.getForwardStops().size()-1).isMissingStop()) { + if (!route.isIncomplete()) { return route; } - TransportRoute c = combinedRoutes.get(route.getId()); + TransportRoute c = combinedRoutesCache.get(route.getId()); if (c == null) { c = combineRoute(route, fileName); - combinedRoutes.put(route.getId(), c); + combinedRoutesCache.put(route.getId(), c); } return c; } - private TIntObjectHashMap findIncompleteRouteParts(TransportRoute baseRoute, String fileName) throws IOException { - int ptrs[]; - TIntObjectHashMap res = new TIntObjectHashMap(); - TIntObjectHashMap localRes = new TIntObjectHashMap(); -// TODO check if valid comparsion by filename - for (BinaryMapIndexReader bmir: routeMap.keySet()) { - if (!bmir.getFile().getName().equals(fileName)) { - /** - * What about situation when one route has several parts in map? - * MB check all readers and then sort it out? - * - * Should I check if those routes already loaded? But they shouldn't, - * else we will already had a combined route and never get there! - */ - localRes.clear(); - ptrs = bmir.getIncompleteRoutesPointers(baseRoute.getId()); - if (ptrs != null && ptrs.length > 0) { - localRes = bmir.getTransportRoutes(ptrs); - - res.putAll(localRes); - } - } - } - return res; - } - - private TransportRoute combineRoute(TransportRoute route, String fileName) throws IOException { TransportRoute cr = new TransportRoute(route, true); - TIntObjectHashMap res = findIncompleteRouteParts(route, fileName); -// for () { - //TODO check for duplicates and subsets - //TODO connect in right order + Collection res = findIncompleteRouteParts(route, fileName); + List stops = route.getForwardStops(); + List ways = route.getForwardWays(); + for (TransportRoute tr : res.valueCollection()) { -// } + //TODO check for duplicates and subsets + //TODO connect routes in right order (stops/ways) + + } // TransportRoute missingPart; // if (route.getForwardStops().get(0).isMissingStop()) { // missingPart = loadMissingTransportRoute( @@ -995,6 +972,35 @@ public class TransportRoutePlanner { return cr; } + private Collection findIncompleteRouteParts(TransportRoute baseRoute, String fileName) throws IOException { + IncompleteTransportRoute ptr; + TIntObjectHashMap res = new TIntObjectHashMap(); + TIntObjectHashMap localRes = new TIntObjectHashMap(); +// TODO check if valid comparison by filename + for (BinaryMapIndexReader bmir: routeMap.keySet()) { + if (!bmir.getFile().getName().equals(fileName)) { + /** + * What about situation when one route has several parts in map? + * MB check all readers and then sort it out? + * + * Should I check if those routes already loaded? But they shouldn't, + * else we will already had a combined route and never get there! + */ + localRes.clear(); + ptr = bmir.getIncompleteRoutePointers(baseRoute.getId()); + if (ptr!= null && ptr.getRouteOffset() != -1) { + localRes = bmir.getTransportRoutes(new int[] {ptr.getRouteOffset()}); + + res.putAll(localRes); + } + } + } + return res.valueCollection(); + } + + + + private TransportRoute loadMissingTransportRoute(int sx, int sy, TransportRoute route) throws IOException { @@ -1239,5 +1245,4 @@ public class TransportRoutePlanner { } return stops; } - } From d3d55cec4b3c419c1bc2b5c6a8e52abf06c786d4 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Thu, 14 May 2020 10:18:21 +0300 Subject: [PATCH 04/91] combine routes WIP --- .../java/net/osmand/data/TransportRoute.java | 15 +- .../osmand/router/TransportRoutePlanner.java | 207 ++++++++++++------ 2 files changed, 150 insertions(+), 72 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java index 251bb6b867..152bb281d9 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java @@ -71,12 +71,23 @@ public class TransportRoute extends MapObject { this.combined = combined; } - public void addRoutePart(TransportRoute part, boolean forward) { + public TransportStop getMissingStartStop() { + return forwardStops.get(0).isMissingStop() ? forwardStops.get(0) : null; + } + + public TransportStop getMissingEndStop() { + return forwardStops.get(forwardStops.size()-1).isMissingStop() ? forwardStops.get(forwardStops.size()-1) : null; + } + + public boolean addRoutePart(TransportRoute part, boolean forward) { + //TODO chec stop validity and combine ways + int addCount = 0; if (forward) { routeParts.add(part); for (int i = 0; i < part.getForwardStops().size(); i++) { if (!part.getForwardStops().get(i).isMissingStop() && !forwardStops.contains(part.getForwardStops().get(i))) { forwardStops.add(part.getForwardStops().get(i)); + addCount++; } } } else { @@ -84,9 +95,11 @@ public class TransportRoute extends MapObject { for (int i = part.getForwardStops().size() - 1; i >= 0 ; i--) { if (!part.getForwardStops().get(i).isMissingStop() && !forwardStops.contains(part.getForwardStops().get(i))) { forwardStops.add(part.getForwardStops().get(i)); + addCount++; } } } + return addCount > 0; } diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 4be06795ac..b7480d488d 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -808,7 +808,6 @@ public class TransportRoutePlanner { mergeTransportStops(r, loadedTransportStops, stops, localFileRoutes, routeMap.get(r)); for (TransportStop stop : stops) { - long stopId = stop.getId(); TransportStop multifileStop = loadedTransportStops.get(stopId); int[] rrs = stop.getReferencesToRoutes(); @@ -821,7 +820,7 @@ public class TransportRoutePlanner { } if (rrs != null && !multifileStop.isDeleted()) { for (int rr : rrs) { - //TODO here we should assign only complete routes: + // here we should assign only complete routes: TransportRoute combinedRoute = getCombinedRoute(localFileRoutes.get(rr), r.getFile().getName()); if (combinedRoute == null) { System.err.println(String.format("Something went wrong by loading route %d for stop %s", rr, stop)); @@ -930,45 +929,116 @@ public class TransportRoutePlanner { if (!route.isIncomplete()) { return route; } - TransportRoute c = combinedRoutesCache.get(route.getId()); - if (c == null) { c = combineRoute(route, fileName); combinedRoutesCache.put(route.getId(), c); } - return c; } + Comparator compareByDist = (TransportRoute tr1, TransportRoute tr2) + -> ((Integer)tr1.getDistance()).compareTo((Integer)tr2.getDistance()); + + private TransportRoute combineRoute(TransportRoute route, String fileName) throws IOException { - TransportRoute cr = new TransportRoute(route, true); - Collection res = findIncompleteRouteParts(route, fileName); - List stops = route.getForwardStops(); - List ways = route.getForwardWays(); - for (TransportRoute tr : res.valueCollection()) { - - //TODO check for duplicates and subsets - //TODO connect routes in right order (stops/ways) + List result = new ArrayList<>(findIncompleteRouteParts(route, fileName)); + List acceptedCandidates = new ArrayList(); + + TransportRoute baseRoute = route; + + if (result.size() > 1) { + //1. Sort by longest piece: + Collections.sort(result, compareByDist); + //2. Check if any route's part contains more stops, then "base" route, + //so we could find longest part (and remove subsets and copies): + Iterator itr = result.iterator(); + boolean containsAllStops = false; + while (itr.hasNext()) { + TransportRoute candidate = itr.next(); + if (candidate.compareRoute(baseRoute)) { + itr.remove(); + continue; + } else if (candidate.getForwardStops().size() > baseRoute.getForwardStops().size()) { + for (TransportStop s : baseRoute.getForwardStops()) { + for (TransportStop cs : candidate.getForwardStops()) { + if (!s.isMissingStop() && !cs.isMissingStop()) { + if (s.getId() == cs.getId()) { + containsAllStops = true; + break; + } + containsAllStops = false; + } + } + } + if (containsAllStops) { + baseRoute = candidate; + itr.remove(); + } + } else { + for (TransportStop cs : candidate.getForwardStops()) { + for (TransportStop s: baseRoute.getForwardStops()) { + if (!s.isMissingStop() && !cs.isMissingStop()) { + if(s.getId() == cs.getId()) { + containsAllStops = true; + break; + } + containsAllStops = false; + } + } + } + if (containsAllStops) { + itr.remove(); + } + } + } + } else { + acceptedCandidates = result; } -// TransportRoute missingPart; -// if (route.getForwardStops().get(0).isMissingStop()) { -// missingPart = loadMissingTransportRoute( -// route.getForwardStops().get(0).x31, route.getForwardStops().get(0).y31, route); -// if (missingPart != null) { -// cr.addRoutePart(missingPart, false); -// } -// } -// if (route.getForwardStops().get(route.getForwardStops().size()-1).isMissingStop()) { -// missingPart = loadMissingTransportRoute( -// route.getForwardStops().get(route.getForwardStops().size()-1).x31, -// route.getForwardStops().get(route.getForwardStops().size()-1).y31, route); -// if (missingPart != null) { -// cr.addRoutePart(missingPart, true); -// } -// } + //3. Connect routes in right order (stops/ways) + TransportRoute cr = new TransportRoute(baseRoute, true); + + TransportStop missingStart = baseRoute.getMissingStartStop(); + TransportStop missingEnd = baseRoute.getMissingEndStop(); + + List stops = baseRoute.getForwardStops(); + List ways = route.getForwardWays(); + Iterator itr = result.iterator(); + while(result.size() > 0) { + boolean success = false; + double distFromMissingEnd = -1; + double distFromMissingStart = -1; + TransportRoute part = itr.next(); + if (baseRoute.getMissingEndStop() != null && part.getMissingStartStop() != null) { + distFromMissingEnd = + MapUtils.getDistance(baseRoute.getMissingEndStop().getLocation(), part.getMissingStartStop().getLocation()); + } + if (baseRoute.getMissingStartStop() != null && part.getMissingEndStop() != null) { + distFromMissingStart = + MapUtils.getDistance(baseRoute.getMissingStartStop().getLocation(), part.getMissingEndStop().getLocation()); + } + if (distFromMissingEnd != -1) { + if ((distFromMissingStart == -1 || distFromMissingStart > distFromMissingEnd) && distFromMissingEnd < MISSING_STOP_SEARCH_RADIUS) { + //try to attach route part to end of baseRoute + if (!cr.addRoutePart(part, true)) { + //else assume that part of the route is missing and we need to attach it later + //TODO (how to check if missing part is exist at all? If there no some part of map + //we will fall in endless loop) + result.add(part); + }; + } + } else if (distFromMissingStart != -1) { + if ((distFromMissingEnd == -1 || distFromMissingStart < distFromMissingEnd) && distFromMissingStart < MISSING_STOP_SEARCH_RADIUS) { + if (!cr.addRoutePart(part, false)) { + //same thing here, need to exit loop somehow + result.add(part); + } + } + } + } + return cr; } @@ -976,9 +1046,10 @@ public class TransportRoutePlanner { IncompleteTransportRoute ptr; TIntObjectHashMap res = new TIntObjectHashMap(); TIntObjectHashMap localRes = new TIntObjectHashMap(); -// TODO check if valid comparison by filename + for (BinaryMapIndexReader bmir: routeMap.keySet()) { - if (!bmir.getFile().getName().equals(fileName)) { +// if (!bmir.getFile().getName().equals(fileName)) { + localRes.clear(); /** * What about situation when one route has several parts in map? * MB check all readers and then sort it out? @@ -986,56 +1057,50 @@ public class TransportRoutePlanner { * Should I check if those routes already loaded? But they shouldn't, * else we will already had a combined route and never get there! */ - localRes.clear(); ptr = bmir.getIncompleteRoutePointers(baseRoute.getId()); - if (ptr!= null && ptr.getRouteOffset() != -1) { + if (ptr != null && ptr.getRouteOffset() != -1) { localRes = bmir.getTransportRoutes(new int[] {ptr.getRouteOffset()}); - res.putAll(localRes); } - } +// } } return res.valueCollection(); } - - - - - private TransportRoute loadMissingTransportRoute(int sx, int sy, TransportRoute route) throws IOException { - long nanoTime = System.nanoTime(); - List res = new ArrayList(); - TIntObjectHashMap tr = new TIntObjectHashMap(); - int d = missingStopRadiusIn31; - int lx = (sx - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); - int rx = (sx + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); - int ty = (sy - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); - int by = (sy + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); - for(int x = lx; x <= rx; x++) { - for(int y = ty; y <= by; y++) { - long tileId = (((long)x) << (cfg.ZOOM_TO_LOAD_TILES + 1)) + y; -// List list = quadTree.get(tileId); -// if(list == null) { - tr = getRouteParts(x, y); -// quadTree.put(tileId, list); +// private TransportRoute loadMissingTransportRoute(int sx, int sy, TransportRoute route) throws IOException { +// long nanoTime = System.nanoTime(); +// List res = new ArrayList(); +// TIntObjectHashMap tr = new TIntObjectHashMap(); +// int d = missingStopRadiusIn31; +// int lx = (sx - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); +// int rx = (sx + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); +// int ty = (sy - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); +// int by = (sy + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); +// for(int x = lx; x <= rx; x++) { +// for(int y = ty; y <= by; y++) { +// long tileId = (((long)x) << (cfg.ZOOM_TO_LOAD_TILES + 1)) + y; +//// List list = quadTree.get(tileId); +//// if(list == null) { +// tr = getRouteParts(x, y); +//// quadTree.put(tileId, list); +//// } +// if (!tr.isEmpty()) { +// res.addAll(tr.valueCollection()); // } - if (!tr.isEmpty()) { - res.addAll(tr.valueCollection()); - } - - } - } - for (TransportRoute trr : res) { - if ((long)trr.getId() == (long)route.getId()) { - if (trr.getForwardStops() != route.getForwardStops()) { - return trr; - } - } - } - - return null; - } +// +// } +// } +// for (TransportRoute trr : res) { +// if ((long)trr.getId() == (long)route.getId()) { +// if (trr.getForwardStops() != route.getForwardStops()) { +// return trr; +// } +// } +// } +// +// return null; +// } private TIntObjectHashMap getRouteParts(int x, int y) throws IOException { int pz = (31 - cfg.ZOOM_TO_LOAD_TILES); From 78eb1d19ce847eb3fc4664c83b56c741440c1d44 Mon Sep 17 00:00:00 2001 From: Jan Schreiber Date: Thu, 14 May 2020 11:47:42 +0000 Subject: [PATCH 05/91] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 5.7% (192 of 3339 strings) --- OsmAnd/res/values-nb/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 774b3fb332..8d08bb986d 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -3548,4 +3548,7 @@ Skjul offentlig transport Vis offentlig transport Tilbake til redigering + Legg til/Rediger POI + Vis/Skjul offentlig transport + Legg til profil \ No newline at end of file From a805215faccda550876f78b18044c998125a9b93 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Wed, 13 May 2020 21:35:24 +0000 Subject: [PATCH 06/91] Translated using Weblate (French) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-fr/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 95a580d180..9bbf797ed1 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3697,4 +3697,9 @@ représentant la zone : %1$s x %2$s Ajouter / Modifier un favori Rétablir l\'ordre par défaut des éléments Retour en modification + Appuyer sur le bouton d’action basculera entre les profils sélectionnés. + Les profils sélectionnés pour cette action sont introuvables. + Reprendre + Ajouter un profil + Modifier le profil d\'application \ No newline at end of file From 010e4855a93f01c23e64359c5b916ed3b7024b6d Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 13 May 2020 20:08:41 +0000 Subject: [PATCH 07/91] Translated using Weblate (German) Currently translated at 99.8% (3333 of 3339 strings) --- OsmAnd/res/values-de/strings.xml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 746881dc9f..edd7db5b02 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -2554,7 +2554,7 @@ Lon %2$s Passierte ausblenden Auswahl der Entfernungs- und Richtungsangabe für Kartenmarkierungen in der Karte: Kartenausrichtungsgrenzwert - Auswählen, bei welcher Geschwindigkeit die Kartenausrichtung von \'Nach Bewegungsrichtung\' auf \'Nach Kompass\' umschaltet. + Auswählen, bei welcher Geschwindigkeit die Kartenausrichtung von \'Nach Bewegungsrichtung\' auf \'Nach Kompass\' umschaltet Kartenmarkierung in den Verlauf verschoben Notiz konnte nicht geändert werden. Notiz ändern @@ -3708,4 +3708,19 @@ Lon %2$s \n• Fehler mit RTL behoben \n \n + Fortfahren + Sie können auf diese Aktionen zugreifen, indem Sie auf die Schaltfläche \"%1$s\" tippen. + Öffentliche Verkehrsmittel ausblenden + Öffentliche Verkehrsmittel anzeigen + Öffentliche Verkehrsmittel anzeigen/ausblenden + Eine Schaltfläche zum Ein- oder Ausblenden der öffentlichen Verkehrsmittel auf der Karte. + POI erstellen/bearbeiten + Parkpositionen + Favorit hinzufügen / bearbeiten + Standard-Reihenfolge der Elemente wiederherstellen + Zurück zur Bearbeitung + Durch Antippen der Aktionsschaltfläche können Sie zwischen den ausgewählten Profilen wechseln. + Profil hinzufügen + Anwendungsprofil ändern + Für diese Aktion ausgewählte Profile nicht gefunden. \ No newline at end of file From d8e8fe02cc10bdd104d28ebbd83257428af66d10 Mon Sep 17 00:00:00 2001 From: solokot Date: Wed, 13 May 2020 17:31:32 +0000 Subject: [PATCH 08/91] Translated using Weblate (Russian) Currently translated at 99.9% (3338 of 3339 strings) --- OsmAnd/res/values-ru/strings.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 9ed8a72760..fd0328c4d2 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -1525,8 +1525,8 @@ Вперёд Панель управления Местные названия - Начать запись GPX - Остановить запись GPX + Продолжить запись GPX + Приостановить запись GPX Начать новый сегмент Включить фоновый режим GPS Интервал пробуждения GPS @@ -3715,4 +3715,8 @@ Место стоянки Переключатель, чтобы отобразить или скрыть общественный транспорт на карте. Восстановить исходный порядок + Нажатие кнопки «Действия» переключает между выбранными профилями. + Добавить профиль + Изменить профиль приложения + Профили, выбранные для данного действия, не найдены. \ No newline at end of file From 1e3d1ca52394c1cc584b87e78476d94fa7c901c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Wed, 13 May 2020 19:54:00 +0000 Subject: [PATCH 09/91] Translated using Weblate (Turkish) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-tr/strings.xml | 35 ++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index 6ef7aeb99a..e360d6d4af 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -1803,8 +1803,8 @@ Online izleme (GPX gerekli) Online izleme başlat Online izleme durdurun - GPX günlüğü başlat - Dur GPX günlüğü + GPX kaydını devam ettir + GPX kaydını duraklat Yeni bir segment başlat Araç olmayan otoyollar Ahşap ve scrubs @@ -2173,7 +2173,7 @@ Tüm harita işaretleyicileri Geçmiş\'e taşındı Harita işaretleyici Geçmiş\'e taşındı Tümünü Geçmiş\'e taşı - Navigasyonu duraklat/sürdür + Navigasyonu duraklat/devam ettir Navigasyonu duraklatma veya devam ettirme düğmesi. \'Navigasyon tamamlandı\' iletisi göster Navigasyonu başlat/durdur @@ -2295,7 +2295,7 @@ Geçilmiş-olanı gizle Haritada harita işaretleyicilerine olan uzaklık ve yönün nasıl belirtileceğini seçin: Harita oryantasyon eşiği - Harita oryantasyonunun \'Hareket yönü\'nden \'Pusula yönü\'ne değişim hızını aşağıdan seçiniz. + Harita yönünün \'Hareket yönü\'nden \'Pusula yönü\'ne geçiş hızını aşağıdan seçin. Rota noktaları olarak kaydet Öncesinde nokta ekle Sonrasında nokta ekle @@ -3522,7 +3522,7 @@ Görselleştirme dosyasını içe aktar Arazi Yamaçları, zirveleri ve ovaları göstermek için koyu tonları kullanan tepe gölgesi haritası. - Yamaç, arazide renklendirilmiş görselleştirmelerdir. + Yamaç, arazi dikliğini görselleştirmek için renkleri kullanır. Katmanın görüntüleneceği minimum ve maksimum zoom seviyelerini ayarlayın. Harita üzerinde tepe gölgesi görüntülemek için ek haritalara ihtiyaç vardır. Harita üzerinde yamaçları görüntülemek için ek haritalara ihtiyaç vardır. @@ -3530,7 +3530,7 @@ Şeffaflık Zoom seviyeleri Lejand - Tepe gölgesi veya yamaç haritasını görüntülemeyi etkinleştir. Bu harita türleri hakkında daha fazla bilgiyi sitemizde okuyabilirsiniz + Tepe gölgesi veya yamaç haritasını görüntülemeyi etkinleştir. Bu harita türleri hakkında sitemizde daha fazla bilgi edinebilirsiniz. Tepe gölgesi %1$s\'deki tüm veriler içe aktarıldı, yönetmek amacıyla uygulamanın gerekli bölümünü açmak için aşağıdaki düğmeleri kullanabilirsiniz. İçe aktarma tamamlandı @@ -3626,9 +3626,11 @@ Ekstra haritalar Desteklenmeyen eylem %1$s %1$s / %2$s - Google Play hesabınız bir abonelik satın aldıktan sonra ve süresi -\ndolduğunda (ay/üç ay/yıl) ücretlendirilir, -\nGoogle Play ayarlarınızdan daha önce iptal edilirse yenilenmeyecektir. + Ödeme, satın alma onaylandığında Google Play hesabınızdan alınacaktır. +\n +\n Yenileme tarihinden önce iptal edilmedikçe abonelik otomatik olarak yenilenir. Hesabınızdan yenileme süresi (ay/üç ay/yıl) için sadece yenileme tarihinde ücret alınacaktır. +\n +\n Google Play ayarlarınıza giderek aboneliklerinizi yönetebilir ve iptal edebilirsiniz. POI türleri ara Farklı kategorilerdeki POI türlerini birleştirin. Tümünü seçmek için \"Değiştir\" düğmesine, kategori seçimi için sol tarafa dokunun. Yarıçap cetveli @@ -3662,4 +3664,19 @@ \n • RTL hatalarını düzeltme \n \n + Devam ettir + Bu eylemlere “%1$s” düğmesine dokunarak erişebilirsiniz. + Toplu taşıma araçlarını gizle + Toplu taşıma araçlarını göster + Toplu taşıma araçlarını göster/gizle + Haritada toplu taşıma araçlarını göstermek veya gizlemek için bir düğme. + POI Oluştur/Düzenle + Park etme alanları + Sık Kullanılan Ekle / Düzenle + Öntanımlı öge sıralamasını geri yükle + Düzenlemeye geri dön + Eylem düğmesine dokunulduğunda seçilen profiller arasında geçiş yapılır. + Profil ekle + Uygulama profilini değiştir + Bu eylem için seçilen profiller bulunamadı. \ No newline at end of file From 7a0cefcb18e3d946acee8bbbed3ea704f9703dfe Mon Sep 17 00:00:00 2001 From: Athoss Date: Wed, 13 May 2020 20:33:30 +0000 Subject: [PATCH 10/91] Translated using Weblate (Hungarian) Currently translated at 96.2% (3213 of 3339 strings) --- OsmAnd/res/values-hu/strings.xml | 56 ++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index cd55d01745..0b000b66d5 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -1259,8 +1259,8 @@ Proporcionális memória %4$s MB (Android korlát %5$s MB, Dalvik %6$s MB).Online útvonalrögzítés (GPX szükséges) Online útvonalrögzítés indítása Online útvonalrögzítés megállítása - GPX naplózás indítása - GPX naplózás leállítása + GPX naplózás folytatása + GPX naplózás szüneteltetése Új szakasz kezdése Épületek Gyalogutak @@ -2389,7 +2389,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Hozzáadva Rendezés alapja: Válassza ki, hogyan jelenjék meg a térképen a térképjelölők távolsága és iránya: - Válaszd ki, mekkora sebesség alatt váltson a térkép forgatása „Haladási irány”-ról „Iránytű”-re. + Válassza ki, mekkora sebesség alatt váltson a térkép forgatása „Haladási irány”-ról „Iránytű”-re. Minden térképjelölő áthelyezve az előzményekbe Térképjelölő áthelyezve az előzményekhez Lista @@ -3211,7 +3211,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük \'%1$s\' már létezik. Felülírja\? Nem sikerült a profil exportálása. Profil importálása - Profil importálásához jelölje ki a megfelelő fájlt a készüléken, és nyissa meg az OsmAnddal. + Profil hozzáadásához nyissa meg a hozzátartozó fájlt az OsmAnddal. %1$s importálás hiba: %2$s %1$s importálva. UTV (kis terepautó) @@ -3223,7 +3223,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Fehér %1$s és %2$s felcserélése Kiindulópont - Célja az érkezési idő becslése ismeretlen típusú utak esetén, valamint a sebesség korlátozása valamennyi úttípus esetén (az útvonalat befolyásolhatja) + Az érkezési időt becsüli ismeretlen úttípus esetén, valamint korlátozza a sebességet valamennyi úttípusnál (az útvonalat befolyásolhatja) Visszaállít Nyomvonal elmentve Fájlnév üres @@ -3322,14 +3322,14 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Szegmensek összekapcsolása Irány belefoglalása Rögzítéskor menti az egyes útpontok irányát is. - Navigációs ikon - Térképikon + Pozíció ikon haladás közben + Pozíció ikon álló helyzetben Az Alkalmaz-ra koppintva a törölt profilok végérvényesen elvesznek. Főprofil Szín kijelölése - Az alapértelmezett OsmAnd-profilok nem törölhetők, viszont letilthatók az előző képernyőn vagy letolhatók a lista aljára. + Az alapértelmezett OsmAnd-profilok nem törölhetők, viszont letilthatók (az előző képernyőn) vagy letolhatók a lista aljára. Profilok szerkesztése - A navigációtípus befolyásolja az útvonal kiszámításának szabályait. + A navigációtípus határozza meg az útvonalszámítás módját. Profil megjelenése Ikon, szín és név Profilok listájának szerkesztése @@ -3416,14 +3416,14 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük \n Gomb, amely beállítja a képernyő közepét kiindulási pontnak, és kiszámítja a célpontig vezető utat vagy megnyit egy párbeszédablakot a célpont kijelöléséhez, ha a célpontjelölő nincs a térképen. Minden módosítás elvész, ha erre koppint: %1$s. - Minden profilbeállítás vissza fog állni a telepítést követő állapotba. - Minden profil visszaálljon az alapértelmezett helyzetbe\? + Összes profilbeállítás visszaállítása az alapértelmezett állapotba. + Összes profilbeállítást visszaállítja\? Családi autó %1$s: %2$s %1$s %2$s Értékelés - \'%1$s\': ez a fájl nem tartalmaz úttervezési szabályokat. Kérjük, válasszon másik fájlt. - Nem támogatott fájltípus. Olyan fájlt válasszon, amelynek %1$s a kiterjesztése. + \'%1$s\': ez a fájl nem tartalmaz úttervezési szabályokat. Kérem, válasszon másik fájlt. + Válasszon egy támogatott, %1$s kiterjesztésű fájlt. Importálás fájlból Úttervezési fájl importálása Profil importálása @@ -3431,7 +3431,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Képméret, hang- és videominőség Bejelentkezés, jelszó, offline szerkesztés Ikonalak, -szín és -méret kiválasztása - Lehetővé teszi, hogy az útvonal rögzítésével megossza aktuális pozícióját. + Lehetővé teszi az útvonal rögzítésével az aktuális pozíció megosztását. Online nyomvonalrögzítés Naplózás pontossága Az összes rögzített nyomvonal megtalálható a %1$s helyen vagy a fájlkezelővel az OsmAnd mappában. @@ -3442,15 +3442,15 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Bejelentés Felhasználónév és jelszó Ezek a beállítások minden profilra vonatkoznak. - OpenStreetMap-szerkesztés + OSM-szerkesztés Az összes még fel nem töltött szerkesztés vagy OSM-hiba megtalálható a %1$s helyen. A már feltöltött pontok nem láthatók az OsmAndban. OSM - Az ikon csak navigáció vagy mozgás közben lesz látható. - A térképikon csak a térképen jelenik meg, navigáció közben pedig navigációs ikonra vált. + Az ikon navigáció vagy haladás közben jelenik meg. + Az ikon álló helyzetben jelenik meg. Az alkalmazás részletes naplóinak ellenőrzése és megosztása A beállítás használatához engedélyre van szükség. Kategóriák átrendezése - Hozzáadhat egyedi kategóriát, elrejtheti a fölöslegesnek ítélt kategóriákat, és módosíthatja a lista sorrendjét. A lista a profilokkal importálható és exportálható. + Lista sorrendjének módosítása, fölösleges kategóriák elrejtése. A lista a profilokkal importálható és exportálható. Egy vagy több szükséges kategória kijelölésével hozzáadhat egy egyedi kategóriát. Rendelkezésre áll Egyedi kategória hozzáadása @@ -3500,7 +3500,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Összes lecserélése Domborzat A domborzatárnyékolás réteg sötét árnyalattal emeli ki a lejtőket, csúcsokat és az alföldeket. - A lejtő réteg a terep színezett vizualizációja. + A lejtő réteg színezéssel jeleníti meg a terep meredekségét. Állítsa be a legkisebb és legnagyobb nagyítási szintet, amelyen a réteg megjelenjen. További térképek szükségesek a domborzatárnyékolás térképen való megjelenítéséhez. További térképek szükségesek a lejtők térképen való megjelenítéséhez. @@ -3541,7 +3541,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Elválasztó Az ez alatti elemek elválasztásra kerülnek egy elválasztóval. Ezek az elemek a menüből elrejtésre kerültek, azonban az általuk képviselt beállítások vagy bővítmények továbbra is érvényben maradnak. - A fő műveletekhez csak 4 elem tartozhat. + A \'fő műveletek\'-hez csak 4 elem tartozhat. Rendszeralkalmazás használata Fényképező zárhang Hitelesítés sikeres @@ -3608,4 +3608,20 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük OsmAnd vásárlások Útmutató a térkép szimbolikájához Navigációs profilok + Váltógomb, amely a térképen megjeleníti vagy elrejti a tömegközlekedési réteget. + Ezekhez a műveletekhez a \"%1$s\" gombra koppintva férhet hozzá. + %1$s / %2$s + Nem támogatott művelet: %1$s + Tömegközlekedés elrejtése + Tömegközlekedés megjelenítése + Tömegközlekedés megjelenítése/elrejtése + POI készítés/módosítás + Parkolási pozíció + Kedvenc hozzáadása/módosítása + Alapértelmezett elemsorrend visszaállítása + Vissza a szerkesztéshez + A művelethez kiválasztott profilok nem találhatók. + A műveletgombra koppintva válthat a kiválasztott profilok között. + Profil hozzáadása + Alkalmazásprofil módosítása \ No newline at end of file From 2cb8526d28dc0ab19b68ba127bad4cf08eb06262 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Wed, 13 May 2020 17:23:56 +0000 Subject: [PATCH 11/91] Translated using Weblate (Hebrew) Currently translated at 99.9% (3337 of 3339 strings) --- OsmAnd/res/values-he/strings.xml | 43 ++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/OsmAnd/res/values-he/strings.xml b/OsmAnd/res/values-he/strings.xml index c5e3229982..3da8744dcd 100644 --- a/OsmAnd/res/values-he/strings.xml +++ b/OsmAnd/res/values-he/strings.xml @@ -1560,8 +1560,8 @@ מעקב מקוון (נדרש GPX) הפעלת מעקב מקוון עצירת מעקב מקוון - התחלת רישום GPX - עצירת רישום GPX + חידוש רישום GPX + השהיית רישום GPX התחלת מקטע חדש בניינים דרכים מהירות שלא מיועדות למכוניות @@ -2298,7 +2298,7 @@ \n \n הפעלה ב‚נגיעה אחת’ - נא לבחור באיזו מהירות כיוון המפה יתחלף ממצב ‚כיוון התנועה’ למצב ‚כיוון מצפן’ להלן. + ניתן לבחור באיזו מהירות כיוון המפה יתחלף ממצב ‚כיוון התנועה’ למצב ‚כיוון מצפן’ להלן. נקודות עומק ימיות בחצי הכדור הדרומי נקודות עומק ימיות בחצי הכדור הצפוני ב־OsmAnd נאסף מידע על אילו חלקים ביישומון משמשים אותך. המיקום שלך אף פעם לא נשלח, גם לא הקלט שלך ביישומון או פרטים על אזורים בהם צפית, חיפשת או הורדת. @@ -2888,7 +2888,7 @@ החלפה בין מצבי יום/לילה מ״ק ט׳ - נפח + קיבולת רוחב גובה סוג דרך @@ -3666,9 +3666,11 @@ וראי הפעולה %1$s אינה נתמכת %1$s / %2$s - חשבון ה־Google Play שלך יחויב בעת רכישת מנוי -\nועם תפוגתו (חודש/שלושה חודשים/שנה), -\nהוא לא יחדש את עצמו או יבוטל טרם החידוש מההגדרות שלך ב־Google Play. + התשלום יחויב דרך חשבון ה־Google Play שלך יחויב בעת אישור הרכישה. +\n +\nהמינוי מתחדש אוטומטית אלמלא בוטל בטרם תאריך החידוש. החשבון שלך יחויב על תקופת החידוש (חודש/שלושה חודשים/שנה) רק במועד החידוש. +\n +\nניתן לנהל ולבטל את המינויים שלך דרך ההגדרות שלך ב־Google Play. חיפוש סוגי נקודות עניין שילוב סוגי נקודות עניין מקטגוריות שונות. יש לגעת ב„החלפה” כדי לבחור את כולן, נגיעה בצד השמאלי לבחירת קטגוריה. עוקב OsmAnd @@ -3695,4 +3697,31 @@ הוספה / הסרה של מועדף שחזור סדר בררת המחדל של הפריטים חזרה לעריכה + לעלות בתחנה + Open Location Code + הערה: אם ה־GPS היה כבוי מיד לפני ההקלטה, יתכן שהדיוק של הנקודה הראשונה יהיה נמוך, לכן בקוד שלנו אנו מעדיפים להמתין כשנייה בטרם הקלטת נקודה (או להקליט את הטובה מבין שלוש נקודות רציפות, וכו׳) אך תכונה זו טרם הוטמעה. + חידוש + • מפות שיפועים בלתי מקוונות חדשות +\n +\n • התאמה מלאה של מועדפים ונקודת דרך GPX - צבעים, סמלים וצורות בהתאמה אישית +\n +\n • התאמת סדר הפריטים בתפריט ההקשר, הגדרת המפה, מגירה +\n +\n • ויקיפדיה כשכבה נפרדת בהגדרת המפה, אפשרות לבחור את השפה הנדרשת בלבד +\n +\n • יצירת מסנני/מפות נקודות עניין משלך בגמישות מלאה +\n +\n • נוספו אפשרויות לשחזר הגדרות לפרופילים מותאמים אישית +\n +\n • מסלולי GPX מלאים מניווט עם תמיכה בנתיבי תנועה והנחיות פנייה מלאות +\n +\n • תיקון גודלי מנשקי משתמש במחשבי לוח +\n +\n • תיקון תקלות ביישור מימין לשמאל +\n +\n + לחיצה על כפתור הפעולה תחליף בין הפרופילים הנבחרים. + הוספת פרופיל + החלפת פרופיל יישומון + הפרופיל שנבחרו לפעולה הזאת לא נמצאו. \ No newline at end of file From 77d46f4c00c25a5a1c72e3c30fc0d2088d6ad078 Mon Sep 17 00:00:00 2001 From: iman Date: Wed, 13 May 2020 17:54:44 +0000 Subject: [PATCH 12/91] Translated using Weblate (Persian) Currently translated at 99.7% (3329 of 3339 strings) --- OsmAnd/res/values-fa/strings.xml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml index d6df4a3692..ce04d02cac 100644 --- a/OsmAnd/res/values-fa/strings.xml +++ b/OsmAnd/res/values-fa/strings.xml @@ -340,7 +340,7 @@ در حال جست‌وجوی موقعیت… موقعیت من (پیدا‌شده) نشانی… - "نقاط موردعلاقه…" + علاقه‌مندی‌ها… نامشخص ‏%1$s حذف شود؟ حومه @@ -1305,8 +1305,8 @@ ردیابی آنلاین (GPX لازم است) شروع ردیابی آنلاین توقف ردیابی آنلاین - شروع ضبط GPX - توقف ضبط GPX + ازسرگیری ضبط GPX + نگه‌داشتن ضبط GPX ساختمان‌ها شروع بخش جدید راه‌های غیرموتوری @@ -3621,7 +3621,7 @@ شفافیت زوم نمایش کلید - فعال کنید تا نقشهٔ سایه‌روشن یا شیب را ببینید. در وبسایت ما دربارهٔ این نقشه‌ها بخوانید + فعال کنید تا نقشهٔ سایه‌روشن یا شیب را ببینید. در وبسایت ما دربارهٔ این نقشه‌ها بخوانید. سایه‌روشن %1$s از %2$s شیب‌ها @@ -3740,4 +3740,13 @@ بازگشت به ویرایش ایجاد / ویرایش POI افزودن / ویرایش نقطهٔ موردعلاقه + برای دسترسی به این کنش‌ها می‌توانید روی دکمهٔ «%1$s» بزنید. + مخفی‌کردن حمل‌ونقل عمومی + نمایش حمل‌ونقل عمومی + آشکار/پنهان کردن حمل‌ونقل عمومی + دکمه‌ای برای آشکار یا پنهان کردن حمل‌ونقل عمومی روی نقشه. + با لمس دکمهٔ عملیاتی بین پروفایل‌های انتخاب‌شده جابه‌جا شوید. + افزودن پروفایل + تغییر پروفایل برنامه + پروفایل‌های انتخاب‌شده برای این کنش، پیدا نشدند. \ No newline at end of file From 574b49d48d510166b02048a34857fad9b5e32dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Thu, 14 May 2020 13:11:18 +0000 Subject: [PATCH 13/91] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 5.7% (192 of 3339 strings) --- OsmAnd/res/values-nb/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 8d08bb986d..07be089563 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -3548,7 +3548,7 @@ Skjul offentlig transport Vis offentlig transport Tilbake til redigering - Legg til/Rediger POI - Vis/Skjul offentlig transport + Legg til/rediger POI + Vis/skjul offentlig transport Legg til profil \ No newline at end of file From 0bdfd5a33f9c221b5d85a20cd9e203e31815c245 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 13 May 2020 20:29:13 +0000 Subject: [PATCH 14/91] Translated using Weblate (German) Currently translated at 100.0% (3803 of 3803 strings) --- OsmAnd/res/values-de/phrases.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index eb800babda..6c83ed8942 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -3821,4 +3821,9 @@ Trinkwassernachfüllung: nein Trinkwasser-Nachfüllnetz Internetzugangsgebühr für Kunden + Ansaugung + Unter Druck + Grundwasser + Rohr + Druck \ No newline at end of file From 4cde677943dddb1d641fb32310d44ddc5d8c0549 Mon Sep 17 00:00:00 2001 From: Franco Date: Wed, 13 May 2020 23:01:00 +0000 Subject: [PATCH 15/91] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 684160c613..370b18c43e 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -472,8 +472,8 @@ Lon %2$s Seguimiento en línea (requiere GPX) Iniciar seguimiento en línea Parar seguimiento en línea - Iniciar grabación GPX - Parar grabación GPX + Reanudar grabación GPX + Pausar grabación GPX Vías no aptas para vehículos Bosques y matorrales No se encontraron descargas, comprueba tu conexión a Internet. @@ -3722,4 +3722,9 @@ Lon %2$s Añadir / Editar favorito Restaurar el orden de los elementos predefinidos Volver a la edición + Reanudar + Al pulsar el botón de acción se cambiará entre los perfiles elegidos. + Añadir perfil + Cambiar perfil de la aplicación + No se encontraron los perfiles marcados para esta acción. \ No newline at end of file From 680d388454a0854de6e0828fb86f800ad1b9d66b Mon Sep 17 00:00:00 2001 From: Verdulo Date: Wed, 13 May 2020 17:26:32 +0000 Subject: [PATCH 16/91] Translated using Weblate (Esperanto) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-eo/strings.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index 403683dea7..d4da577080 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -633,9 +633,9 @@ Lon: %2$s Enreta spur-registrado (GPX bezonata) Sendi datumojn de spuroj al difinita retservo, se GPX-registrado estas aktiva. Ekigi enretan kurs-registradon - Ekigi GPX-registradon + Pluigi GPX-registradon Ĉesigi enretan kurs-registradon - Ĉesigi GPX-registradon + Paŭzigi GPX-registradon Ekigi novan segmenton Konstruaĵoj Vojoj ne por aŭtoj @@ -3704,4 +3704,9 @@ Indikas lokon: %1$s x %2$s" Pozicioj de parkumado Restarigi implicitan ordigon de elementoj Reen al redaktado + Pluigi + Butono por baskuli inter elektitaj profiloj. + Aldoni profilon + Ŝanĝi aplikaĵan profilon + Ne trovis profilojn elektitajn por tiu ĉi ago. \ No newline at end of file From 94a9166ee80efadbbf8b21abcbf3988ff3f4c2ff Mon Sep 17 00:00:00 2001 From: ssantos Date: Wed, 13 May 2020 20:26:52 +0000 Subject: [PATCH 17/91] Translated using Weblate (Portuguese) Currently translated at 100.0% (3803 of 3803 strings) --- OsmAnd/res/values-pt/phrases.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-pt/phrases.xml b/OsmAnd/res/values-pt/phrases.xml index 203eb822d2..67fea167ad 100644 --- a/OsmAnd/res/values-pt/phrases.xml +++ b/OsmAnd/res/values-pt/phrases.xml @@ -3803,4 +3803,9 @@ Bicicleta fantasma Vídeo SMS + Sucção + Pressurizado + Águas subterrâneas + Tubo + Pressão \ No newline at end of file From 790b3a341dfba9d8c4c329716c77e19f96d68ecd Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Thu, 14 May 2020 03:18:41 +0000 Subject: [PATCH 18/91] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 4d764f38ac..9f08e04bc0 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -1225,8 +1225,8 @@ 線上即時追蹤 (需要 GPX) 開始線上即時追蹤 停止線上即時追蹤 - 開始 GPX 記錄 - 停止 GPX 記錄 + 恢復 GPX 記錄 + 暫停 GPX 記錄 開始新區段 波斯 在地圖上對標簽偏好的語言(如果無法使用,將使用英文或當地名稱)。 @@ -3710,4 +3710,9 @@ 新增/編輯收藏 恢復預設項目排序 返回編輯 + 恢復 + 點擊動作按鈕將會在選取的設定檔間切換。 + 新增設定檔 + 變更應用程式設定檔 + 找不到為此動作選取的設定檔。 \ No newline at end of file From b45a672da2fe52771b58534e11c90c5d8a24048e Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Fri, 15 May 2020 08:50:44 +0300 Subject: [PATCH 19/91] Fix wrong tag --- OsmAnd/src/net/osmand/plus/quickaction/QuickActionsWidget.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/quickaction/QuickActionsWidget.java b/OsmAnd/src/net/osmand/plus/quickaction/QuickActionsWidget.java index 84392cebf0..48a0a12ba3 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/QuickActionsWidget.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/QuickActionsWidget.java @@ -257,7 +257,7 @@ public class QuickActionsWidget extends LinearLayout { .addToBackStack(QuickActionListFragment.TAG).commitAllowingStateLoss(); } else { CreateEditActionDialog dialog = CreateEditActionDialog.newInstance(action.id); - dialog.show(fm, AddQuickActionDialog.TAG); + dialog.show(fm, CreateEditActionDialog.TAG); } return true; } From 33eed06a86c4608b673ddb2eac1359cc3d0cf02c Mon Sep 17 00:00:00 2001 From: xmd5a Date: Fri, 15 May 2020 09:51:25 +0300 Subject: [PATCH 20/91] Fix string --- OsmAnd/res/values/phrases.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 1b2bf04c81..10b539b5c1 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -1856,7 +1856,7 @@ Full service Yes Brushless: no - Car wash: no + No Public bath From 1822a78636b3de14b6d2070276ccc7d5260c4d8f Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Thu, 14 May 2020 17:33:28 +0000 Subject: [PATCH 21/91] Translated using Weblate (French) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-fr/strings.xml | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 186751d5aa..26c6e810c8 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -2601,7 +2601,7 @@ représentant la zone : %1$s x %2$s Appui court sur une marque Faites des notes ! Associez des notes sonore, vidéo ou photo à n\'importe quel point de la carte depuis le gadget ou le menu contextuel. - Notes OSM par date + Notes Audio / Vidéo par date Par date Par type Modifier votre recherche. @@ -3669,22 +3669,22 @@ représentant la zone : %1$s x %2$s Abonnement - OsmAnd Live Achats OsmAnd Profils de navigation - - Nouvelles cartes des pistes hors ligne -\n -\n - Personnalisation complète des favoris et des points de passage GPX - couleurs, icônes et formes personnalisées -\n -\n - Personnaliser l\'ordre des éléments dans le menu contextuel, la configuration de la carte, le tiroir -\n -\n - Wikipédia comme couche séparée dans Paramétrer la carte, sélectionnez uniquement les langues nécessaires -\n -\n - Créez vos propres filtres de PI avec une flexibilité totale -\n -\n - Ajout d\'options permettant de restaurer les paramètres des profils personnalisés -\n -\n - Les routes GPX utilisées en navigation prennent en charge les voies de circulation et les instructions de virage complètes -\n -\n - Correction des tailles sur les tablettes -\n + - Nouvelles cartes des pistes hors ligne +\n +\n - Personnalisation complète des favoris et des points de passage GPX - couleurs, icônes et formes personnalisées +\n +\n - Personnalisez l\'ordre des éléments dans le menu contextuel, configurez la carte et le panneau déroulant +\n +\n - Wikipédia comme couche séparée dans Paramétrer la carte, sélectionnez uniquement les langues nécessaires +\n +\n - Créez vos propres filtres de PI avec une flexibilité totale +\n +\n - Ajout d\'options permettant de restaurer les paramètres des profils personnalisés +\n +\n - Les routes GPX utilisées en navigation prennent en charge les voies de circulation et les instructions de virage complètes +\n +\n - Correction des tailles sur les tablettes +\n \n - Correction de bugs avec RTL \n \n From 188cb09ec12b660b984aa7faf3c2b1e5e6978401 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 14 May 2020 17:09:47 +0000 Subject: [PATCH 22/91] Translated using Weblate (German) Currently translated at 99.8% (3333 of 3339 strings) --- OsmAnd/res/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 691fdd9e8f..68ad33b494 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -2614,7 +2614,7 @@ Lon %2$s Nach Typ kann als Favoriten oder GPX-Datei importiert werden. Audio-, Video- oder Fotonotizen zu jedem Punkt auf der Karte über Bedienelement oder Kontextmenü hinzufügen. - OSM-Notizen nach Datum + Audio-/Video-Notizen nach Datum Ein Tippen auf die Karte schaltet die Steuertasten und Bedienelemente um. • Neu: Unterstützung weltweiter Offline-Reiseführer. Verknüpfung beschriebener Sehenswürdigkeiten zur Landkarte. Die Inhalte basieren derzeit auf Wikivoyage. \n From fc968286d7173a74475493cefa2cbfdedde83b32 Mon Sep 17 00:00:00 2001 From: solokot Date: Thu, 14 May 2020 13:31:11 +0000 Subject: [PATCH 23/91] Translated using Weblate (Russian) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-ru/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index fd0328c4d2..d241185a34 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -2642,7 +2642,7 @@ Активация одним нажатием Делайте заметки! Добавьте аудио-, видео- или фотозаметку в любую точку на карте, используя виджет или контекстное меню. - Заметки OSM по дате + Заметки по дате По дате По типу Измените ваш запрос. @@ -3719,4 +3719,5 @@ Добавить профиль Изменить профиль приложения Профили, выбранные для данного действия, не найдены. + Продолжить \ No newline at end of file From 069bb9d5c2e6bc3661d9373a485188cb627cd2b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Thu, 14 May 2020 14:43:02 +0000 Subject: [PATCH 24/91] Translated using Weblate (Turkish) Currently translated at 99.9% (3338 of 3339 strings) --- OsmAnd/res/values-tr/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index e360d6d4af..14b125b1cc 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -1112,7 +1112,7 @@ Haritaya dön Not paylaş İzle - A/V notları + Sesli/Görüntülü notlar Çevrim içi harita Sadece yollar Aygıt belleği @@ -2110,7 +2110,7 @@ \'Tek basış\' aktif Not alın! Widget veya içerik menüsünü kullanarak, harita üzerinde her nokta için ses, video veya fotoğraf notları al. - Tarihe göre OSM notları + Tarihe göre sesli/görüntülü notlar Tarihe göre Türe göre Daha fazla From 0d61d606f6b40fbd67a9325b4d6443e96d252a4a Mon Sep 17 00:00:00 2001 From: Athoss Date: Thu, 14 May 2020 16:39:12 +0000 Subject: [PATCH 25/91] Translated using Weblate (Hungarian) Currently translated at 96.2% (3213 of 3339 strings) --- OsmAnd/res/values-hu/strings.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 0b000b66d5..9a0687f98e 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -132,7 +132,7 @@ Rátétréteg / alátétréteg Térképforrás beállítások Vektoros térkép beállítások - Biztosan törlöd: %1$s? + Biztosan törli: %1$s\? településrész falucska község @@ -638,7 +638,7 @@ hozzáadás módosítás {0} művelet befejeződött. - {0} műveletet nem sikerült végrehajtani. + {0} művelet végrehajtása sikertelen. {0} művelet közben input/output hiba történt. Nincs letöltve információ a pontról Nyitva @@ -939,7 +939,7 @@ Proporcionális memória %4$s MB (Android korlát %5$s MB, Dalvik %6$s MB).Dropbox bővítmény Hang- és videofelvétel Biztosan megszakítja a navigációt\? - Biztosan törlöd a célpontot (és a köztes célpontokat)? + Biztosan törölni szeretné a célpontot (és a köztes célpontokat)\? Pontos, hibamentes útvonaltervek készítése. Jelenleg korlátozott távolságra és lassan tervez. Pontos útvonaltervezés (kísérleti) Mutat @@ -2099,7 +2099,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Vízfelületek Vízfelületek elrejtése Gyorsművelet - %d művelet + %d. művelet %d képernyő Térképjelölő hozzáadása Érdekes pont (POI) hozzáadása @@ -2119,7 +2119,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Kedvenc hozzáadása Művelet hozzáadása Művelet törlése - Biztosan törlöd a(z) „%s” műveletet? + Biztosan törölni szeretné ezt a műveletet: „%s”\? Kedvencek párbeszédablak megjelenítése Előre megadott név Gomb, amely létrehoz a képernyő közepén egy térképjelölőt. @@ -3624,4 +3624,6 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük A műveletgombra koppintva válthat a kiválasztott profilok között. Profil hozzáadása Alkalmazásprofil módosítása + Kombináljon POI típusokat különböző kategóriákból. Koppintson egy kapcsolóra az összes altípus kiválasztásához, vagy koppintson egy szövegre az egyes altípusok kijelöléséhez. + POI típusok keresése \ No newline at end of file From c9026bec8b8f69c9e2c44dc5a90d3499f807c6c2 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Thu, 14 May 2020 22:58:10 +0000 Subject: [PATCH 26/91] Translated using Weblate (Slovak) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-sk/strings.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 1e2ba902a7..601dc971d2 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -2599,7 +2599,7 @@ Zodpovedá oblasti: %1$s x %2$s Potlačte značku na mape na jej presunutie na prvé miesto v aktívnych značkách bez otvárania kontextového menu. Urobte poznámky! Pridajte zvukové, video alebo fotografické poznámky ku každému bodu na mape, pomocou nástroja alebo kontextového menu. - OSM poznámky podľa dátumu + Mediálne poznámky podľa dátumu Podľa dátumu Podľa typu \"Jedno stlačenie\" aktívne @@ -3612,8 +3612,8 @@ Zodpovedá oblasti: %1$s x %2$s Niektoré články Wikipedia nemusia byť dostupné vo vašom jazyku. Zvoľte jazyky, v ktorých sa články Wikipedia budú zobrazovať na mape. \nPri čítaní článku budete môcť prepínať medzi všetkými dostupnými jazykmi. Pre zobrazenie bodov Wikipedie na mape sú potrebné ďalšie mapy. - Upraviť počet položiek v úvodnom paneli, nastaviť mapu a kontextové menu. -\n + Upraviť počet položiek v Úvodnom paneli, Nastaviť mapu a Kontextovom menu. +\n \nMôžete vypnúť nepoužívané moduly, aby sa skryli ich ovládacie prvky z aplikácie %1$s. Položky v úvodnom paneli a kontextovom menu Prispôsobenie používateľského rozhrania @@ -3711,4 +3711,8 @@ Zodpovedá oblasti: %1$s x %2$s Obnoviť predvolené poradie položiek Naspäť k úpravám K týmto akciám sa dostanete stlačením tlačidla “%1$s”. + Stlačením tlačidla akcie sa prepne medzi zvolenými profilmi. + Pridať profil + Zmeniť aplikačný profil + Nenašli sa profily vybrané pre túto akciu. \ No newline at end of file From e052ea010ca6cb1e2131d9e2f1fe4341768b6177 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Thu, 14 May 2020 14:16:26 +0000 Subject: [PATCH 27/91] Translated using Weblate (Hebrew) Currently translated at 99.9% (3337 of 3339 strings) --- OsmAnd/res/values-he/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-he/strings.xml b/OsmAnd/res/values-he/strings.xml index 3da8744dcd..008c34b797 100644 --- a/OsmAnd/res/values-he/strings.xml +++ b/OsmAnd/res/values-he/strings.xml @@ -2005,7 +2005,7 @@ הסמן %s הופעל. אפשר ליצור הערות! ניתן להוסיף הערה מסוג שמע, וידאו או תמונה לכל נקודה במפה באמצעות וידג׳ט או תפריט הקשר. - הערות OSM לפי תאריך + הערות שמע/וידאו לפי תאריך לפי תאריך לפי סוג ניתן להירשם לרשימת הדיוור שלנו כדי לקבל הנחות על היישומון ולקבל עוד 3 הורדות של מפות בחינם! From f56c97014235187e2c9da63fba63eef3f409052f Mon Sep 17 00:00:00 2001 From: WaldiS Date: Thu, 14 May 2020 19:22:49 +0000 Subject: [PATCH 28/91] Translated using Weblate (Polish) Currently translated at 99.7% (3330 of 3339 strings) --- OsmAnd/res/values-pl/strings.xml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index 87ac1c38ca..b873dd1a6b 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -2524,7 +2524,7 @@ Reprezentuje obszar: %1$s x %2$s Czytaj artykuł Notuj! Dodaj notatkę audio, video lub zdjęciową do każdego punktu na mapie, za pomocą widgetu lub menu kontekstowego. - Notatki według dat + Notatki A/V według daty Importuj grupy Wybierz kategorię Ulubione, aby dodać znaczniki. Liczba cyfr dziesiętnych @@ -3596,7 +3596,7 @@ Reprezentuje obszar: %1$s x %2$s Więcej informacji o nachyleniu można przeczytać na %1$s. Do wyświetlania nachylenia terenu wymagane są dodatkowe mapy. Ustaw minimalny i maksymalny poziom powiększenia, na których będzie wyświetlana warstwa. - Nachylenie to pokolorowane wizualizacje terenu. + Nachylenie używa kolorów do wizualizacji stromości terenu. Cieniowanie wzniesień wykorzystuje ciemne odcienie do pokazania stoków, szczytów i nizin. Teren %1$s z %2$s @@ -3713,4 +3713,12 @@ Reprezentuje obszar: %1$s x %2$s \n \n Powrót do edycji + Ukryj transport publiczny + Pokaż transport publiczny + Pokaż/ukryj transport publiczny + Utwórz / Edytuj POI + Dodaj / Edytuj Ulubione + Naciśnięcie przycisku akcji powoduje przełączanie między wybranymi profilami. + Dodaj profil + Zmiana profilu aplikacji \ No newline at end of file From 15951d7bbf7134243d6fa2806e6c8c77be701694 Mon Sep 17 00:00:00 2001 From: Ahmad Alfrhood Date: Thu, 14 May 2020 19:16:52 +0000 Subject: [PATCH 29/91] Translated using Weblate (Arabic) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-ar/strings.xml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index fb83f92d25..72f5e2b989 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3556,7 +3556,7 @@ إظهار/إخفاء التضاريس المنحدرات التضاريس - تمكين لعرض المنحدرات أو خريطة التضاريس. يمكنك قراءة المزيد عن أنواع الخرائط هذه على موقعنا + تمكين لعرض المنحدرات أو خريطة التضاريس. يمكنك قراءة المزيد عن أنواع الخرائط هذه على موقعنا. عنوان تفسيري مستويات التكبير الشفافية @@ -3672,4 +3672,19 @@ \n • إصلاح الخلل مع RTL \n \n + إستئناف + يمكنك الوصول إلى هذه الإجراءات عن طريق النقر على زر \"%1$s\". + إخفاء وسائل النقل العام + إظهار وسائل النقل العام + إظهار/إخفاء وسائل النقل العام + زر لإظهار أو إخفاء وسائل النقل العام على الخريطة. + إنشاء /تحرير POI + مكان الموقف + إضافة / تحرير المفضلة + استعادة ترتيب العناصر الافتراضية + عودة إلى التحرير + سيتم تبديل زر الإجراء التسجيل بين التشكيلات الجانبية المحددة. + إضافة ملف تعريف + تغيير ملف تعريف التطبيق + لم يتم العثور على ملفات التعريف المحددة لهذا الإجراء. \ No newline at end of file From 4f837989e7c831baab28382662aee1ffc77efdf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Thu, 14 May 2020 13:12:08 +0000 Subject: [PATCH 30/91] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 5.8% (195 of 3339 strings) --- OsmAnd/res/values-nb/strings.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 07be089563..8321d65624 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -2440,7 +2440,7 @@ Interessepunkt blir slettet når du laster opp endringene dine Kun nedlasting over Wi-Fi Feilrettingsinfo for bildefrekvens - Interessepunktpåskrifter + Interessepunktetiketter Åpner i morgen Vinter og ski Turvisning @@ -3548,7 +3548,8 @@ Skjul offentlig transport Vis offentlig transport Tilbake til redigering - Legg til/rediger POI + Legg til/rediger interessepunkt Vis/skjul offentlig transport Legg til profil + \ No newline at end of file From 2f8d391e986f91cc20b4ee1b8db44349399271da Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Thu, 14 May 2020 19:04:41 +0000 Subject: [PATCH 31/91] Translated using Weblate (Sardinian) Currently translated at 99.3% (3778 of 3803 strings) --- OsmAnd/res/values-sc/phrases.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-sc/phrases.xml b/OsmAnd/res/values-sc/phrases.xml index 1444488be5..7fbecf399e 100644 --- a/OsmAnd/res/values-sc/phrases.xml +++ b/OsmAnd/res/values-sc/phrases.xml @@ -3816,4 +3816,9 @@ Ricàrica de s\'abba potàbile: eja Ricàrica de s\'abba potàbile: nono Retza de ricàrica de s\'abba potàbile + Sutzione + Presurizada + Abbas suta de terra + Pompa + Pressione \ No newline at end of file From 466376e7d7daa17bfe21879c9afe67ea6a00fe07 Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Thu, 14 May 2020 19:16:40 +0000 Subject: [PATCH 32/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-pt-rBR/strings.xml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 73b9ee0a82..503d1e5398 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -379,8 +379,8 @@ Rastreamento on-line (requer GPX) Iniciar rastreamento on-line Parar rastreamento on-line - Iniciar registro de GPX - Parar registro de GPX + Retomar o registro GPX + Pausar o registro GPX Iniciar novo rastreamento Edifícios Estradas não trafegáveis @@ -2139,7 +2139,7 @@ Pôr do Sol: %2$s Toque num marcador do mapa para movê-lo para o topo dos marcadores ativos sem abrir o menu de contexto. Ativo com \'um toque\' Faça anotações! - Notas do OSM por data + Notas A/V por data Por data Por tipo Procurando trilhas com pontos de passagem @@ -3706,4 +3706,9 @@ Pôr do Sol: %2$s Adicionar / Editar favorito Restaurar ordem de itens padrão Voltar à edição + Retomar + Tocar no botão de ação alterna entre os perfis selecionados. + Adicionar perfil + Alterar perfil do aplicativo + Perfis selecionados para esta ação não encontrados. \ No newline at end of file From fffe761ef5ff4eb49a3b55b59900bc63e153adf7 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Fri, 15 May 2020 01:57:41 +0000 Subject: [PATCH 33/91] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 9f08e04bc0..b99294215a 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -2600,7 +2600,7 @@ 「點一下」啟動 加註記! 使用小工具或內容選單,增加音訊、視訊或照片附註在地圖上的每個標點。 - 以日期排序的 OSM 註記 + 以日期排序的音訊/視訊註記 按照日期 按照類型 輕點在地圖上的標記,將其移動到活動標記的頂端,而不用打開內容選單。 From 050bd4132e2d894f40865a5e53958bbb5061c279 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Fri, 15 May 2020 10:37:30 +0300 Subject: [PATCH 34/91] Fix string duplicate --- OsmAnd/res/values-fr/strings.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 26c6e810c8..d857b332ea 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -2068,7 +2068,6 @@ Enregistrer Aucune donnée Notifications - Continuer Activer le démarrage rapide d\'enregistrement d\'itinéraire Afficher une notification système permettant d’enregistrer l\'itinéraire. Vous n\'avez pas encore de fichier GPX From ee32544272431c3da16aad25e51cc46cc481d3dc Mon Sep 17 00:00:00 2001 From: max-klaus Date: Fri, 15 May 2020 10:39:52 +0300 Subject: [PATCH 35/91] Fix string duplicate --- OsmAnd/res/values-de/strings.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 68ad33b494..f7fa57bcae 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -2085,7 +2085,6 @@ Lon %2$s Schnellaufzeichnung einschalten Anzeige einer Systembenachrichtigung zum Starten der Streckenaufzeichnung. Benachrichtigungen - Fortsetzen Aussehen Routenberechnung Sie haben noch keine GPX-Dateien From 17cb2a3d976ab975bf4b3cc46596af3e6e0a7c82 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 15 May 2020 10:50:29 +0300 Subject: [PATCH 36/91] Fix enum preferences --- OsmAnd/src/net/osmand/plus/OsmandSettings.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index b70668e34d..0ce0c2def5 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -479,6 +479,13 @@ public class OsmandSettings { return false; } else if (value instanceof Enum) { return enumPref.setModeValue(mode, value); + } else if (value instanceof Integer) { + int newVal = (Integer) value; + if (enumPref.values.length > newVal) { + Enum enumValue = enumPref.values[newVal]; + return enumPref.setModeValue(mode, enumValue); + } + return false; } } else if (preference instanceof ContextMenuItemsPreference) { if (value instanceof ContextMenuItemsSettings) { From 3136eba7499019a9e0d8b62c33cce1aa4ff212a1 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Fri, 15 May 2020 10:58:37 +0300 Subject: [PATCH 37/91] Change ImageView to AppCompatImageView --- .../add_gpx_point_bottom_sheet.xml | 2 +- .../dest_reached_menu_fragment.xml | 2 +- .../res/layout-land/empty_state_av_notes.xml | 2 +- .../layout-land/empty_state_favourites.xml | 2 +- .../empty_state_markers_active.xml | 2 +- .../empty_state_markers_groups.xml | 2 +- .../empty_state_markers_history.xml | 2 +- .../res/layout-land/empty_state_my_tracks.xml | 2 +- .../res/layout-land/empty_state_osm_edits.xml | 2 +- .../fragment_coordinate_input_dialog.xml | 4 ++-- .../fragment_direction_indication_dialog.xml | 6 +++--- .../layout-land/fragment_measurement_tool.xml | 4 ++-- OsmAnd/res/layout-land/map_hud_bottom.xml | 4 ++-- OsmAnd/res/layout-land/map_hud_top.xml | 16 +++++++-------- .../layout-land/move_marker_bottom_sheet.xml | 2 +- .../res/layout-land/point_editor_fragment.xml | 6 +++--- .../layout-land/recording_note_fragment.xml | 6 +++--- OsmAnd/res/layout-land/track_details.xml | 8 ++++---- .../first_usage_welcome_fragment.xml | 4 ++-- .../res/layout/add_gpx_point_bottom_sheet.xml | 2 +- .../layout/along_the_route_category_item.xml | 2 +- .../res/layout/along_the_route_point_item.xml | 2 +- .../res/layout/ask_map_download_fragment.xml | 2 +- .../res/layout/bottom_sheet_double_item.xml | 4 ++-- ...heet_item_in_frame_with_descr_and_icon.xml | 2 +- .../res/layout/bottom_sheet_item_simple.xml | 2 +- .../layout/bottom_sheet_item_simple_56dp.xml | 2 +- .../bottom_sheet_item_simple_right_icon.xml | 2 +- .../bottom_sheet_item_with_descr_56dp.xml | 2 +- ...heet_item_with_descr_and_checkbox_56dp.xml | 2 +- ...om_sheet_item_with_descr_and_radio_btn.xml | 2 +- ..._sheet_item_with_descr_and_switch_56dp.xml | 2 +- .../bottom_sheet_item_with_radio_btn.xml | 2 +- .../bottom_sheet_item_with_right_descr.xml | 2 +- .../layout/bottom_sheet_item_with_switch.xml | 2 +- .../bottom_sheet_item_with_switch_56dp.xml | 2 +- .../layout/button_with_icon_and_subtext.xml | 2 +- OsmAnd/res/layout/card_bottom_divider.xml | 2 +- OsmAnd/res/layout/card_top_divider.xml | 2 +- OsmAnd/res/layout/change_fav_color.xml | 2 +- .../res/layout/context_menu_action_item.xml | 2 +- OsmAnd/res/layout/context_menu_card_image.xml | 4 ++-- OsmAnd/res/layout/context_menu_top_shadow.xml | 2 +- .../res/layout/coordinate_input_data_area.xml | 14 ++++++------- .../layout/coordinate_input_keyboard_item.xml | 2 +- OsmAnd/res/layout/current_gpx_item.xml | 6 +++--- OsmAnd/res/layout/dash_error_fragment.xml | 2 +- OsmAnd/res/layout/dash_gpx_track_item.xml | 8 ++++---- .../dash_item_with_description_72dp.xml | 2 +- OsmAnd/res/layout/dash_navigation.xml | 2 +- OsmAnd/res/layout/dash_parking_fragment.xml | 2 +- OsmAnd/res/layout/dash_simulate_item.xml | 2 +- .../res/layout/dash_storage_type_fragment.xml | 2 +- OsmAnd/res/layout/dashboard_toolbar.xml | 14 ++++++------- .../res/layout/dest_reached_menu_fragment.xml | 2 +- .../layout/download_detailed_map_widget.xml | 2 +- OsmAnd/res/layout/download_tiles.xml | 2 +- OsmAnd/res/layout/drawer_list_radius.xml | 2 +- .../layout/edit_arrangement_list_fragment.xml | 2 +- OsmAnd/res/layout/empty_state_av_notes.xml | 2 +- OsmAnd/res/layout/empty_state_favourites.xml | 2 +- .../res/layout/empty_state_markers_active.xml | 2 +- .../res/layout/empty_state_markers_groups.xml | 2 +- .../layout/empty_state_markers_history.xml | 2 +- OsmAnd/res/layout/empty_state_my_tracks.xml | 2 +- OsmAnd/res/layout/empty_state_osm_edits.xml | 2 +- .../layout/expandable_list_item_category.xml | 6 +++--- OsmAnd/res/layout/favorites_list_item.xml | 6 +++--- OsmAnd/res/layout/favourite_list_item.xml | 4 ++-- .../layout/first_usage_welcome_fragment.xml | 4 ++-- .../fragment_data_storage_place_dialog.xml | 8 ++++---- .../fragment_direction_indication_dialog.xml | 8 ++++---- .../res/layout/fragment_edit_poi_normal.xml | 12 +++++------ .../res/layout/fragment_import_complete.xml | 2 +- .../res/layout/fragment_mapillary_filters.xml | 4 ++-- ...ent_marker_options_bottom_sheet_dialog.xml | 12 +++++------ .../res/layout/fragment_measurement_tool.xml | 6 +++--- .../fragment_plan_route_half_screen.xml | 2 +- OsmAnd/res/layout/fragment_reports.xml | 18 ++++++++--------- .../fragment_save_as_new_track_images_row.xml | 4 ++-- .../res/layout/fragment_show_all_routes.xml | 2 +- OsmAnd/res/layout/fragment_subcategories.xml | 4 ++-- OsmAnd/res/layout/fragment_terrain.xml | 6 +++--- .../fragment_wikivoyage_article_dialog.xml | 2 +- ...ment_wikivoyage_show_images_first_time.xml | 2 +- OsmAnd/res/layout/go_to_map_fragment.xml | 2 +- OsmAnd/res/layout/gpx_item_altitude.xml | 8 ++++---- OsmAnd/res/layout/gpx_item_general.xml | 8 ++++---- OsmAnd/res/layout/gpx_item_list_header.xml | 8 ++++---- OsmAnd/res/layout/gpx_item_speed.xml | 8 ++++---- OsmAnd/res/layout/gpx_route_card.xml | 4 ++-- .../res/layout/gpx_split_segment_fragment.xml | 20 +++++++++---------- OsmAnd/res/layout/gpx_tab.xml | 2 +- OsmAnd/res/layout/gpx_track_item.xml | 8 ++++---- OsmAnd/res/layout/gpx_track_select_item.xml | 8 ++++---- OsmAnd/res/layout/grid_menu_item.xml | 2 +- OsmAnd/res/layout/history_card_item.xml | 2 +- OsmAnd/res/layout/home_work_card.xml | 2 +- .../res/layout/layers_list_activity_item.xml | 2 +- .../layout/list_item_icon_and_download.xml | 4 ++-- .../res/layout/list_item_icon_and_title.xml | 2 +- OsmAnd/res/layout/list_item_import.xml | 2 +- OsmAnd/res/layout/list_item_move_header.xml | 4 ++-- OsmAnd/res/layout/list_shadow_footer.xml | 2 +- OsmAnd/res/layout/list_shadow_header.xml | 2 +- OsmAnd/res/layout/live_updates_header.xml | 4 ++-- OsmAnd/res/layout/local_index_list_item.xml | 2 +- .../local_index_live_updates_list_item.xml | 2 +- ...main_menu_drawer_btn_configure_profile.xml | 2 +- .../main_menu_drawer_btn_switch_profile.xml | 2 +- .../res/layout/map_context_menu_fragment.xml | 14 ++++++------- OsmAnd/res/layout/map_hud_bottom.xml | 4 ++-- OsmAnd/res/layout/map_hud_top.xml | 16 +++++++-------- OsmAnd/res/layout/map_hud_widget.xml | 4 ++-- OsmAnd/res/layout/map_marker_item.xml | 6 +++--- OsmAnd/res/layout/map_marker_item_header.xml | 2 +- OsmAnd/res/layout/map_marker_item_new.xml | 4 ++-- .../res/layout/mapillary_install_dialog.xml | 2 +- OsmAnd/res/layout/mapillary_no_internet.xml | 2 +- .../layout/mapillary_static_image_view.xml | 2 +- .../res/layout/markers_group_view_holder.xml | 2 +- OsmAnd/res/layout/menu_obj_list_item.xml | 2 +- OsmAnd/res/layout/mode_view.xml | 2 +- .../layout/mode_view_route_preparation.xml | 4 ++-- .../res/layout/move_marker_bottom_sheet.xml | 2 +- OsmAnd/res/layout/note.xml | 2 +- OsmAnd/res/layout/note_list_item.xml | 2 +- OsmAnd/res/layout/open_time_list_item.xml | 2 +- OsmAnd/res/layout/order_poi_list_item.xml | 6 +++--- OsmAnd/res/layout/osm_edit_list_item.xml | 2 +- .../osmlive_cancelled_dialog_fragment.xml | 2 +- OsmAnd/res/layout/plan_route_gpx.xml | 4 ++-- OsmAnd/res/layout/plan_route_info.xml | 20 +++++++++---------- .../plan_route_toolbar_and_up_down_row.xml | 2 +- OsmAnd/res/layout/plugin.xml | 6 +++--- OsmAnd/res/layout/poi_filter_list_item.xml | 4 ++-- OsmAnd/res/layout/point_editor_button.xml | 6 +++--- OsmAnd/res/layout/point_editor_fragment.xml | 6 +++--- .../res/layout/point_editor_fragment_new.xml | 10 +++++----- .../layout/point_editor_group_select_item.xml | 4 ++-- OsmAnd/res/layout/preference_activity.xml | 8 ++++---- OsmAnd/res/layout/preference_button.xml | 2 +- .../layout/preference_category_with_descr.xml | 2 +- OsmAnd/res/layout/preference_circle_item.xml | 6 +++--- .../layout/preference_dialog_and_switch.xml | 2 +- .../res/layout/preference_dropdown_list.xml | 2 +- OsmAnd/res/layout/preference_info.xml | 2 +- OsmAnd/res/layout/preference_permission.xml | 2 +- ...preference_profile_item_with_radio_btn.xml | 2 +- .../layout/preference_select_icon_button.xml | 8 ++++---- OsmAnd/res/layout/preference_switch.xml | 2 +- .../layout/preference_switch_with_descr.xml | 2 +- OsmAnd/res/layout/preference_with_descr.xml | 2 +- ...reference_with_descr_dialog_and_switch.xml | 2 +- OsmAnd/res/layout/prev_route_card.xml | 4 ++-- OsmAnd/res/layout/profile_button_small.xml | 2 +- .../layout/profile_data_list_item_child.xml | 2 +- .../layout/profile_data_list_item_group.xml | 2 +- OsmAnd/res/layout/profile_edit_list_item.xml | 4 ++-- OsmAnd/res/layout/profile_list_item.xml | 2 +- .../layout/profile_preference_toolbar_big.xml | 4 ++-- OsmAnd/res/layout/quick_action_add_bug.xml | 6 +++--- .../layout/quick_action_add_dialog_item.xml | 2 +- .../res/layout/quick_action_add_favorite.xml | 10 +++++----- OsmAnd/res/layout/quick_action_add_gpx.xml | 10 +++++----- .../layout/quick_action_add_poi_layout.xml | 10 +++++----- .../quick_action_create_edit_dialog.xml | 4 ++-- .../quick_action_deletable_list_item.xml | 4 ++-- OsmAnd/res/layout/quick_action_list.xml | 2 +- .../res/layout/quick_action_show_hide_poi.xml | 2 +- .../quick_action_start_stop_navigation.xml | 6 +++--- .../layout/quick_action_switchable_action.xml | 6 +++--- .../layout/quick_action_switchable_item.xml | 6 +++--- OsmAnd/res/layout/quick_action_widget_dot.xml | 2 +- .../res/layout/quick_action_widget_item.xml | 4 ++-- OsmAnd/res/layout/quick_action_with_text.xml | 2 +- OsmAnd/res/layout/recording_note_fragment.xml | 6 +++--- .../recording_note_fragment_fullscreen.xml | 8 ++++---- .../layout/restore_purchases_list_footer.xml | 2 +- OsmAnd/res/layout/route_details_legend.xml | 2 +- OsmAnd/res/layout/route_info_card.xml | 2 +- OsmAnd/res/layout/route_info_header.xml | 12 +++++------ OsmAnd/res/layout/route_info_list_item.xml | 4 ++-- OsmAnd/res/layout/route_info_statistic.xml | 4 ++-- OsmAnd/res/layout/route_option_btn.xml | 2 +- OsmAnd/res/layout/route_options_container.xml | 2 +- OsmAnd/res/layout/route_waypoint_item.xml | 4 ++-- .../res/layout/route_waypoints_fragment.xml | 4 ++-- OsmAnd/res/layout/search_advanced_coords.xml | 8 ++++---- OsmAnd/res/layout/search_custom_list_item.xml | 2 +- OsmAnd/res/layout/search_custom_poi.xml | 6 +++--- OsmAnd/res/layout/search_dialog_fragment.xml | 4 ++-- OsmAnd/res/layout/search_favs_list_item.xml | 4 ++-- .../res/layout/search_history_list_item.xml | 6 +++--- OsmAnd/res/layout/search_list_item.xml | 8 ++++---- OsmAnd/res/layout/search_more_list_item.xml | 2 +- OsmAnd/res/layout/search_poi_filter.xml | 2 +- OsmAnd/res/layout/searchpoi.xml | 4 ++-- OsmAnd/res/layout/searchpoi_list.xml | 6 +++--- OsmAnd/res/layout/searchpoifolder_list.xml | 4 ++-- OsmAnd/res/layout/select_voice_first.xml | 4 ++-- .../layout/settings_device_image_screen.xml | 4 ++-- OsmAnd/res/layout/split_segments_layout.xml | 4 ++-- OsmAnd/res/layout/subscription_fragment.xml | 6 +++--- OsmAnd/res/layout/switch_select_list_item.xml | 2 +- OsmAnd/res/layout/track_content.xml | 2 +- OsmAnd/res/layout/track_details.xml | 8 ++++---- OsmAnd/res/layout/transport_route_card.xml | 2 +- .../transport_stop_route_item_with_icon.xml | 2 +- .../layout/travel_download_update_card.xml | 4 ++-- OsmAnd/res/layout/travel_needed_map_item.xml | 4 ++-- .../layout/two_line_with_images_list_item.xml | 4 ++-- OsmAnd/res/layout/waypoint_reached.xml | 4 ++-- OsmAnd/res/layout/wikivoyage_article_card.xml | 2 +- .../layout/wikivoyage_contents_list_item.xml | 2 +- OsmAnd/res/layout/wikivoyage_explore.xml | 2 +- .../res/layout/wikivoyage_open_beta_card.xml | 2 +- .../layout/wikivoyage_search_list_item.xml | 2 +- .../layout/wikivoyage_start_editing_card.xml | 2 +- .../res/layout/wikivoyage_welcome_screen.xml | 4 ++-- OsmAnd/res/layout/wpt_list_item.xml | 4 ++-- OsmAnd/res/layout/xmas_dialog.xml | 2 +- 222 files changed, 450 insertions(+), 450 deletions(-) diff --git a/OsmAnd/res/layout-land/add_gpx_point_bottom_sheet.xml b/OsmAnd/res/layout-land/add_gpx_point_bottom_sheet.xml index ce91127dc5..a6c60491b9 100644 --- a/OsmAnd/res/layout-land/add_gpx_point_bottom_sheet.xml +++ b/OsmAnd/res/layout-land/add_gpx_point_bottom_sheet.xml @@ -12,7 +12,7 @@ android:visibility="gone" tools:visibility="visible"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OsmAnd/res/layout/fragment_marker_options_bottom_sheet_dialog.xml b/OsmAnd/res/layout/fragment_marker_options_bottom_sheet_dialog.xml index 3c8090cf5f..cbb7d74d2f 100644 --- a/OsmAnd/res/layout/fragment_marker_options_bottom_sheet_dialog.xml +++ b/OsmAnd/res/layout/fragment_marker_options_bottom_sheet_dialog.xml @@ -49,7 +49,7 @@ android:paddingStart="@dimen/content_padding" android:paddingEnd="@dimen/content_padding"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OsmAnd/res/layout/gpx_track_item.xml b/OsmAnd/res/layout/gpx_track_item.xml index c7825f8083..d4007b5693 100644 --- a/OsmAnd/res/layout/gpx_track_item.xml +++ b/OsmAnd/res/layout/gpx_track_item.xml @@ -41,7 +41,7 @@ android:clickable="false" android:focusableInTouchMode="false" /> - - - - - - - - - - - - - - - - - - - - - @@ -147,7 +147,7 @@ android:layout_marginRight="16dp" android:layout_marginEnd="16dp"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -172,7 +172,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 803fc2f53a6d13544dce5ea99d0cb0e5d86c4169 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 15 May 2020 11:02:05 +0300 Subject: [PATCH 38/91] Fix #8958 --- OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java index 26baa04f45..b708b4afd6 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java @@ -556,6 +556,7 @@ public class PoiFiltersHelper { for (PoiTemplateList t : selectedPoiFilters.keySet()) { clearSelectedPoiFilters(t); } + saveSelectedPoiFilters(); } public void clearSelectedPoiFilters(PoiTemplateList type) { @@ -563,10 +564,12 @@ public class PoiFiltersHelper { if (templateFilters != null) { templateFilters.clear(); } + saveSelectedPoiFilters(); } public void hidePoiFilters() { selectedPoiFilters.clear(); + saveSelectedPoiFilters(); } public String getFiltersName(Set filters) { From c93193c128b2de591364d7fe974ee1c204d7752b Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 15 May 2020 11:42:52 +0300 Subject: [PATCH 39/91] Fix #8470 --- OsmAnd/src/net/osmand/plus/OsmandSettings.java | 1 + .../osmand/plus/monitoring/OnSaveCurrentTrackFragment.java | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index b70668e34d..93094f835e 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -2022,6 +2022,7 @@ public class OsmandSettings { public final CommonPreference SAVE_GLOBAL_TRACK_TO_GPX = new BooleanPreference("save_global_track_to_gpx", false).makeGlobal().cache(); public final CommonPreference SAVE_GLOBAL_TRACK_INTERVAL = new IntPreference("save_global_track_interval", 5000).makeProfile().cache(); public final CommonPreference SAVE_GLOBAL_TRACK_REMEMBER = new BooleanPreference("save_global_track_remember", false).makeProfile().cache(); + public final CommonPreference SHOW_SAVED_TRACK_REMEMBER = new BooleanPreference("show_saved_track_remember", true).makeGlobal(); // this value string is synchronized with settings_pref.xml preference name public final CommonPreference SAVE_TRACK_TO_GPX = new BooleanPreference("save_track_to_gpx", false).makeProfile().cache(); diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OnSaveCurrentTrackFragment.java b/OsmAnd/src/net/osmand/plus/monitoring/OnSaveCurrentTrackFragment.java index 8fcef48379..d31107135d 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/OnSaveCurrentTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/OnSaveCurrentTrackFragment.java @@ -50,7 +50,6 @@ public class OnSaveCurrentTrackFragment extends BottomSheetDialogFragment { public static final String TAG = "OnSaveCurrentTrackBottomSheetFragment"; public static final String SAVED_TRACKS_KEY = "saved_track_filename"; - private boolean showOnMap = true; private boolean openTrack = false; private File file; private String savedGpxDir = ""; @@ -121,10 +120,11 @@ public class OnSaveCurrentTrackFragment extends BottomSheetDialogFragment { }); SwitchCompat showOnMapButton = (SwitchCompat) mainView.findViewById(R.id.btn_show_on_map); + showOnMapButton.setChecked(app.getSettings().SHOW_SAVED_TRACK_REMEMBER.get()); showOnMapButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - showOnMap = isChecked; + app.getSettings().SHOW_SAVED_TRACK_REMEMBER.set(isChecked); } }); View openTrackBtn = mainView.findViewById(R.id.open_track_button); @@ -160,7 +160,8 @@ public class OnSaveCurrentTrackFragment extends BottomSheetDialogFragment { public void onDismiss(DialogInterface dialog) { super.onDismiss(dialog); if (file != null) { - if (showOnMap) { + OsmandApplication app = getMyApplication(); + if (app != null && app.getSettings().SHOW_SAVED_TRACK_REMEMBER.get()) { showOnMap(file, !openTrack); } FragmentActivity activity = getActivity(); From 1b5e4e7a8ce2af19e7cb401b8161d626017e7c9e Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Fri, 15 May 2020 11:48:59 +0300 Subject: [PATCH 40/91] Fix wrong markers group header --- .../plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java | 2 +- .../plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java index a75a76acd3..6b8a1b9dcd 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java @@ -144,7 +144,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter= 4 && previousDateHeader != THIS_YEAR_HEADER) { + } else if (currentMonth - markerMonth >= 4 && previousDateHeader != markerMonth && previousDateHeader != THIS_YEAR_HEADER) { items.add(THIS_YEAR_HEADER); previousDateHeader = THIS_YEAR_HEADER; } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java index b73e06de68..024651d819 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java @@ -80,8 +80,8 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter 8 && monthsDisplayed < 3 && previousHeader != markerMonth) { items.add(markerMonth); previousHeader = markerMonth; - monthsDisplayed += 1; - } else if (currentMonth - markerMonth >= 4 && previousHeader != THIS_YEAR_HEADER) { + monthsDisplayed++; + } else if (currentMonth - markerMonth >= 4 && previousHeader != markerMonth && previousHeader != THIS_YEAR_HEADER) { items.add(THIS_YEAR_HEADER); previousHeader = THIS_YEAR_HEADER; } From bfaa204404f4831afa8493561ef620269deb6ffc Mon Sep 17 00:00:00 2001 From: max-klaus Date: Fri, 15 May 2020 14:00:33 +0300 Subject: [PATCH 41/91] Create extended gpx at measure distance --- .../MeasurementEditingContext.java | 95 +++++++++++++++++- .../MeasurementToolFragment.java | 99 +++++++++++-------- .../osmand/plus/routing/RoutingHelper.java | 7 +- 3 files changed, 156 insertions(+), 45 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java index f5d606bf0b..0d3ff89dd4 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java @@ -2,8 +2,10 @@ package net.osmand.plus.measurementtool; import android.util.Pair; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import net.osmand.GPXUtilities.GPXFile; import net.osmand.GPXUtilities.TrkSegment; import net.osmand.GPXUtilities.WptPt; import net.osmand.Location; @@ -299,7 +301,6 @@ public class MeasurementEditingContext { @Override public void start() { - } @Override @@ -314,7 +315,6 @@ public class MeasurementEditingContext { @Override public void requestPrivateAccessRouting() { - } @Override @@ -365,6 +365,93 @@ public class MeasurementEditingContext { return params; } + public void exportRouteAsGpx(@NonNull String gpxName, @Nullable ExportAsGpxListener exportListener) { + if (application == null || (before.points.size() == 0 && after.points.size() == 0)) { + return; + } + RoutingHelper routingHelper = application.getRoutingHelper(); + if (!routingHelper.isRouteBeingCalculated()) { + RouteCalculationParams params = getExportAsGpxParams(gpxName, exportListener); + if (params != null) { + routingHelper.startRouteCalculationThread(params, true, true); + } + } + } + + @Nullable + private RouteCalculationParams getExportAsGpxParams(@NonNull final String gpxName, @Nullable final ExportAsGpxListener exportListener) { + List> pointList = Arrays.asList(before.points, after.points); + WptPt startPoint = null; + WptPt endPoint = null; + List intermediatePoints = new ArrayList<>(); + for (List points : pointList) { + for (WptPt point : points) { + if (startPoint == null) { + startPoint = point; + } else { + intermediatePoints.add(point); + endPoint = point; + } + } + } + if (endPoint != null) { + intermediatePoints.remove(endPoint); + } + if (startPoint == null || endPoint == null) { + return null; + } + + Location start = new Location(""); + start.setLatitude(startPoint.getLatitude()); + start.setLongitude(startPoint.getLongitude()); + LatLon end = new LatLon(endPoint.getLatitude(), endPoint.getLongitude()); + List intermediates = null; + if (!intermediatePoints.isEmpty()) { + intermediates = new ArrayList<>(); + for (WptPt point : intermediatePoints) { + intermediates.add(new LatLon(point.getLatitude(), point.getLongitude())); + } + } + final RouteCalculationParams params = new RouteCalculationParams(); + params.inSnapToRoadMode = true; + params.start = start; + params.end = end; + params.intermediates = intermediates; + RoutingHelper.applyApplicationSettings(params, application.getSettings(), snapToRoadAppMode); + params.mode = snapToRoadAppMode; + params.ctx = application; + params.calculationProgress = calculationProgress = new RouteCalculationProgress(); + params.calculationProgressCallback = new RoutingHelper.RouteCalculationProgressCallback() { + + @Override + public void start() { + } + + @Override + public void updateProgress(int progress) { + } + + @Override + public void requestPrivateAccessRouting() { + } + + @Override + public void finish() { + calculatedPairs = 0; + } + }; + params.resultListener = new RouteCalculationParams.RouteCalculationResultListener() { + @Override + public void onRouteCalculated(RouteCalculationResult route) { + GPXFile gpx = application.getRoutingHelper().generateGPXFileWithRoute(route, gpxName); + if (exportListener != null) { + exportListener.onExportAsGpxFinished(gpx); + } + } + }; + return params; + } + interface SnapToRoadProgressListener { void showProgressBar(); @@ -375,4 +462,8 @@ public class MeasurementEditingContext { void refresh(); } + + interface ExportAsGpxListener { + void onExportAsGpxFinished(GPXFile gpx); + } } diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index 7163ce83bf..575a7818e4 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -1,5 +1,6 @@ package net.osmand.plus.measurementtool; +import android.annotation.SuppressLint; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; @@ -48,6 +49,7 @@ import net.osmand.data.LatLon; import net.osmand.plus.ApplicationMode; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.OsmAndFormatter; +import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; @@ -402,12 +404,12 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { toolBarController.setBackBtnIconIds(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_dark); } if (newGpxData != null) { - NewGpxData.ActionType actionType = newGpxData.getActionType(); - if (actionType == NewGpxData.ActionType.ADD_ROUTE_POINTS) { + ActionType actionType = newGpxData.getActionType(); + if (actionType == ActionType.ADD_ROUTE_POINTS) { toolBarController.setTitle(getString(R.string.add_route_points)); - } else if (actionType == NewGpxData.ActionType.ADD_SEGMENT) { + } else if (actionType == ActionType.ADD_SEGMENT) { toolBarController.setTitle(getString(R.string.add_line)); - } else if (actionType == NewGpxData.ActionType.EDIT_SEGMENT) { + } else if (actionType == ActionType.EDIT_SEGMENT) { toolBarController.setTitle(getString(R.string.edit_line)); } } else { @@ -423,7 +425,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { @Override public void onClick(View v) { if (editingCtx.getPointsCount() > 0) { - if (newGpxData != null && newGpxData.getActionType() == NewGpxData.ActionType.EDIT_SEGMENT + if (newGpxData != null && newGpxData.getActionType() == ActionType.EDIT_SEGMENT && editingCtx.isInSnapToRoadMode()) { if (mapActivity != null && measurementLayer != null) { if (editingCtx.getPointsCount() > 0) { @@ -470,18 +472,18 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { } if (newGpxData != null && !gpxPointsAdded) { - NewGpxData.ActionType actionType = newGpxData.getActionType(); - if (actionType == NewGpxData.ActionType.ADD_ROUTE_POINTS) { + ActionType actionType = newGpxData.getActionType(); + if (actionType == ActionType.ADD_ROUTE_POINTS) { displayRoutePoints(); gpxPointsAdded = true; - } else if (actionType == NewGpxData.ActionType.EDIT_SEGMENT) { + } else if (actionType == ActionType.EDIT_SEGMENT) { displaySegmentPoints(); gpxPointsAdded = true; } } if (saved == null) { - saved = newGpxData != null && (newGpxData.getActionType() == NewGpxData.ActionType.ADD_ROUTE_POINTS || newGpxData.getActionType() == NewGpxData.ActionType.EDIT_SEGMENT); + saved = newGpxData != null && (newGpxData.getActionType() == ActionType.ADD_ROUTE_POINTS || newGpxData.getActionType() == ActionType.EDIT_SEGMENT); } return view; @@ -1245,16 +1247,17 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { saveGpx(dir, fileName, checked, null, false, null, saveType, close); } - private void saveExistingGpx(GPXFile gpx, boolean showOnMap, NewGpxData.ActionType actionType, boolean openTrackActivity) { + private void saveExistingGpx(GPXFile gpx, boolean showOnMap, ActionType actionType, boolean openTrackActivity) { saveGpx(null, null, showOnMap, gpx, openTrackActivity, actionType, null, false); } + @SuppressLint("StaticFieldLeak") private void saveGpx(final File dir, final String fileName, final boolean showOnMap, final GPXFile gpx, final boolean openTrackActivity, - final NewGpxData.ActionType actionType, + final ActionType actionType, final SaveType saveType, final boolean close) { @@ -1277,14 +1280,17 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { @Override protected Exception doInBackground(Void... voids) { MeasurementToolLayer measurementLayer = getMeasurementLayer(); - MapActivity activity = getMapActivity(); + OsmandApplication app = getMyApplication(); + if (app == null) { + return null; + } List points = editingCtx.getPoints(); TrkSegment before = editingCtx.getBeforeTrkSegmentLine(); TrkSegment after = editingCtx.getAfterTrkSegmentLine(); if (gpx == null) { toSave = new File(dir, fileName); String trackName = fileName.substring(0, fileName.length() - GPX_FILE_EXT.length()); - GPXFile gpx = new GPXFile(Version.getFullVersion(activity.getMyApplication())); + GPXFile gpx = new GPXFile(Version.getFullVersion(app)); if (measurementLayer != null) { if (saveType == SaveType.LINE) { TrkSegment segment = new TrkSegment(); @@ -1300,28 +1306,38 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { gpx.tracks.add(track); } else if (saveType == SaveType.ROUTE_POINT) { if (editingCtx.isInSnapToRoadMode()) { - TrkSegment segment = new TrkSegment(); - segment.points.addAll(before.points); - segment.points.addAll(after.points); - Track track = new Track(); - track.name = trackName; - track.segments.add(segment); - gpx.tracks.add(track); + editingCtx.exportRouteAsGpx(trackName, new MeasurementEditingContext.ExportAsGpxListener() { + @Override + public void onExportAsGpxFinished(GPXFile gpx) { + final Exception res = GPXUtilities.writeGpxFile(toSave, gpx); + gpx.path = toSave.getAbsolutePath(); + OsmandApplication app = getMyApplication(); + if (showOnMap && app != null) { + app.getSelectedGpxHelper().selectGpxFile(gpx, true, false); + app.runInUIThread(new Runnable() { + @Override + public void run() { + onGpxSaved(res); + } + }); + } + } + }); + return null; + } else { + Route rt = new Route(); + rt.name = trackName; + gpx.routes.add(rt); + rt.points.addAll(points); } - Route rt = new Route(); - rt.name = trackName; - gpx.routes.add(rt); - rt.points.addAll(points); } } - if (activity != null) { - Exception res = GPXUtilities.writeGpxFile(toSave, gpx); - gpx.path = toSave.getAbsolutePath(); - if (showOnMap) { - activity.getMyApplication().getSelectedGpxHelper().selectGpxFile(gpx, true, false); - } - return res; + Exception res = GPXUtilities.writeGpxFile(toSave, gpx); + gpx.path = toSave.getAbsolutePath(); + if (showOnMap) { + app.getSelectedGpxHelper().selectGpxFile(gpx, true, false); } + return res; } else { toSave = new File(gpx.path); if (measurementLayer != null) { @@ -1358,24 +1374,25 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { gpx.addRoutePoints(points); } } - if (activity != null) { - Exception res = GPXUtilities.writeGpxFile(toSave, gpx); - if (showOnMap) { - SelectedGpxFile sf = activity.getMyApplication().getSelectedGpxHelper().selectGpxFile(gpx, true, false); - if (sf != null) { - if (actionType == NewGpxData.ActionType.ADD_SEGMENT || actionType == NewGpxData.ActionType.EDIT_SEGMENT) { - sf.processPoints(getMyApplication()); - } + Exception res = GPXUtilities.writeGpxFile(toSave, gpx); + if (showOnMap) { + SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(gpx, true, false); + if (sf != null) { + if (actionType == ActionType.ADD_SEGMENT || actionType == ActionType.EDIT_SEGMENT) { + sf.processPoints(getMyApplication()); } } - return res; } + return res; } - return null; } @Override protected void onPostExecute(Exception warning) { + onGpxSaved(warning); + } + + private void onGpxSaved(Exception warning) { MapActivity activity = getMapActivity(); if (progressDialog != null && progressDialog.isShowing()) { progressDialog.dismiss(); diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 385a31ec74..c11b5edb04 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -1318,10 +1318,13 @@ public class RoutingHelper { return route; } - public GPXFile generateGPXFileWithRoute(String name){ - return provider.createOsmandRouterGPX(route, app, name); + public GPXFile generateGPXFileWithRoute(String name) { + return generateGPXFileWithRoute(route, name); } + public GPXFile generateGPXFileWithRoute(RouteCalculationResult route, String name){ + return provider.createOsmandRouterGPX(route, app, name); + } public void notifyIfRouteIsCalculated() { if(route.isCalculated()) { From 234c95dcb28ab5547476237b12dd288f5f213742 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Fri, 15 May 2020 14:00:38 +0300 Subject: [PATCH 42/91] Fix my places icon size --- .../layout/expandable_list_item_category.xml | 8 ++++---- OsmAnd/res/layout/favorites_list_item.xml | 18 +++++++++--------- OsmAnd/res/values/sizes.xml | 3 +++ .../plus/activities/FavoritesTreeFragment.java | 9 ++------- .../editors/PointEditorFragmentNew.java | 3 +-- 5 files changed, 19 insertions(+), 22 deletions(-) diff --git a/OsmAnd/res/layout/expandable_list_item_category.xml b/OsmAnd/res/layout/expandable_list_item_category.xml index 8285b143d0..f4f228739a 100644 --- a/OsmAnd/res/layout/expandable_list_item_category.xml +++ b/OsmAnd/res/layout/expandable_list_item_category.xml @@ -19,8 +19,8 @@ + android:layout_marginStart="@dimen/list_content_padding_large" /> + android:paddingStart="@dimen/favorites_my_places_icon_left_padding" + android:paddingLeft="@dimen/favorites_my_places_icon_left_padding" + android:paddingEnd="@dimen/favorites_my_places_icon_left_padding" + android:paddingRight="@dimen/favorites_my_places_icon_left_padding"> @@ -67,10 +67,10 @@ android:layout_gravity="center_vertical" android:layout_weight="1" android:orientation="vertical" - android:layout_marginStart="@dimen/context_menu_padding_margin_large" - android:layout_marginLeft="@dimen/context_menu_padding_margin_large" - android:layout_marginEnd="@dimen/context_menu_padding_margin_large" - android:layout_marginRight="@dimen/context_menu_padding_margin_large" + android:layout_marginStart="@dimen/favorites_my_places_icon_right_padding" + android:layout_marginLeft="@dimen/favorites_my_places_icon_right_padding" + android:layout_marginEnd="@dimen/favorites_my_places_icon_right_padding" + android:layout_marginRight="@dimen/favorites_my_places_icon_right_padding" android:paddingTop="@dimen/context_menu_padding_margin_small" android:paddingBottom="@dimen/context_menu_padding_margin_small"> diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index ad94db46ee..e3181e5c0b 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -73,6 +73,9 @@ 24dp 40dp + 30dp + 13dp + 28dp 48dp 2dp 60dp diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java index 3f638d2d3f..5fec572258 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java @@ -1032,13 +1032,8 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen int color = visible ? app.getFavorites().getColorWithCategory(model, getResources().getColor(R.color.color_favorite)) : ContextCompat.getColor(app, disabledIconColor); - int iconSize = (int) getResources().getDimension(R.dimen.favorites_icon_size); - if(model.getBackgroundType().equals(FavouritePoint.BackgroundType.CIRCLE)){ - icon.setImageDrawable(UiUtilities.createTintedDrawable(getActivity(), model.getIconId(), color)); - iconSize = (int) getResources().getDimension(R.dimen.standard_icon_size); - }else { - icon.setImageDrawable(FavoriteImageDrawable.getOrCreate(getActivity(), color, false, model)); - } + icon.setImageDrawable(FavoriteImageDrawable.getOrCreate(getActivity(), color, false, model)); + int iconSize = (int) getResources().getDimension(R.dimen.favorites_my_places_icon_size); FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(iconSize, iconSize, CENTER); icon.setLayoutParams(lp); row.findViewById(R.id.group_image).setVisibility(View.GONE); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java index 59de7e4f9b..a08f14f979 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java @@ -289,8 +289,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { @Override public void onResume() { super.onResume(); - if (!descriptionEdit.getText().toString().isEmpty() || descriptionCaption.getVisibility() != View.VISIBLE - || descriptionEdit.hasFocus()) { + if (!descriptionEdit.getText().toString().isEmpty() || descriptionEdit.hasFocus()) { descriptionCaption.setVisibility(View.VISIBLE); addDelDescription.setText(app.getString(R.string.delete_description)); } else { From d696e46f72001495d441caa9806741a59206d165 Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Fri, 15 May 2020 14:20:01 +0300 Subject: [PATCH 43/91] use AppCompatCheckBox instead of CheckBox --- OsmAnd-telegram/res/layout/user_list_item.xml | 2 +- OsmAnd/res/layout-land/parking_set_time_limit.xml | 2 +- OsmAnd/res/layout/check_item_rel.xml | 2 +- OsmAnd/res/layout/current_gpx_item.xml | 2 +- OsmAnd/res/layout/dash_gpx_track_item.xml | 2 +- OsmAnd/res/layout/dash_simulate_item.xml | 2 +- OsmAnd/res/layout/dialog_live_updates_item_settings.xml | 2 +- OsmAnd/res/layout/download_index_list_item.xml | 2 +- OsmAnd/res/layout/drawer_list_item.xml | 2 +- OsmAnd/res/layout/editing_poi_filter_list.xml | 2 +- OsmAnd/res/layout/expandable_list_item_category.xml | 2 +- OsmAnd/res/layout/favorites_list_item.xml | 2 +- OsmAnd/res/layout/gpx_track_item.xml | 2 +- OsmAnd/res/layout/layers_list_activity_item.xml | 2 +- OsmAnd/res/layout/list_item_header.xml | 2 +- OsmAnd/res/layout/local_index_list_item.xml | 2 +- OsmAnd/res/layout/map_marker_item.xml | 2 +- OsmAnd/res/layout/map_marker_item_new.xml | 2 +- OsmAnd/res/layout/note.xml | 2 +- OsmAnd/res/layout/note_list_item.xml | 2 +- OsmAnd/res/layout/parking_set_time_limit.xml | 2 +- OsmAnd/res/layout/poi_filter_list_item.xml | 2 +- OsmAnd/res/layout/search_list_item.xml | 2 +- OsmAnd/res/layout/select_all_list_item.xml | 2 +- OsmAnd/res/layout/send_poi_dialog.xml | 2 +- OsmAnd/res/layout/subscription_fragment.xml | 2 +- OsmAnd/res/layout/update_index.xml | 2 +- OsmAnd/res/layout/wpt_list_item.xml | 2 +- OsmAndCore-sample/res/layout/search_list_item.xml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/OsmAnd-telegram/res/layout/user_list_item.xml b/OsmAnd-telegram/res/layout/user_list_item.xml index f12003911f..555aba53e6 100644 --- a/OsmAnd-telegram/res/layout/user_list_item.xml +++ b/OsmAnd-telegram/res/layout/user_list_item.xml @@ -145,7 +145,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Date: Fri, 15 May 2020 14:34:40 +0300 Subject: [PATCH 44/91] Fix #8943 --- .../src/net/osmand/data/FavouritePoint.java | 20 +++++++++++++++---- .../net/osmand/plus/FavouritesDbHelper.java | 4 ++-- .../plus/base/FavoriteImageDrawable.java | 2 +- .../parkingpoint/ParkingPositionPlugin.java | 9 ++++++--- .../ParkingTypeBottomSheetDialogFragment.java | 7 ++++--- .../AddPointBottomSheetDialog.java | 2 +- 6 files changed, 30 insertions(+), 14 deletions(-) diff --git a/OsmAnd/src/net/osmand/data/FavouritePoint.java b/OsmAnd/src/net/osmand/data/FavouritePoint.java index 95236d4815..29a852a1ea 100644 --- a/OsmAnd/src/net/osmand/data/FavouritePoint.java +++ b/OsmAnd/src/net/osmand/data/FavouritePoint.java @@ -8,7 +8,11 @@ import androidx.annotation.StringRes; import net.osmand.GPXUtilities.WptPt; import net.osmand.plus.FavouritesDbHelper; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.OsmandSettings.BooleanPreference; +import net.osmand.plus.OsmandSettings.OsmandPreference; import net.osmand.plus.R; +import net.osmand.plus.parkingpoint.ParkingPositionPlugin; import net.osmand.util.Algorithms; import java.io.Serializable; @@ -97,7 +101,7 @@ public class FavouritePoint implements Serializable, LocationPoint { } public String getIconEntryName(Context ctx) { - return ctx.getResources().getResourceEntryName(getOverlayIconId()); + return ctx.getResources().getResourceEntryName(getOverlayIconId(ctx)); } public void setIconId(int iconId) { @@ -137,9 +141,9 @@ public class FavouritePoint implements Serializable, LocationPoint { this.originObjectName = originObjectName; } - public int getOverlayIconId() { + public int getOverlayIconId(Context ctx) { if (isSpecialPoint()) { - return specialPointType.getIconId(); + return specialPointType.getIconId(ctx); } return getIconId(); } @@ -284,7 +288,15 @@ public class FavouritePoint implements Serializable, LocationPoint { return typeName; } - public int getIconId() { + public int getIconId(@NonNull Context ctx) { + if (this == PARKING) { + OsmandApplication app = (OsmandApplication) ctx.getApplicationContext(); + OsmandPreference parkingType = app.getSettings().getPreference(ParkingPositionPlugin.PARKING_TYPE); + if (parkingType instanceof BooleanPreference && ((BooleanPreference) parkingType).get()) { + return R.drawable.mm_special_parking_time_limited; + } + return iconId; + } return iconId; } diff --git a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java index 3decf9e607..e87a8fbe6d 100644 --- a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java @@ -290,12 +290,12 @@ public class FavouritesDbHelper { public void setSpecialPoint(@NonNull LatLon latLon, FavouritePoint.SpecialPointType specialType, @Nullable String address) { FavouritePoint point = getSpecialPoint(specialType); if (point != null) { - point.setIconId(specialType.getIconId()); + point.setIconId(specialType.getIconId(context)); editFavourite(point, latLon.getLatitude(), latLon.getLongitude(), address); } else { point = new FavouritePoint(latLon.getLatitude(), latLon.getLongitude(), specialType.getName(), specialType.getCategory()); point.setAddress(address); - point.setIconId(specialType.getIconId()); + point.setIconId(specialType.getIconId(context)); addFavourite(point); } } diff --git a/OsmAnd/src/net/osmand/plus/base/FavoriteImageDrawable.java b/OsmAnd/src/net/osmand/plus/base/FavoriteImageDrawable.java index 5999468241..9336693734 100644 --- a/OsmAnd/src/net/osmand/plus/base/FavoriteImageDrawable.java +++ b/OsmAnd/src/net/osmand/plus/base/FavoriteImageDrawable.java @@ -48,7 +48,7 @@ public class FavoriteImageDrawable extends Drawable { this.synced = synced; Resources res = ctx.getResources(); UiUtilities uiUtilities = ((OsmandApplication) ctx.getApplicationContext()).getUIUtilities(); - int overlayIconId = point != null ? point.getOverlayIconId() : 0; + int overlayIconId = point != null ? point.getOverlayIconId(ctx) : 0; int uiIconId; if (overlayIconId != 0) { favIcon = uiUtilities.getIcon(getMapIconId(ctx, overlayIconId), R.color.color_white); diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java index 822c5819c5..8b38d111e5 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java @@ -18,6 +18,7 @@ import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.FragmentManager; import net.osmand.data.FavouritePoint; +import net.osmand.data.FavouritePoint.SpecialPointType; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.plus.ApplicationMode; @@ -285,7 +286,7 @@ public class ParkingPositionPlugin extends OsmandPlugin { showDeleteEventWarning(activity); cancelParking(); if (activity instanceof MapActivity) { - FavouritePoint pnt = app.getFavorites().getSpecialPoint(FavouritePoint.SpecialPointType.PARKING); + FavouritePoint pnt = app.getFavorites().getSpecialPoint(SpecialPointType.PARKING); if(pnt != null) { app.getFavorites().deleteFavourite(pnt); } @@ -305,7 +306,8 @@ public class ParkingPositionPlugin extends OsmandPlugin { * @param choose */ void showSetTimeLimitDialog(final MapActivity mapActivity, final DialogInterface choose) { - boolean nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightModeForMapControls(); + final OsmandApplication app = mapActivity.getMyApplication(); + boolean nightMode = app.getDaynightHelper().isNightModeForMapControls(); final View setTimeParking = UiUtilities.getInflater(mapActivity, nightMode).inflate(R.layout.parking_set_time_limit, null); AlertDialog.Builder setTime = new AlertDialog.Builder(mapActivity); setTime.setView(setTimeParking); @@ -370,7 +372,8 @@ public class ParkingPositionPlugin extends OsmandPlugin { } else { addOrRemoveParkingEvent(false); } - showContextMenuIfNeeded(mapActivity,false); + app.getFavorites().setSpecialPoint(getParkingPosition(), SpecialPointType.PARKING, null); + showContextMenuIfNeeded(mapActivity, false); } }); setTime.create(); diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java index 6c48241ec6..0c1ba98b9a 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java @@ -4,7 +4,7 @@ import android.app.Dialog; import android.os.Bundle; import android.view.View; -import net.osmand.data.FavouritePoint; +import net.osmand.data.FavouritePoint.SpecialPointType; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; @@ -71,10 +71,11 @@ public class ParkingTypeBottomSheetDialogFragment extends MenuBottomSheetDialogF plugin.addOrRemoveParkingEvent(false); plugin.setParkingPosition(latitude, longitude, false); plugin.showContextMenuIfNeeded(mapActivity, true); + + mapActivity.getMyApplication().getFavorites().setSpecialPoint( + plugin.getParkingPosition(), SpecialPointType.PARKING, null); mapActivity.refreshMap(); } - mapActivity.getMyApplication().getFavorites().setSpecialPoint( - plugin.getParkingPosition(), FavouritePoint.SpecialPointType.PARKING, null); } dismiss(); } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java index 0eccdcfd09..e58892fa2d 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java @@ -649,7 +649,7 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment { int iconColor = app.getSettings().isLightContent() ? R.color.icon_color_default_light : R.color.icon_color_default_dark; favoriteViewHolder.icon.setImageDrawable(app.getUIUtilities().getIcon( - ((FavouritePoint) item).getSpecialPointType().getIconId(), iconColor)); + ((FavouritePoint) item).getSpecialPointType().getIconId(app), iconColor)); favoriteViewHolder.description.setText(point.getDescription()); } else { if (point.getCategory().equals("")) { From 3ec03040ea68f3412145d4d92f8b26cce45fcbc8 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 15 May 2020 14:36:31 +0300 Subject: [PATCH 45/91] merge route parts implementation --- .../osmand/binary/BinaryMapIndexReader.java | 1 + .../java/net/osmand/data/TransportRoute.java | 61 +-- .../osmand/router/TransportRoutePlanner.java | 439 ++++++++++-------- 3 files changed, 276 insertions(+), 225 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java index 4ddb58377a..b3f4a5ea22 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -2639,6 +2639,7 @@ public class BinaryMapIndexReader { public net.osmand.data.IncompleteTransportRoute getIncompleteRoutePointers(long id) { return incompleteRoutes.get(id); } + public Collection getIncompleteRoutes() { return incompleteRoutes.valueCollection(); } diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java index 152bb281d9..0c222cf173 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java @@ -12,6 +12,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import gnu.trove.list.array.TIntArrayList; +import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.map.hash.TLongObjectHashMap; public class TransportRoute extends MapObject { @@ -30,7 +32,7 @@ public class TransportRoute extends MapObject { public TransportRoute() { } - public TransportRoute(TransportRoute r, boolean combined) { + public TransportRoute(TransportRoute r, List mergedSegment, List ways) { this.name = r.name; this.enName = r.enName; this.names = r.names; @@ -38,14 +40,12 @@ public class TransportRoute extends MapObject { this.operator = r.operator; this.ref = r.ref; this.type = r.type; - this.dist = r.dist; this.color = r.color; this.schedule = r.schedule; - this.combined = combined; - - if (combined) { - this.addRoutePart(r, true); - } + this.combined = true; + this.forwardStops = mergedSegment; + this.dist = calculateDistance(); + this.forwardWays = ways; //TODO check } public TransportSchedule getSchedule() { @@ -62,47 +62,20 @@ public class TransportRoute extends MapObject { public boolean isCombined() { return combined; } - + + public Integer calculateDistance() { + int distance = 0; + for (int i = 0; i < forwardStops.size()-1; i++) { + if (!forwardStops.get(i).isMissingStop() || !forwardStops.get(i+1).isMissingStop()) + distance += MapUtils.getDistance(forwardStops.get(i).getLocation(), forwardStops.get(i+1).getLocation()); + } + return distance; + } + public boolean isIncomplete() { return forwardStops.get(0).isMissingStop() || forwardStops.get(forwardStops.size()-1).isMissingStop(); } - public void setCombined(boolean combined) { - this.combined = combined; - } - - public TransportStop getMissingStartStop() { - return forwardStops.get(0).isMissingStop() ? forwardStops.get(0) : null; - } - - public TransportStop getMissingEndStop() { - return forwardStops.get(forwardStops.size()-1).isMissingStop() ? forwardStops.get(forwardStops.size()-1) : null; - } - - public boolean addRoutePart(TransportRoute part, boolean forward) { - //TODO chec stop validity and combine ways - int addCount = 0; - if (forward) { - routeParts.add(part); - for (int i = 0; i < part.getForwardStops().size(); i++) { - if (!part.getForwardStops().get(i).isMissingStop() && !forwardStops.contains(part.getForwardStops().get(i))) { - forwardStops.add(part.getForwardStops().get(i)); - addCount++; - } - } - } else { - routeParts.add(0, part); - for (int i = part.getForwardStops().size() - 1; i >= 0 ; i--) { - if (!part.getForwardStops().get(i).isMissingStop() && !forwardStops.contains(part.getForwardStops().get(i))) { - forwardStops.add(part.getForwardStops().get(i)); - addCount++; - } - } - } - return addCount > 0; - } - - public List getRouteParts() { return routeParts; } diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index b7480d488d..01972d1970 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -821,15 +821,20 @@ public class TransportRoutePlanner { if (rrs != null && !multifileStop.isDeleted()) { for (int rr : rrs) { // here we should assign only complete routes: - TransportRoute combinedRoute = getCombinedRoute(localFileRoutes.get(rr), r.getFile().getName()); - if (combinedRoute == null) { - System.err.println(String.format("Something went wrong by loading route %d for stop %s", rr, stop)); - } else if (multifileStop == stop || - (!multifileStop.hasRoute(combinedRoute.getId()) && - !multifileStop.isRouteDeleted(combinedRoute.getId()))) { - // duplicates won't be added - multifileStop.addRouteId(combinedRoute.getId()); - multifileStop.addRoute(combinedRoute); + TransportRoute route = localFileRoutes.get(rr); + if (route == null) { + System.err.println(String.format("Something went wrong by loading combined route %d for stop %s", route.getId(), stop)); + } else { + TransportRoute combinedRoute = getCombinedRoute(route, r.getFile().getName()); + if (combinedRoute == null) { + System.err.println(String.format("Something went wrong by loading combined route %d for stop %s", route.getId(), stop)); + } else if (multifileStop == stop || + (!multifileStop.hasRoute(combinedRoute.getId()) && + !multifileStop.isRouteDeleted(combinedRoute.getId()))) { + // duplicates won't be added + multifileStop.addRouteId(combinedRoute.getId()); + multifileStop.addRoute(combinedRoute); + } } } } @@ -932,197 +937,269 @@ public class TransportRoutePlanner { TransportRoute c = combinedRoutesCache.get(route.getId()); if (c == null) { c = combineRoute(route, fileName); + combinedRoutesCache.put(route.getId(), c); } return c; } - Comparator compareByDist = (TransportRoute tr1, TransportRoute tr2) - -> ((Integer)tr1.getDistance()).compareTo((Integer)tr2.getDistance()); - private TransportRoute combineRoute(TransportRoute route, String fileName) throws IOException { - List result = new ArrayList<>(findIncompleteRouteParts(route, fileName)); - List acceptedCandidates = new ArrayList(); - - TransportRoute baseRoute = route; - - if (result.size() > 1) { - //1. Sort by longest piece: - Collections.sort(result, compareByDist); - - //2. Check if any route's part contains more stops, then "base" route, - //so we could find longest part (and remove subsets and copies): - Iterator itr = result.iterator(); - boolean containsAllStops = false; - while (itr.hasNext()) { - TransportRoute candidate = itr.next(); - if (candidate.compareRoute(baseRoute)) { - itr.remove(); - continue; - } else if (candidate.getForwardStops().size() > baseRoute.getForwardStops().size()) { - for (TransportStop s : baseRoute.getForwardStops()) { - for (TransportStop cs : candidate.getForwardStops()) { - if (!s.isMissingStop() && !cs.isMissingStop()) { - if (s.getId() == cs.getId()) { - containsAllStops = true; - break; - } - containsAllStops = false; - } - } - } - if (containsAllStops) { - baseRoute = candidate; - itr.remove(); - } - } else { - for (TransportStop cs : candidate.getForwardStops()) { - for (TransportStop s: baseRoute.getForwardStops()) { - if (!s.isMissingStop() && !cs.isMissingStop()) { - if(s.getId() == cs.getId()) { - containsAllStops = true; - break; - } - containsAllStops = false; - } - } - } - if (containsAllStops) { - itr.remove(); - } - } - } - } else { - acceptedCandidates = result; - } + //1.Get all available route parts; + List result = new ArrayList<>(findIncompleteRouteParts(route)); +// List acceptedCandidates = new ArrayList(); + List allWays = getAllWays(result); - //3. Connect routes in right order (stops/ways) - TransportRoute cr = new TransportRoute(baseRoute, true); - - TransportStop missingStart = baseRoute.getMissingStartStop(); - TransportStop missingEnd = baseRoute.getMissingEndStop(); + //2. Get massive of segments: + List> segments = parseRoutePartsToSegments(result); + Collections.sort(segments, compareSegsBySize.reversed()); - List stops = baseRoute.getForwardStops(); - List ways = route.getForwardWays(); - Iterator itr = result.iterator(); - while(result.size() > 0) { - boolean success = false; - double distFromMissingEnd = -1; - double distFromMissingStart = -1; - TransportRoute part = itr.next(); - if (baseRoute.getMissingEndStop() != null && part.getMissingStartStop() != null) { - distFromMissingEnd = - MapUtils.getDistance(baseRoute.getMissingEndStop().getLocation(), part.getMissingStartStop().getLocation()); - } - if (baseRoute.getMissingStartStop() != null && part.getMissingEndStop() != null) { - distFromMissingStart = - MapUtils.getDistance(baseRoute.getMissingStartStop().getLocation(), part.getMissingEndStop().getLocation()); - } - if (distFromMissingEnd != -1) { - if ((distFromMissingStart == -1 || distFromMissingStart > distFromMissingEnd) && distFromMissingEnd < MISSING_STOP_SEARCH_RADIUS) { - //try to attach route part to end of baseRoute - if (!cr.addRoutePart(part, true)) { - //else assume that part of the route is missing and we need to attach it later - //TODO (how to check if missing part is exist at all? If there no some part of map - //we will fall in endless loop) - result.add(part); - }; - } - } else if (distFromMissingStart != -1) { - if ((distFromMissingEnd == -1 || distFromMissingStart < distFromMissingEnd) && distFromMissingStart < MISSING_STOP_SEARCH_RADIUS) { - if (!cr.addRoutePart(part, false)) { - //same thing here, need to exit loop somehow - result.add(part); - } - } - } + //3. Merge segments and remove excess missingStops (when they are closer then MISSING_STOP_SEARCH_RADIUS): + //4. Check for missingStops. If they present in the middle/there more then one segment - we have a hole in the map data + List> mergedSegments = combineSegments(segments); + + //5. Create combined TransportRoute and return it + if (mergedSegments.size() > 1) { + //TODO what will we do with incomplete route? + return null; + } else { + return new TransportRoute(route, mergedSegments.get(0), allWays); } - - return cr; + } + + private List getAllWays(List parts) { + List w = new ArrayList(); + for (TransportRoute t : parts) { + w.addAll(t.getForwardWays()); + } + return w; } - private Collection findIncompleteRouteParts(TransportRoute baseRoute, String fileName) throws IOException { + Comparator> compareSegsBySize = new Comparator>() { + public int compare(List s1, List s2) { + return ((Integer)s1.size()).compareTo((Integer)s2.size()); + } + }; + + private List> combineSegments(List> segments) { + List> rawSegments = segments; + + + List> partsToDelete = new ArrayList>(); + List> partsToReturn = new ArrayList>(); + List base; + int startSize = 0; + + Iterator> segItr = rawSegments.iterator(); + while (segItr.hasNext()) { + startSize = rawSegments.size(); + partsToDelete.clear(); + partsToReturn.clear(); + base = segItr.next(); + segItr.remove(); + + TransportStop firstStopMissing = base.get(0).isMissingStop() ? base.get(0) : null; + TransportStop lastStopMissing = base.get(base.size() - 1).isMissingStop() ? base.get(base.size() - 1) + : null; + + for (int i = 0; i < segments.size(); i++) { + // compare every other piece of route with base (largest part so far) + // and if it has common stops or close missing stops try to combine + List candidate = rawSegments.get(i); + TransportStop cmss = candidate.get(0).isMissingStop() ? candidate.get(0) : null; + TransportStop cmse = candidate.get(candidate.size() - 1).isMissingStop() + ? candidate.get(candidate.size() - 1) + : null; + int csStopCount = candidate.size(); + if (cmss != null) { + csStopCount--; + } + if (cmse != null) { + csStopCount--; + } + int csSameStopsCount = 0; + for (TransportStop s : base) { + if (!s.isMissingStop()) { + for (TransportStop cs : candidate) { + if (!cs.isMissingStop() && s.getId().equals(cs.getId())) { + csSameStopsCount++; + } + } + } + } + if (csStopCount == csSameStopsCount) { + // all stops of candidate inside base, delete candidate + partsToDelete.add(candidate); + continue; + + } else { + if (csSameStopsCount > 0 && firstStopMissing != null && lastStopMissing == null + && cmse != null) { + // parts intersecting and we know what sides to connect, attach to start + base = mergeSegments(base, candidate, false); + + } else if (csSameStopsCount > 0 && lastStopMissing != null && firstStopMissing == null + && cmss != null) { + // parts intersecting and we know what sides to connect, attach to end + base = mergeSegments(base, candidate, true); + + } else { + // check for missing stops in candidate and attach accordingly + double distStartToEnd = MISSING_STOP_SEARCH_RADIUS + 1; + double distEndToStart = MISSING_STOP_SEARCH_RADIUS + 1; + if (cmss != null && lastStopMissing != null) { + distStartToEnd = MapUtils.getDistance(cmss.getLocation(), + lastStopMissing.getLocation()); + } + if (cmse != null && firstStopMissing != null) { + distEndToStart = MapUtils.getDistance(cmse.getLocation(), + firstStopMissing.getLocation()); + } + if (distStartToEnd < distEndToStart && distStartToEnd <= MISSING_STOP_SEARCH_RADIUS) { + base = mergeSegments(base, candidate, true); + } else if (distEndToStart < distStartToEnd && distEndToStart <= MISSING_STOP_SEARCH_RADIUS) { + base = mergeSegments(base, candidate, false); + } else { + if (csSameStopsCount == 0) { + // it's OK, we should look for other parts first + partsToReturn.add(candidate); + System.out.println("Candidate is not connected to Base, continue search"); + } else { + // it's not OK, if there is intersecting stops and too long distance between + // missingStops, there is some error in data + System.out.println("MERGING ERROR. THERE IS SOMETHING WRONG WITH DATA"); + } + } + } + partsToDelete.add(candidate); + } + } + for (List p : partsToDelete) { + rawSegments.remove(p); + } + rawSegments.addAll(partsToReturn); + rawSegments.add(base); + //Check if all is merged: + if (rawSegments.size() == 1) { + break; + } + //If we still have several segments, but after iteration they number didn't dwindle, + //check if we still could merge some of them or do we have a hole in the data + boolean hasValidCandidate = false; + if (rawSegments.size() == startSize) { + for (int i = 0; i < rawSegments.size()-1; i++) { + TransportStop ms = rawSegments.get(i).get(0).isMissingStop() ? rawSegments.get(i).get(0) : null; + TransportStop me = rawSegments.get(i).get(rawSegments.get(i).size()-1).isMissingStop() + ? rawSegments.get(i).get(rawSegments.get(i).size()-1) : null; + for (int j = 1; j < rawSegments.size(); j++) { + TransportStop cms = rawSegments.get(j).get(0).isMissingStop() ? rawSegments.get(j).get(0) : null; + TransportStop cme = rawSegments.get(j).get(rawSegments.get(j).size()-1).isMissingStop() + ? rawSegments.get(j).get(rawSegments.get(j).size()-1) : null; + if (ms != null && cme != null && MapUtils.getDistance(ms.getLocation(), cme.getLocation()) <= MISSING_STOP_SEARCH_RADIUS) { + hasValidCandidate = true; + } + if (me != null && cms != null && MapUtils.getDistance(me.getLocation(), cms.getLocation()) <= MISSING_STOP_SEARCH_RADIUS) { + hasValidCandidate = true; + } + //we has at least one valid pair of segments for merging + if (hasValidCandidate) { + break; + } + } + } + } + //if we could not merge any more segments - break; + if (rawSegments.size() == 1 || (rawSegments.size() == startSize && !hasValidCandidate)) { + break; + } + } + return rawSegments; + } + + private List mergeSegments(List base, List candidate, boolean forward) { + List result; + if (forward) { + result = new ArrayList<>(base.subList(0, base.size()-1)); + for (int i = 1; i < candidate.size(); i++) { + if (!result.contains(candidate.get(i))) { + result.add(candidate.get(i)); + } + } + } else { + result = new ArrayList<>(candidate.subList(0, candidate.size()-1)); + for (int i = 1; i < base.size(); i++) { + if (!result.contains(base.get(i))) { + result.add(base.get(i)); + } + } + } + return result; + } + + private List> parseRoutePartsToSegments(List routeParts) { + List> segs = new ArrayList>(); + for (TransportRoute part : routeParts) { + List newSeg = new ArrayList(); + for (TransportStop s : part.getForwardStops()) { + if (s.isMissingStop()) { + if (newSeg.isEmpty()) { + newSeg.add(s); + } else { + newSeg.add(s); + segs.add(newSeg); + newSeg = new ArrayList(); + } + } else { + newSeg.add(s); + } + } + if (!newSeg.isEmpty()) { + segs.add(newSeg); + } + } + return segs; + } + + + private Collection findIncompleteRouteParts(TransportRoute baseRoute) throws IOException { IncompleteTransportRoute ptr; TIntObjectHashMap res = new TIntObjectHashMap(); - TIntObjectHashMap localRes = new TIntObjectHashMap(); - + //TODO search only routes from bbox? for (BinaryMapIndexReader bmir: routeMap.keySet()) { -// if (!bmir.getFile().getName().equals(fileName)) { - localRes.clear(); - /** - * What about situation when one route has several parts in map? - * MB check all readers and then sort it out? - * - * Should I check if those routes already loaded? But they shouldn't, - * else we will already had a combined route and never get there! - */ - ptr = bmir.getIncompleteRoutePointers(baseRoute.getId()); - if (ptr != null && ptr.getRouteOffset() != -1) { - localRes = bmir.getTransportRoutes(new int[] {ptr.getRouteOffset()}); - res.putAll(localRes); - } -// } + /** + * TODO: Should I check if those routes already loaded? But they shouldn't, + * else we will already had a combined route and never get there! + */ + ptr = bmir.getIncompleteRoutePointers(baseRoute.getId()); + if (ptr != null && ptr.getRouteOffset() != -1) { + res.putAll(bmir.getTransportRoutes(new int[] {ptr.getRouteOffset()})); + } } return res.valueCollection(); } - - -// private TransportRoute loadMissingTransportRoute(int sx, int sy, TransportRoute route) throws IOException { -// long nanoTime = System.nanoTime(); -// List res = new ArrayList(); -// TIntObjectHashMap tr = new TIntObjectHashMap(); -// int d = missingStopRadiusIn31; -// int lx = (sx - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); -// int rx = (sx + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); -// int ty = (sy - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); -// int by = (sy + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); -// for(int x = lx; x <= rx; x++) { -// for(int y = ty; y <= by; y++) { -// long tileId = (((long)x) << (cfg.ZOOM_TO_LOAD_TILES + 1)) + y; -//// List list = quadTree.get(tileId); -//// if(list == null) { -// tr = getRouteParts(x, y); -//// quadTree.put(tileId, list); -//// } -// if (!tr.isEmpty()) { -// res.addAll(tr.valueCollection()); -// } -// -// } -// } -// for (TransportRoute trr : res) { -// if ((long)trr.getId() == (long)route.getId()) { -// if (trr.getForwardStops() != route.getForwardStops()) { -// return trr; -// } -// } -// } -// -// return null; -// } - private TIntObjectHashMap getRouteParts(int x, int y) throws IOException { - int pz = (31 - cfg.ZOOM_TO_LOAD_TILES); - SearchRequest sr = BinaryMapIndexReader.buildSearchTransportRequest(x << pz, (x + 1) << pz, - y << pz, (y + 1) << pz, -1, null); - - TLongObjectHashMap loadedTransportStops = new TLongObjectHashMap(); - TIntObjectHashMap localFileRoutes = new TIntObjectHashMap<>(); - TIntObjectHashMap res = new TIntObjectHashMap(); - for (BinaryMapIndexReader r : routeMap.keySet()) { - sr.clearSearchResults(); - List stops = r.searchTransportIndex(sr); - - localFileRoutes.clear(); - //search routes here: - mergeTransportStops(r, loadedTransportStops, stops, localFileRoutes, routeMap.get(r)); - if (!localFileRoutes.isEmpty()) { - res.putAll(localFileRoutes); - } - } - return res; - } + +// private TIntObjectHashMap getRouteParts(int x, int y) throws IOException { +// int pz = (31 - cfg.ZOOM_TO_LOAD_TILES); +// SearchRequest sr = BinaryMapIndexReader.buildSearchTransportRequest(x << pz, (x + 1) << pz, +// y << pz, (y + 1) << pz, -1, null); +// +// TLongObjectHashMap loadedTransportStops = new TLongObjectHashMap(); +// TIntObjectHashMap localFileRoutes = new TIntObjectHashMap<>(); +// TIntObjectHashMap res = new TIntObjectHashMap(); +// for (BinaryMapIndexReader r : routeMap.keySet()) { +// sr.clearSearchResults(); +// List stops = r.searchTransportIndex(sr); +// +// localFileRoutes.clear(); +// //search routes here: +// mergeTransportStops(r, loadedTransportStops, stops, localFileRoutes, routeMap.get(r)); +// if (!localFileRoutes.isEmpty()) { +// res.putAll(localFileRoutes); +// } +// } +// return res; +// } private void loadTransportSegments(Collection stops, List lst) throws IOException { From 3c655c4f986f192fe49d08332ba8d19d48b55b54 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 15 May 2020 14:39:42 +0300 Subject: [PATCH 46/91] fixes --- .../osmand/binary/BinaryMapTransportReaderAdapter.java | 9 ++++++--- .../java/net/osmand/router/TransportRoutePlanner.java | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java index 617bf46f07..62ffe1af07 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java @@ -304,13 +304,16 @@ public class BinaryMapTransportReaderAdapter { dataObject.setRouteOffset(codedIS.readRawVarint32()); break; case OsmandOdb.IncompleteTransportRoute.OPERATOR_FIELD_NUMBER : - dataObject.setOperator(regStr(stringTable)); + skipUnknownField(t); +// dataObject.setOperator(regStr(stringTable)); break; case OsmandOdb.IncompleteTransportRoute.REF_FIELD_NUMBER : - dataObject.setRef(regStr(stringTable)); + skipUnknownField(t); +// dataObject.setRef(regStr(stringTable)); break; case OsmandOdb.IncompleteTransportRoute.TYPE_FIELD_NUMBER : - dataObject.setType(regStr(stringTable)); + skipUnknownField(t); +// dataObject.setType(regStr(stringTable)); break; case OsmandOdb.IncompleteTransportRoute.MISSINGSTOPS_FIELD_NUMBER : //// dataObject.getMissingStops().add(codedIS.readSInt32()); //skip for now diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 01972d1970..2a022fe6e3 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -808,6 +808,10 @@ public class TransportRoutePlanner { mergeTransportStops(r, loadedTransportStops, stops, localFileRoutes, routeMap.get(r)); for (TransportStop stop : stops) { + //skip missing stops + if (stop.isMissingStop()) { + continue; + } long stopId = stop.getId(); TransportStop multifileStop = loadedTransportStops.get(stopId); int[] rrs = stop.getReferencesToRoutes(); @@ -947,8 +951,7 @@ public class TransportRoutePlanner { private TransportRoute combineRoute(TransportRoute route, String fileName) throws IOException { //1.Get all available route parts; List result = new ArrayList<>(findIncompleteRouteParts(route)); -// List acceptedCandidates = new ArrayList(); - List allWays = getAllWays(result); + List allWays = getAllWays(result); //TODO check ways for right order? Artifacts during drawing. //2. Get massive of segments: List> segments = parseRoutePartsToSegments(result); @@ -958,9 +961,10 @@ public class TransportRoutePlanner { //4. Check for missingStops. If they present in the middle/there more then one segment - we have a hole in the map data List> mergedSegments = combineSegments(segments); + //5. Create combined TransportRoute and return it if (mergedSegments.size() > 1) { - //TODO what will we do with incomplete route? + //TODO sort incomplete routes (and remove missingStops) and merge into one? return null; } else { return new TransportRoute(route, mergedSegments.get(0), allWays); From 9fe736957dbd13abb7234c454934ceb310bf935e Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 15 May 2020 14:57:06 +0300 Subject: [PATCH 47/91] clear garbage --- .../java/net/osmand/data/TransportRoute.java | 15 ++++------ .../osmand/router/TransportRoutePlanner.java | 29 +++++++++---------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java index 0c222cf173..11900aee9f 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java @@ -73,15 +73,12 @@ public class TransportRoute extends MapObject { } public boolean isIncomplete() { - return forwardStops.get(0).isMissingStop() || forwardStops.get(forwardStops.size()-1).isMissingStop(); - } - - public List getRouteParts() { - return routeParts; - } - - public void setRouteParts(List routeParts) { - this.routeParts = routeParts; + for (TransportStop s : forwardStops) { + if (s.isMissingStop()) { + return true; + } + } + return false; } public List getForwardStops() { diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 2a022fe6e3..7c948cf6e3 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -44,8 +44,8 @@ public class TransportRoutePlanner { public List buildRoute(TransportRoutingContext ctx, LatLon start, LatLon end) throws IOException, InterruptedException { ctx.startCalcTime = System.currentTimeMillis(); - List startStops = ctx.getTransportStops(start, true, false); - List endStops = ctx.getTransportStops(end, true, false); + List startStops = ctx.getTransportStops(start); + List endStops = ctx.getTransportStops(end); TLongObjectHashMap endSegments = new TLongObjectHashMap(); for(TransportRouteSegment s : endStops) { @@ -120,7 +120,7 @@ public class TransportRoutePlanner { break; } sgms.clear(); - sgms = ctx.getTransportStops(stop.x31, stop.y31, true, sgms, true, stop.isMissingStop()); + sgms = ctx.getTransportStops(stop.x31, stop.y31, true, sgms); ctx.visitedStops++; for (TransportRouteSegment sgm : sgms) { if (ctx.calculationProgress != null && ctx.calculationProgress.isCancelled) { @@ -745,22 +745,20 @@ public class TransportRoutePlanner { } } - public List getTransportStops(LatLon loc, boolean completeRoutes, boolean missingStop) throws IOException { + public List getTransportStops(LatLon loc) throws IOException { int y = MapUtils.get31TileNumberY(loc.getLatitude()); int x = MapUtils.get31TileNumberX(loc.getLongitude()); - return getTransportStops(x, y, false, new ArrayList(), completeRoutes, missingStop); + return getTransportStops(x, y, false, new ArrayList()); } - public List getTransportStops(int x, int y, boolean change, List res, boolean completeRoutes, boolean missingStop) throws IOException { - return loadNativeTransportStops(x, y, change, res, completeRoutes, missingStop); + public List getTransportStops(int x, int y, boolean change, List res) throws IOException { + return loadNativeTransportStops(x, y, change, res); } - private List loadNativeTransportStops(int sx, int sy, boolean change, List res, boolean completeRoutes, boolean missingStop) throws IOException { + private List loadNativeTransportStops(int sx, int sy, boolean change, List res) throws IOException { long nanoTime = System.nanoTime(); int d = change ? walkChangeRadiusIn31 : walkRadiusIn31; - if (missingStop) { - d = missingStopRadiusIn31; - } + int lx = (sx - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); int rx = (sx + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); int ty = (sy - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); @@ -770,7 +768,7 @@ public class TransportRoutePlanner { long tileId = (((long)x) << (cfg.ZOOM_TO_LOAD_TILES + 1)) + y; List list = quadTree.get(tileId); if(list == null) { - list = loadTile(x, y, completeRoutes); + list = loadTile(x, y); quadTree.put(tileId, list); } for(TransportRouteSegment r : list) { @@ -790,7 +788,7 @@ public class TransportRoutePlanner { } - private List loadTile(int x, int y, boolean completeRoutes) throws IOException { + private List loadTile(int x, int y) throws IOException { long nanoTime = System.nanoTime(); List lst = new ArrayList(); int pz = (31 - cfg.ZOOM_TO_LOAD_TILES); @@ -946,8 +944,7 @@ public class TransportRoutePlanner { } return c; } - - + private TransportRoute combineRoute(TransportRoute route, String fileName) throws IOException { //1.Get all available route parts; List result = new ArrayList<>(findIncompleteRouteParts(route)); @@ -955,6 +952,7 @@ public class TransportRoutePlanner { //2. Get massive of segments: List> segments = parseRoutePartsToSegments(result); + //TODO check for api? reversed works only from 24th Collections.sort(segments, compareSegsBySize.reversed()); //3. Merge segments and remove excess missingStops (when they are closer then MISSING_STOP_SEARCH_RADIUS): @@ -988,7 +986,6 @@ public class TransportRoutePlanner { private List> combineSegments(List> segments) { List> rawSegments = segments; - List> partsToDelete = new ArrayList>(); List> partsToReturn = new ArrayList>(); List base; From 3dde2ab020f4473ab9477ec6875104070a19eb5a Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 15 May 2020 15:12:48 +0300 Subject: [PATCH 48/91] Remove parking from favourites after clearing prefs --- .../net/osmand/plus/parkingpoint/ParkingPositionPlugin.java | 5 ++++- .../parkingpoint/ParkingTypeBottomSheetDialogFragment.java | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java index 8b38d111e5..02f5f3df15 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java @@ -132,6 +132,10 @@ public class ParkingPositionPlugin extends OsmandPlugin { parkingEvent.resetToDefault(); parkingStartTime.resetToDefault(); parkingPosition = null; + FavouritePoint pnt = app.getFavorites().getSpecialPoint(SpecialPointType.PARKING); + if (pnt != null) { + app.getFavorites().deleteFavourite(pnt); + } return true; } @@ -372,7 +376,6 @@ public class ParkingPositionPlugin extends OsmandPlugin { } else { addOrRemoveParkingEvent(false); } - app.getFavorites().setSpecialPoint(getParkingPosition(), SpecialPointType.PARKING, null); showContextMenuIfNeeded(mapActivity, false); } }); diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java index 0c1ba98b9a..ae819b460c 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingTypeBottomSheetDialogFragment.java @@ -72,10 +72,10 @@ public class ParkingTypeBottomSheetDialogFragment extends MenuBottomSheetDialogF plugin.setParkingPosition(latitude, longitude, false); plugin.showContextMenuIfNeeded(mapActivity, true); - mapActivity.getMyApplication().getFavorites().setSpecialPoint( - plugin.getParkingPosition(), SpecialPointType.PARKING, null); mapActivity.refreshMap(); } + mapActivity.getMyApplication().getFavorites().setSpecialPoint( + plugin.getParkingPosition(), SpecialPointType.PARKING, null); } dismiss(); } From e8cfe3fd8baa9fa126cfdcdb9695dc4feeb67edd Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 15 May 2020 15:27:37 +0300 Subject: [PATCH 49/91] set PT to safemode (java) by default for now --- OsmAnd/src/net/osmand/plus/AppInitializer.java | 3 ++- OsmAnd/src/net/osmand/plus/OsmandSettings.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 663e0dad42..4f99076c8c 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -756,7 +756,8 @@ public class AppInitializer implements IProgress { // native depends on renderers initNativeCore(); notifyEvent(InitEvents.NATIVE_INITIALIZED); - + //delete in next release: + app.osmandSettings.PT_SAFE_MODE.set(true); app.favorites.loadFavorites(); app.gpxDbHelper.loadGpxItems(); notifyEvent(InitEvents.FAVORITES_INITIALIZED); diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 0e94aefd4e..613102f7d3 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -3780,7 +3780,7 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name public final OsmandPreference SAFE_MODE = new BooleanPreference("safe_mode", false).makeGlobal(); - public final OsmandPreference PT_SAFE_MODE = new BooleanPreference("pt_safe_mode", false).makeGlobal(); + public final OsmandPreference PT_SAFE_MODE = new BooleanPreference("pt_safe_mode", true).makeGlobal(); public final OsmandPreference NATIVE_RENDERING_FAILED = new BooleanPreference("native_rendering_failed_init", false).makeGlobal(); public final OsmandPreference USE_OPENGL_RENDER = new BooleanPreference("use_opengl_render", From a22c14551b17b628679b8533367c3d53cf35f0d7 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Fri, 15 May 2020 14:34:25 +0200 Subject: [PATCH 50/91] Update AppInitializer.java --- OsmAnd/src/net/osmand/plus/AppInitializer.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 4f99076c8c..0fc7fc6d9b 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -756,8 +756,6 @@ public class AppInitializer implements IProgress { // native depends on renderers initNativeCore(); notifyEvent(InitEvents.NATIVE_INITIALIZED); - //delete in next release: - app.osmandSettings.PT_SAFE_MODE.set(true); app.favorites.loadFavorites(); app.gpxDbHelper.loadGpxItems(); notifyEvent(InitEvents.FAVORITES_INITIALIZED); From 26291e48f5f77b271244a1990360f49f5935ceae Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 15 May 2020 16:13:50 +0300 Subject: [PATCH 51/91] Fix ru string --- OsmAnd/res/values-ru/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index d241185a34..241def947f 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -2367,7 +2367,7 @@ Редактировать линию Добавить точку перед Добавить точку после - Функции + Опции OsmAnd соединит точки с маршрутом для выбранного профиля. Сохранить точки, как точки маршрута или как линию. Выберите профиль навигации From 2063c9442a5a1f7d330e539b9356a27168cbd81f Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 15 May 2020 17:08:09 +0300 Subject: [PATCH 52/91] Replace icon for City and Village --- OsmAnd/res/drawable/ic_action_village.xml | 34 +++++++++++++++++++ .../search/listitems/QuickSearchListItem.java | 4 +-- .../sample1/search/QuickSearchListItem.java | 4 +-- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 OsmAnd/res/drawable/ic_action_village.xml diff --git a/OsmAnd/res/drawable/ic_action_village.xml b/OsmAnd/res/drawable/ic_action_village.xml new file mode 100644 index 0000000000..dd841a5ba6 --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_village.xml @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/OsmAnd/src/net/osmand/plus/search/listitems/QuickSearchListItem.java b/OsmAnd/src/net/osmand/plus/search/listitems/QuickSearchListItem.java index 9965f6a880..52ceef46e2 100644 --- a/OsmAnd/src/net/osmand/plus/search/listitems/QuickSearchListItem.java +++ b/OsmAnd/src/net/osmand/plus/search/listitems/QuickSearchListItem.java @@ -313,9 +313,9 @@ public class QuickSearchListItem { int iconId = -1; switch (searchResult.objectType) { case CITY: - return getIcon(app, R.drawable.ic_action_building_number); + return getIcon(app, R.drawable.ic_action_building2); case VILLAGE: - return getIcon(app, R.drawable.ic_action_home_dark); + return getIcon(app, R.drawable.ic_action_village); case POSTCODE: case STREET: return getIcon(app, R.drawable.ic_action_street_name); diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchListItem.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchListItem.java index 5de85a803d..0cc06035e1 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchListItem.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchListItem.java @@ -253,9 +253,9 @@ public class QuickSearchListItem { int iconId; switch (searchResult.objectType) { case CITY: - return app.getIconsCache().getIcon("ic_action_building_number", R.color.osmand_orange); + return app.getIconsCache().getIcon("ic_action_building2", R.color.osmand_orange); case VILLAGE: - return app.getIconsCache().getIcon("ic_action_home_dark", R.color.osmand_orange); + return app.getIconsCache().getIcon("ic_action_village", R.color.osmand_orange); case POSTCODE: case STREET: return app.getIconsCache().getIcon("ic_action_street_name", R.color.osmand_orange); From a104b697222f210a91fa1ad37f2d02128f962cb0 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 15 May 2020 17:13:49 +0300 Subject: [PATCH 53/91] Add night version icon for A/V notes plugin recording state --- .../src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index 8144059a39..707b5dea8f 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -748,7 +748,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { cachedRecording = recording; if (recording) { setText(app.getString(R.string.shared_string_control_stop), null); - setIcons(R.drawable.widget_icon_av_active, R.drawable.widget_icon_av_active); + setIcons(R.drawable.widget_icon_av_active, R.drawable.widget_icon_av_active_night); } else { setText(app.getString(R.string.shared_string_control_start), null); Integer action = AV_DEFAULT_ACTION.get(); From 93829e1a0cb99c093cc2d15d79bbc45facfd5ce9 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Fri, 15 May 2020 16:35:06 +0200 Subject: [PATCH 54/91] Update FavouritePoint.java --- OsmAnd/src/net/osmand/data/FavouritePoint.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/data/FavouritePoint.java b/OsmAnd/src/net/osmand/data/FavouritePoint.java index 29a852a1ea..e64e185113 100644 --- a/OsmAnd/src/net/osmand/data/FavouritePoint.java +++ b/OsmAnd/src/net/osmand/data/FavouritePoint.java @@ -293,7 +293,7 @@ public class FavouritePoint implements Serializable, LocationPoint { OsmandApplication app = (OsmandApplication) ctx.getApplicationContext(); OsmandPreference parkingType = app.getSettings().getPreference(ParkingPositionPlugin.PARKING_TYPE); if (parkingType instanceof BooleanPreference && ((BooleanPreference) parkingType).get()) { - return R.drawable.mm_special_parking_time_limited; + return R.drawable.mx_special_parking_time_limited; } return iconId; } @@ -396,4 +396,4 @@ public class FavouritePoint implements Serializable, LocationPoint { } return pt; } -} \ No newline at end of file +} From 0c21e52a7890eb028e0574f43da52396a90f5fd3 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Fri, 15 May 2020 17:38:04 +0300 Subject: [PATCH 55/91] Fix phrases --- OsmAnd/res/values-ru/phrases.xml | 2 +- OsmAnd/res/values/phrases.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 5817148f0d..2485e29579 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -1403,7 +1403,7 @@ Ремонт мотоциклов Самообслуживание Да - Самообслуживание: отсутствует + Нет Автоматизация Есть Без автоматизации diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 10b539b5c1..a4cdd9fa9d 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -1850,7 +1850,7 @@ Repair of electrical vehicles Motorcycle repair Yes - No self-service + No Yes Not automated Full service From 87f49ed3d9845e806dbd8c20b2cd19cf8d4b4e88 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 15 May 2020 17:27:59 +0200 Subject: [PATCH 56/91] Transport route --- .../osmand/router/TransportRoutePlanner.java | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 7c948cf6e3..db1b35ebf6 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -13,14 +13,10 @@ import java.util.Map; import java.util.PriorityQueue; import gnu.trove.iterator.TIntIterator; -import gnu.trove.iterator.TIntObjectIterator; import gnu.trove.list.array.TIntArrayList; -import gnu.trove.map.TIntObjectMap; import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.map.hash.TLongObjectHashMap; - import net.osmand.NativeLibrary; -import net.osmand.binary.BinaryIndexPart; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.SearchRequest; import net.osmand.data.IncompleteTransportRoute; @@ -32,7 +28,6 @@ import net.osmand.data.TransportStop; import net.osmand.data.TransportStopExit; import net.osmand.osm.edit.Node; import net.osmand.osm.edit.Way; -import net.osmand.util.Algorithms; import net.osmand.util.MapUtils; public class TransportRoutePlanner { @@ -822,10 +817,11 @@ public class TransportRoutePlanner { } if (rrs != null && !multifileStop.isDeleted()) { for (int rr : rrs) { - // here we should assign only complete routes: TransportRoute route = localFileRoutes.get(rr); if (route == null) { - System.err.println(String.format("Something went wrong by loading combined route %d for stop %s", route.getId(), stop)); + System.err.println( + String.format("Something went wrong by loading combined route %d for stop %s", + rr, stop)); } else { TransportRoute combinedRoute = getCombinedRoute(route, r.getFile().getName()); if (combinedRoute == null) { @@ -946,25 +942,24 @@ public class TransportRoutePlanner { } private TransportRoute combineRoute(TransportRoute route, String fileName) throws IOException { - //1.Get all available route parts; + // 1. Get all available route parts; List result = new ArrayList<>(findIncompleteRouteParts(route)); List allWays = getAllWays(result); //TODO check ways for right order? Artifacts during drawing. - //2. Get massive of segments: + // 2. Get array of segments: List> segments = parseRoutePartsToSegments(result); - //TODO check for api? reversed works only from 24th - Collections.sort(segments, compareSegsBySize.reversed()); + Collections.sort(segments, compareSegsBySize); - //3. Merge segments and remove excess missingStops (when they are closer then MISSING_STOP_SEARCH_RADIUS): - //4. Check for missingStops. If they present in the middle/there more then one segment - we have a hole in the map data + // 3. Merge segments and remove excess missingStops (when they are closer then MISSING_STOP_SEARCH_RADIUS): + // 4. Check for missingStops. If they present in the middle/there more then one segment - we have a hole in the map data List> mergedSegments = combineSegments(segments); - //5. Create combined TransportRoute and return it - if (mergedSegments.size() > 1) { - //TODO sort incomplete routes (and remove missingStops) and merge into one? - return null; - } else { + // 5. Create combined TransportRoute and return it + if (mergedSegments.size() > 1 || mergedSegments.size() == 0) { + // TODO sort incomplete routes (and remove missingStops) and merge into one? + return route; + } else { return new TransportRoute(route, mergedSegments.get(0), allWays); } } @@ -978,8 +973,8 @@ public class TransportRoutePlanner { } Comparator> compareSegsBySize = new Comparator>() { - public int compare(List s1, List s2) { - return ((Integer)s1.size()).compareTo((Integer)s2.size()); + public int compare(List s1, List s2) { + return -Integer.compare(s1.size(), s2.size()); } }; From df9c761a5e5c146f066083b366f3a075362c8155 Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Fri, 15 May 2020 14:14:04 +0000 Subject: [PATCH 57/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3803 of 3803 strings) --- OsmAnd/res/values-pt-rBR/phrases.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-pt-rBR/phrases.xml b/OsmAnd/res/values-pt-rBR/phrases.xml index a14bb519bb..5cef6496c9 100644 --- a/OsmAnd/res/values-pt-rBR/phrases.xml +++ b/OsmAnd/res/values-pt-rBR/phrases.xml @@ -1519,7 +1519,7 @@ Sim Não automatizado Serviço completo - Lavação de carro: não + Não Estação de combustível de aeronaves Banho público Masculino From c97d14ffd8c41fd26f51fae67afca51bc0f89750 Mon Sep 17 00:00:00 2001 From: solokot Date: Fri, 15 May 2020 08:34:33 +0000 Subject: [PATCH 58/91] Translated using Weblate (Russian) Currently translated at 99.5% (3784 of 3803 strings) --- OsmAnd/res/values-ru/phrases.xml | 33 +++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 5817148f0d..2e158a3c66 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -1411,7 +1411,7 @@ Бесконтактная Да Контактная - Без автомойки + Нет Общественная баня Для мужчин Не для мужчин @@ -3736,8 +3736,8 @@ Тип 2 Тип 1 комбинированный Доступ для автодомов - Неправильный - Примитивный + Неправильное + Примитивное Тип стенда Стенд URL @@ -3765,4 +3765,31 @@ Сигнал для поиска полюса Многоуровневые маршруты: нет Многоуровневые маршруты: есть + Взрывной залп: вторая или более поздняя детонация залпового теста + Подземные воды + Сухой + Мокрый + Куча + Расположение: на крыше + Место отстоя судов + Контрастное + Низкое + Среднее + Высокое + Низкое + Среднее + Высокое + Низкое + Среднее + Высокое + Низкое + Среднее + Высокое + Низкое + Среднее + Высокое + Низкое + Среднее + Высокое + Давление \ No newline at end of file From 99503fdec5b1a6139bde6af4707d776779a33c78 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 16:03:54 +0200 Subject: [PATCH 59/91] Update transport rotues --- .../osmand/binary/BinaryMapIndexReader.java | 1 - .../BinaryMapTransportReaderAdapter.java | 16 ++-- .../osmand/data/IncompleteTransportRoute.java | 31 +++++--- .../java/net/osmand/data/TransportRoute.java | 3 +- .../java/net/osmand/osm/edit/Relation.java | 17 ++++- .../osmand/router/TransportRoutePlanner.java | 76 ++++++++----------- 6 files changed, 73 insertions(+), 71 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java index b3f4a5ea22..3474affe41 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -19,7 +19,6 @@ import net.osmand.binary.BinaryMapPoiReaderAdapter.PoiRegion; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteSubregion; import net.osmand.binary.BinaryMapTransportReaderAdapter.TransportIndex; -import net.osmand.binary.OsmandOdb.IncompleteTransportRoute; import net.osmand.binary.OsmandOdb.MapDataBlock; import net.osmand.binary.OsmandOdb.OsmAndMapIndex.MapDataBox; import net.osmand.binary.OsmandOdb.OsmAndMapIndex.MapEncodingRule; diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java index 62ffe1af07..13d9732f7b 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java @@ -1,20 +1,16 @@ package net.osmand.binary; import java.io.IOException; -import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; -import java.util.List; import java.util.Map; import com.google.protobuf.CodedInputStream; import com.google.protobuf.WireFormat; -import gnu.trove.list.array.TLongArrayList; import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.map.hash.TLongObjectHashMap; import net.osmand.binary.BinaryMapIndexReader.SearchRequest; -import net.osmand.binary.OsmandOdb.IncompleteTransportRoute; import net.osmand.data.TransportSchedule; import net.osmand.data.TransportStop; import net.osmand.data.TransportStopExit; @@ -261,8 +257,6 @@ public class BinaryMapTransportReaderAdapter { private void readIncompleteRoutesList(TLongObjectHashMap incompleteRoutes, int length, int offset, TIntObjectHashMap stringTable) throws IOException { codedIS.seek(offset); - - List irs = new ArrayList<>(); boolean end = false; while (!end) { int t = codedIS.readTag(); @@ -275,7 +269,12 @@ public class BinaryMapTransportReaderAdapter { int l = codedIS.readRawVarint32(); int olds = codedIS.pushLimit(l); net.osmand.data.IncompleteTransportRoute ir = readIncompleteRoute(stringTable); - incompleteRoutes.put(ir.getRouteId(), ir); + net.osmand.data.IncompleteTransportRoute itr = incompleteRoutes.get(ir.getRouteId()); + if(itr != null) { + itr.setNextLinkedRoute(ir); + } else { + incompleteRoutes.put(ir.getRouteId(), ir); + } codedIS.popLimit(olds); break; default: @@ -316,7 +315,7 @@ public class BinaryMapTransportReaderAdapter { // dataObject.setType(regStr(stringTable)); break; case OsmandOdb.IncompleteTransportRoute.MISSINGSTOPS_FIELD_NUMBER : -//// dataObject.getMissingStops().add(codedIS.readSInt32()); //skip for now +// dataObject.getMissingStops().add(codedIS.readSInt32()); //skip for now skipUnknownField(t); break; default: @@ -482,7 +481,6 @@ public class BinaryMapTransportReaderAdapter { codedIS.seek(ind.stringTable.fileOffset); int oldLimit = codedIS.pushLimit(ind.stringTable.length); int current = 0; - int i = 0; while (codedIS.getBytesUntilLimit() > 0) { int t = codedIS.readTag(); int tag = WireFormat.getTagFieldNumber(t); diff --git a/OsmAnd-java/src/main/java/net/osmand/data/IncompleteTransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/IncompleteTransportRoute.java index eb84be3453..84be533a5f 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/IncompleteTransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/IncompleteTransportRoute.java @@ -1,50 +1,59 @@ package net.osmand.data; -import gnu.trove.list.array.TIntArrayList; - public class IncompleteTransportRoute { private long routeId; private int routeOffset = -1; private String operator; private String type; private String ref; -// private TIntArrayList missingStops; //not needed + private IncompleteTransportRoute nextLinkedRoute; + + public IncompleteTransportRoute getNextLinkedRoute() { + return nextLinkedRoute; + } + + public void setNextLinkedRoute(IncompleteTransportRoute nextLinkedRoute) { + this.nextLinkedRoute = nextLinkedRoute; + } + public long getRouteId() { return routeId; } + public void setRouteId(long routeId) { this.routeId = routeId; } + public int getRouteOffset() { return routeOffset; } + public void setRouteOffset(int routeOffset) { this.routeOffset = routeOffset; } + public String getOperator() { return operator; } + public void setOperator(String operator) { this.operator = operator; } + public String getType() { return type; } + public void setType(String type) { this.type = type; } + public String getRef() { return ref; } + public void setRef(String ref) { this.ref = ref; } -// public TIntArrayList getMissingStops() { -// return missingStops; -// } -// public void setMissingStops(TIntArrayList missingStops) { -// this.missingStops = missingStops; -// } - - + } \ No newline at end of file diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java index 11900aee9f..b0df8f2adf 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java @@ -27,7 +27,6 @@ public class TransportRoute extends MapObject { private TransportSchedule schedule; public static final double SAME_STOP = 40; private boolean combined = false; - private List routeParts = new ArrayList(); public TransportRoute() { } @@ -45,7 +44,7 @@ public class TransportRoute extends MapObject { this.combined = true; this.forwardStops = mergedSegment; this.dist = calculateDistance(); - this.forwardWays = ways; //TODO check + this.forwardWays = ways; } public TransportSchedule getSchedule() { diff --git a/OsmAnd-java/src/main/java/net/osmand/osm/edit/Relation.java b/OsmAnd-java/src/main/java/net/osmand/osm/edit/Relation.java index 6531eb8def..1e3443af19 100644 --- a/OsmAnd-java/src/main/java/net/osmand/osm/edit/Relation.java +++ b/OsmAnd-java/src/main/java/net/osmand/osm/edit/Relation.java @@ -54,10 +54,14 @@ public class Relation extends Entity { } public void addMember(Long id, EntityType type, String role){ + addMember(new EntityId(type, id), role); + } + + public void addMember(EntityId id, String role){ if(members == null){ members = new ArrayList<>(); } - members.add(new RelationMember(new EntityId(type, id), role)); + members.add(new RelationMember(id, role)); } public List getMembers(String role) { @@ -115,7 +119,16 @@ public class Relation extends Entity { public LatLon getLatLon() { return null; } - + + public void update(RelationMember r, EntityId newEntityId) { + r.entity = null; + r.entityId = newEntityId; + } + + public void updateRole(RelationMember r, String newRole) { + r.role = newRole; + } + public boolean remove(EntityId key) { if(members != null) { Iterator it = members.iterator(); diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index db1b35ebf6..4fc7f69141 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -823,7 +823,7 @@ public class TransportRoutePlanner { String.format("Something went wrong by loading combined route %d for stop %s", rr, stop)); } else { - TransportRoute combinedRoute = getCombinedRoute(route, r.getFile().getName()); + TransportRoute combinedRoute = getCombinedRoute(route); if (combinedRoute == null) { System.err.println(String.format("Something went wrong by loading combined route %d for stop %s", route.getId(), stop)); } else if (multifileStop == stop || @@ -928,26 +928,30 @@ public class TransportRoutePlanner { return stops; } - private TransportRoute getCombinedRoute(TransportRoute route, String fileName) throws IOException { + private TransportRoute getCombinedRoute(TransportRoute route) throws IOException { if (!route.isIncomplete()) { return route; } TransportRoute c = combinedRoutesCache.get(route.getId()); if (c == null) { - c = combineRoute(route, fileName); - + c = combineRoute(route); combinedRoutesCache.put(route.getId(), c); } return c; } - private TransportRoute combineRoute(TransportRoute route, String fileName) throws IOException { + private TransportRoute combineRoute(TransportRoute route) throws IOException { + // 1. Get all available route parts; - List result = new ArrayList<>(findIncompleteRouteParts(route)); - List allWays = getAllWays(result); //TODO check ways for right order? Artifacts during drawing. + List incompleteRoutes = findIncompleteRouteParts(route); + if (incompleteRoutes == null) { + return route; + } + + List allWays = getAllWays(incompleteRoutes); //TODO check ways for right order? Artifacts during drawing. // 2. Get array of segments: - List> segments = parseRoutePartsToSegments(result); + List> segments = parseRoutePartsToSegments(incompleteRoutes); Collections.sort(segments, compareSegsBySize); // 3. Merge segments and remove excess missingStops (when they are closer then MISSING_STOP_SEARCH_RADIUS): @@ -1156,48 +1160,28 @@ public class TransportRoutePlanner { return segs; } - - private Collection findIncompleteRouteParts(TransportRoute baseRoute) throws IOException { - IncompleteTransportRoute ptr; - TIntObjectHashMap res = new TIntObjectHashMap(); - //TODO search only routes from bbox? - for (BinaryMapIndexReader bmir: routeMap.keySet()) { - /** - * TODO: Should I check if those routes already loaded? But they shouldn't, - * else we will already had a combined route and never get there! - */ - ptr = bmir.getIncompleteRoutePointers(baseRoute.getId()); - if (ptr != null && ptr.getRouteOffset() != -1) { - res.putAll(bmir.getTransportRoutes(new int[] {ptr.getRouteOffset()})); + private List findIncompleteRouteParts(TransportRoute baseRoute) throws IOException { + List allRoutes = null; + // TODO completely irrelevant always reiteration over all maps + for (BinaryMapIndexReader bmir : routeMap.keySet()) { + IncompleteTransportRoute ptr = bmir.getIncompleteRoutePointers(baseRoute.getId()); + if (ptr != null) { + TIntArrayList lst = new TIntArrayList(); + while(ptr != null) { + lst.add(ptr.getRouteOffset()); + ptr = ptr.getNextLinkedRoute(); + } + if(lst.size() > 0) { + if(allRoutes == null) { + allRoutes = new ArrayList(); + } + allRoutes.addAll(bmir.getTransportRoutes(lst.toArray()).valueCollection()); + } } } - return res.valueCollection(); + return allRoutes; } - -// private TIntObjectHashMap getRouteParts(int x, int y) throws IOException { -// int pz = (31 - cfg.ZOOM_TO_LOAD_TILES); -// SearchRequest sr = BinaryMapIndexReader.buildSearchTransportRequest(x << pz, (x + 1) << pz, -// y << pz, (y + 1) << pz, -1, null); -// -// TLongObjectHashMap loadedTransportStops = new TLongObjectHashMap(); -// TIntObjectHashMap localFileRoutes = new TIntObjectHashMap<>(); -// TIntObjectHashMap res = new TIntObjectHashMap(); -// for (BinaryMapIndexReader r : routeMap.keySet()) { -// sr.clearSearchResults(); -// List stops = r.searchTransportIndex(sr); -// -// localFileRoutes.clear(); -// //search routes here: -// mergeTransportStops(r, loadedTransportStops, stops, localFileRoutes, routeMap.get(r)); -// if (!localFileRoutes.isEmpty()) { -// res.putAll(localFileRoutes); -// } -// } -// return res; -// } - - private void loadTransportSegments(Collection stops, List lst) throws IOException { for(TransportStop s : stops) { if (s.isDeleted() || s.getRoutes() == null) { From b456c41b341e7f1bd6c60c08abc4b0ab816770e6 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 16:33:59 +0200 Subject: [PATCH 60/91] Update transport rotues --- .../osmand/router/TransportRoutePlanner.java | 272 +++++++----------- 1 file changed, 100 insertions(+), 172 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 4fc7f69141..0143e17b64 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -8,10 +8,12 @@ import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.PriorityQueue; + import gnu.trove.iterator.TIntIterator; import gnu.trove.list.array.TIntArrayList; import gnu.trove.map.hash.TIntObjectHashMap; @@ -941,31 +943,33 @@ public class TransportRoutePlanner { } private TransportRoute combineRoute(TransportRoute route) throws IOException { - // 1. Get all available route parts; List incompleteRoutes = findIncompleteRouteParts(route); if (incompleteRoutes == null) { return route; } + // here could be multiple overlays between same points + // It's better to remove them especially identical segments + List allWays = getAllWays(incompleteRoutes); - List allWays = getAllWays(incompleteRoutes); //TODO check ways for right order? Artifacts during drawing. // 2. Get array of segments: - List> segments = parseRoutePartsToSegments(incompleteRoutes); - Collections.sort(segments, compareSegsBySize); + LinkedList> stopSegments = parseRoutePartsToSegments(incompleteRoutes); // 3. Merge segments and remove excess missingStops (when they are closer then MISSING_STOP_SEARCH_RADIUS): - // 4. Check for missingStops. If they present in the middle/there more then one segment - we have a hole in the map data - List> mergedSegments = combineSegments(segments); + // + Check for missingStops. If they present in the middle/there more then one segment - we have a hole in the map data + List> mergedSegments = combineSegmentsOfSameRoute(stopSegments); + // 4. Now we need to properly sort segments, proper sorting is minimizing distance between stops + // So it is salesman problem, we have this solution at TspAnt, but if we know last or first segment we can solve it straightforward - // 5. Create combined TransportRoute and return it - if (mergedSegments.size() > 1 || mergedSegments.size() == 0) { - // TODO sort incomplete routes (and remove missingStops) and merge into one? - return route; - } else { - return new TransportRoute(route, mergedSegments.get(0), allWays); + // TODO + List finalList = new ArrayList(); + for(List s : mergedSegments) { + finalList.addAll(s); } + // 5. Create combined TransportRoute and return it + return new TransportRoute(route, finalList, allWays); } private List getAllWays(List parts) { @@ -976,181 +980,105 @@ public class TransportRoutePlanner { return w; } - Comparator> compareSegsBySize = new Comparator>() { - public int compare(List s1, List s2) { - return -Integer.compare(s1.size(), s2.size()); - } - }; - private List> combineSegments(List> segments) { - List> rawSegments = segments; - - List> partsToDelete = new ArrayList>(); - List> partsToReturn = new ArrayList>(); - List base; - int startSize = 0; - - Iterator> segItr = rawSegments.iterator(); - while (segItr.hasNext()) { - startSize = rawSegments.size(); - partsToDelete.clear(); - partsToReturn.clear(); - base = segItr.next(); - segItr.remove(); - - TransportStop firstStopMissing = base.get(0).isMissingStop() ? base.get(0) : null; - TransportStop lastStopMissing = base.get(base.size() - 1).isMissingStop() ? base.get(base.size() - 1) - : null; - - for (int i = 0; i < segments.size(); i++) { - // compare every other piece of route with base (largest part so far) - // and if it has common stops or close missing stops try to combine - List candidate = rawSegments.get(i); - TransportStop cmss = candidate.get(0).isMissingStop() ? candidate.get(0) : null; - TransportStop cmse = candidate.get(candidate.size() - 1).isMissingStop() - ? candidate.get(candidate.size() - 1) - : null; - int csStopCount = candidate.size(); - if (cmss != null) { - csStopCount--; - } - if (cmse != null) { - csStopCount--; - } - int csSameStopsCount = 0; - for (TransportStop s : base) { - if (!s.isMissingStop()) { - for (TransportStop cs : candidate) { - if (!cs.isMissingStop() && s.getId().equals(cs.getId())) { - csSameStopsCount++; - } - } - } - } - if (csStopCount == csSameStopsCount) { - // all stops of candidate inside base, delete candidate - partsToDelete.add(candidate); - continue; - - } else { - if (csSameStopsCount > 0 && firstStopMissing != null && lastStopMissing == null - && cmse != null) { - // parts intersecting and we know what sides to connect, attach to start - base = mergeSegments(base, candidate, false); - - } else if (csSameStopsCount > 0 && lastStopMissing != null && firstStopMissing == null - && cmss != null) { - // parts intersecting and we know what sides to connect, attach to end - base = mergeSegments(base, candidate, true); - - } else { - // check for missing stops in candidate and attach accordingly - double distStartToEnd = MISSING_STOP_SEARCH_RADIUS + 1; - double distEndToStart = MISSING_STOP_SEARCH_RADIUS + 1; - if (cmss != null && lastStopMissing != null) { - distStartToEnd = MapUtils.getDistance(cmss.getLocation(), - lastStopMissing.getLocation()); - } - if (cmse != null && firstStopMissing != null) { - distEndToStart = MapUtils.getDistance(cmse.getLocation(), - firstStopMissing.getLocation()); - } - if (distStartToEnd < distEndToStart && distStartToEnd <= MISSING_STOP_SEARCH_RADIUS) { - base = mergeSegments(base, candidate, true); - } else if (distEndToStart < distStartToEnd && distEndToStart <= MISSING_STOP_SEARCH_RADIUS) { - base = mergeSegments(base, candidate, false); - } else { - if (csSameStopsCount == 0) { - // it's OK, we should look for other parts first - partsToReturn.add(candidate); - System.out.println("Candidate is not connected to Base, continue search"); - } else { - // it's not OK, if there is intersecting stops and too long distance between - // missingStops, there is some error in data - System.out.println("MERGING ERROR. THERE IS SOMETHING WRONG WITH DATA"); - } - } - } - partsToDelete.add(candidate); - } - } - for (List p : partsToDelete) { - rawSegments.remove(p); - } - rawSegments.addAll(partsToReturn); - rawSegments.add(base); - //Check if all is merged: - if (rawSegments.size() == 1) { - break; - } - //If we still have several segments, but after iteration they number didn't dwindle, - //check if we still could merge some of them or do we have a hole in the data - boolean hasValidCandidate = false; - if (rawSegments.size() == startSize) { - for (int i = 0; i < rawSegments.size()-1; i++) { - TransportStop ms = rawSegments.get(i).get(0).isMissingStop() ? rawSegments.get(i).get(0) : null; - TransportStop me = rawSegments.get(i).get(rawSegments.get(i).size()-1).isMissingStop() - ? rawSegments.get(i).get(rawSegments.get(i).size()-1) : null; - for (int j = 1; j < rawSegments.size(); j++) { - TransportStop cms = rawSegments.get(j).get(0).isMissingStop() ? rawSegments.get(j).get(0) : null; - TransportStop cme = rawSegments.get(j).get(rawSegments.get(j).size()-1).isMissingStop() - ? rawSegments.get(j).get(rawSegments.get(j).size()-1) : null; - if (ms != null && cme != null && MapUtils.getDistance(ms.getLocation(), cme.getLocation()) <= MISSING_STOP_SEARCH_RADIUS) { - hasValidCandidate = true; - } - if (me != null && cms != null && MapUtils.getDistance(me.getLocation(), cms.getLocation()) <= MISSING_STOP_SEARCH_RADIUS) { - hasValidCandidate = true; - } - //we has at least one valid pair of segments for merging - if (hasValidCandidate) { - break; - } + + private List> combineSegmentsOfSameRoute(LinkedList> segments) { + List> resultSegments = new ArrayList>(); + while (!segments.isEmpty()) { + List firstSegment = segments.poll(); + boolean merged = true; + while (merged) { + merged = false; + Iterator> it = segments.iterator(); + while (it.hasNext()) { + List segmentToMerge = it.next(); + merged = tryToMerge(firstSegment, segmentToMerge); + if (merged) { + it.remove(); + break; } } } - //if we could not merge any more segments - break; - if (rawSegments.size() == 1 || (rawSegments.size() == startSize && !hasValidCandidate)) { - break; + resultSegments.add(firstSegment); + } + return resultSegments; + } + + private boolean tryToMerge(List firstSegment, List segmentToMerge) { + if(firstSegment.size() < 2 || segmentToMerge.size() < 2) { + return false; + } + // 1st we check that segments overlap by stop + int commonStopFirst = 0; + int commonStopSecond = 0; + for(;commonStopFirst < firstSegment.size(); commonStopFirst++) { + for(; commonStopSecond < segmentToMerge.size(); commonStopSecond++ ) { + long lid1 = firstSegment.get(commonStopFirst).getId(); + long lid2 = segmentToMerge.get(commonStopSecond).getId(); + if(lid1 > 0 && lid2 == lid1) { + break; + } } } - return rawSegments; + if(commonStopFirst < firstSegment.size()) { + // we've found common stop so we can merge based on stops + // merge last part first + if(firstSegment.size() - commonStopFirst < segmentToMerge.size() - commonStopSecond) { + while(firstSegment.size() > commonStopFirst) { + firstSegment.remove(firstSegment.size() - 1); + } + for(int i = commonStopSecond; i < segmentToMerge.size(); i++) { + firstSegment.add(segmentToMerge.get(i)); + } + } + // merge first part + if(commonStopFirst < commonStopSecond) { + for(int i = 0; i < commonStopFirst; i++) { + firstSegment.remove(0); + } + for(int i = commonStopSecond; i >= 0; i--) { + firstSegment.add(0, segmentToMerge.get(i)); + } + } + return true; + + } + // no common stops, so try to connect to the end or beginning + // beginning + boolean merged = false; + if (MapUtils.getDistance(firstSegment.get(0).getLocation(), + segmentToMerge.get(segmentToMerge.size() - 1).getLocation()) < MISSING_STOP_SEARCH_RADIUS) { + firstSegment.remove(0); + for(int i = segmentToMerge.size() - 2; i >= 0; i--) { + firstSegment.add(0, segmentToMerge.get(i)); + } + merged = true; + } else if(MapUtils.getDistance(firstSegment.get(firstSegment.size() - 1).getLocation(), + segmentToMerge.get(0).getLocation()) < MISSING_STOP_SEARCH_RADIUS) { + firstSegment.remove(firstSegment.size() - 1); + for(int i = 1; i < segmentToMerge.size(); i++) { + firstSegment.add(segmentToMerge.get(i)); + } + merged = true; + } + return merged; } + - private List mergeSegments(List base, List candidate, boolean forward) { - List result; - if (forward) { - result = new ArrayList<>(base.subList(0, base.size()-1)); - for (int i = 1; i < candidate.size(); i++) { - if (!result.contains(candidate.get(i))) { - result.add(candidate.get(i)); - } - } - } else { - result = new ArrayList<>(candidate.subList(0, candidate.size()-1)); - for (int i = 1; i < base.size(); i++) { - if (!result.contains(base.get(i))) { - result.add(base.get(i)); - } - } - } - return result; - } - private List> parseRoutePartsToSegments(List routeParts) { - List> segs = new ArrayList>(); + private LinkedList> parseRoutePartsToSegments(List routeParts) { + LinkedList> segs = new LinkedList>(); + // here we assume that missing stops come in pairs + // TODO check generation that are doubles for (TransportRoute part : routeParts) { - List newSeg = new ArrayList(); + List newSeg = new ArrayList(); for (TransportStop s : part.getForwardStops()) { + newSeg.add(s); if (s.isMissingStop()) { - if (newSeg.isEmpty()) { - newSeg.add(s); - } else { - newSeg.add(s); + if (!newSeg.isEmpty()) { segs.add(newSeg); newSeg = new ArrayList(); } - } else { - newSeg.add(s); } } if (!newSeg.isEmpty()) { From 52fec9c7cc46f8455b9e13a1c36ef5e04d813b66 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 16:48:01 +0200 Subject: [PATCH 61/91] Update transport rotues --- .../osmand/router/TransportRoutePlanner.java | 53 ++++++++++++++++--- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 0143e17b64..2bf64242ae 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -953,7 +953,7 @@ public class TransportRoutePlanner { List allWays = getAllWays(incompleteRoutes); - // 2. Get array of segments: + // 2. Get array of segments (each array size > 1): LinkedList> stopSegments = parseRoutePartsToSegments(incompleteRoutes); // 3. Merge segments and remove excess missingStops (when they are closer then MISSING_STOP_SEARCH_RADIUS): @@ -962,16 +962,57 @@ public class TransportRoutePlanner { // 4. Now we need to properly sort segments, proper sorting is minimizing distance between stops // So it is salesman problem, we have this solution at TspAnt, but if we know last or first segment we can solve it straightforward - - // TODO + List firstSegment = null; + List lastSegment = null; + for(List l : mergedSegments) { + if(!l.get(0).isMissingStop()) { + firstSegment = l; + } + if(!l.get(l.size() - 1).isMissingStop()) { + lastSegment = l; + } + } + List> sortedSegments = new ArrayList>(); + if(firstSegment != null) { + sortedSegments.add(firstSegment); + while(!mergedSegments.isEmpty()) { + List last = sortedSegments.get(sortedSegments.size() - 1); + List add = findAndDeleteMinDistance(last.get(last.size() - 1).getLocation(), mergedSegments, true); + sortedSegments.add(add); + } + + } else if(lastSegment != null) { + while(!mergedSegments.isEmpty()) { + List first = sortedSegments.get(0); + List add = findAndDeleteMinDistance(first.get(0).getLocation(), mergedSegments, false); + sortedSegments.add(0, add); + } + } else { + sortedSegments = mergedSegments; + } List finalList = new ArrayList(); - for(List s : mergedSegments) { + for(List s : sortedSegments) { finalList.addAll(s); } // 5. Create combined TransportRoute and return it return new TransportRoute(route, finalList, allWays); } + private List findAndDeleteMinDistance(LatLon location, List> mergedSegments, + boolean attachToBegin) { + int ind = attachToBegin ? 0 : mergedSegments.get(0).size() - 1; + double minDist = MapUtils.getDistance(mergedSegments.get(0).get(ind).getLocation(), location); + int minInd = 0; + for(int i = 1; i < mergedSegments.size(); i++) { + ind = attachToBegin ? 0 : mergedSegments.get(i).size() - 1; + double dist = MapUtils.getDistance(mergedSegments.get(i).get(ind).getLocation(), location); + if(dist < minDist) { + minInd = i; + } + } + return mergedSegments.remove(minInd); + } + private List getAllWays(List parts) { List w = new ArrayList(); for (TransportRoute t : parts) { @@ -1075,13 +1116,13 @@ public class TransportRoutePlanner { for (TransportStop s : part.getForwardStops()) { newSeg.add(s); if (s.isMissingStop()) { - if (!newSeg.isEmpty()) { + if (newSeg.size() > 1) { segs.add(newSeg); newSeg = new ArrayList(); } } } - if (!newSeg.isEmpty()) { + if (newSeg.size() > 1) { segs.add(newSeg); } } From e5bd6cb065ab46cdbf177773f7a90f8a8df2c67b Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 16:49:17 +0200 Subject: [PATCH 62/91] Update transport rotues --- .../src/main/java/net/osmand/router/TransportRoutePlanner.java | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 2bf64242ae..b4d59be05f 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -982,6 +982,7 @@ public class TransportRoutePlanner { } } else if(lastSegment != null) { + sortedSegments.add(lastSegment); while(!mergedSegments.isEmpty()) { List first = sortedSegments.get(0); List add = findAndDeleteMinDistance(first.get(0).getLocation(), mergedSegments, false); From 4873ab04a95af48214f5db6bcfe6d9accc12425b Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 16:51:51 +0200 Subject: [PATCH 63/91] Update transport rotues --- .../net/osmand/router/TransportRoutePlanner.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index b4d59be05f..1548bba2f3 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -803,13 +803,14 @@ public class TransportRoutePlanner { mergeTransportStops(r, loadedTransportStops, stops, localFileRoutes, routeMap.get(r)); for (TransportStop stop : stops) { - //skip missing stops + // skip missing stops if (stop.isMissingStop()) { continue; } long stopId = stop.getId(); TransportStop multifileStop = loadedTransportStops.get(stopId); int[] rrs = stop.getReferencesToRoutes(); + // TODO what is this? if (multifileStop == stop) { // clear up so it won't be used as it is multi file stop stop.setReferencesToRoutes(null); @@ -826,10 +827,7 @@ public class TransportRoutePlanner { rr, stop)); } else { TransportRoute combinedRoute = getCombinedRoute(route); - if (combinedRoute == null) { - System.err.println(String.format("Something went wrong by loading combined route %d for stop %s", route.getId(), stop)); - } else if (multifileStop == stop || - (!multifileStop.hasRoute(combinedRoute.getId()) && + if (multifileStop == stop || (!multifileStop.hasRoute(combinedRoute.getId()) && !multifileStop.isRouteDeleted(combinedRoute.getId()))) { // duplicates won't be added multifileStop.addRouteId(combinedRoute.getId()); @@ -853,16 +851,12 @@ public class TransportRoutePlanner { List stops, TIntObjectHashMap localFileRoutes, TIntObjectHashMap loadedRoutes -// boolean processMissingStop ) throws IOException { TIntArrayList routesToLoad = new TIntArrayList(); TIntArrayList localRoutesToLoad = new TIntArrayList(); Iterator it = stops.iterator(); while (it.hasNext()) { TransportStop stop = it.next(); -// if (stop.isMissingStop() && !processMissingStop) { -// continue; -// } long stopId = stop.getId(); localRoutesToLoad.clear(); TransportStop multifileStop = loadedTransportStops.get(stopId); From 7319a235c0c778c089c9b6b935d7e27f1ea2ffb8 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 17:12:34 +0200 Subject: [PATCH 64/91] Lazy loading reading --- .../osmand/binary/BinaryMapIndexReader.java | 26 +++++++++++-------- .../BinaryMapTransportReaderAdapter.java | 17 +++++------- .../osmand/router/TransportRoutePlanner.java | 4 +-- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java index 3474affe41..ae64660ea0 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -3,6 +3,7 @@ package net.osmand.binary; import com.google.protobuf.CodedInputStream; import com.google.protobuf.CodedOutputStream; +import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.WireFormat; import net.osmand.Collator; @@ -26,6 +27,7 @@ import net.osmand.binary.OsmandOdb.OsmAndMapIndex.MapRootLevel; import net.osmand.data.Amenity; import net.osmand.data.Building; import net.osmand.data.City; +import net.osmand.data.IncompleteTransportRoute; import net.osmand.data.LatLon; import net.osmand.data.MapObject; import net.osmand.data.Street; @@ -54,7 +56,6 @@ import java.io.InputStreamReader; import java.io.RandomAccessFile; import java.io.Reader; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -110,9 +111,7 @@ public class BinaryMapIndexReader { /*private*/ List transportIndexes = new ArrayList(); /*private*/ List routingIndexes = new ArrayList(); /*private*/ List indexes = new ArrayList(); - - private final TLongObjectHashMap incompleteRoutes = - new TLongObjectHashMap(); + TLongObjectHashMap incompleteTransportRoutes = null; protected CodedInputStream codedIS; @@ -227,7 +226,7 @@ public class BinaryMapIndexReader { ind.filePointer = codedIS.getTotalBytesRead(); if (transportAdapter != null) { oldLimit = codedIS.pushLimit(ind.length); - transportAdapter.readTransportIndex(ind, incompleteRoutes); + transportAdapter.readTransportIndex(ind); codedIS.popLimit(oldLimit); transportIndexes.add(ind); indexes.add(ind); @@ -2635,12 +2634,17 @@ public class BinaryMapIndexReader { } } - public net.osmand.data.IncompleteTransportRoute getIncompleteRoutePointers(long id) { - return incompleteRoutes.get(id); - } - - public Collection getIncompleteRoutes() { - return incompleteRoutes.valueCollection(); + public TLongObjectHashMap getIncompleteTransportRoutes() throws InvalidProtocolBufferException, IOException { + if (incompleteTransportRoutes == null) { + incompleteTransportRoutes = new TLongObjectHashMap<>(); + for (TransportIndex ti : transportIndexes) { + if (ti.incompleteRoutesLength > 0) { + transportAdapter.readIncompleteRoutesList(incompleteTransportRoutes, ti.incompleteRoutesLength, + ti.incompleteRoutesOffset); + } + } + } + return incompleteTransportRoutes; } diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java index 13d9732f7b..049fc161eb 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java @@ -83,7 +83,7 @@ public class BinaryMapTransportReaderAdapter { } - protected void readTransportIndex(TransportIndex ind, TLongObjectHashMap incompleteRoutes) throws IOException { + protected void readTransportIndex(TransportIndex ind) throws IOException { while(true){ int t = codedIS.readTag(); int tag = WireFormat.getTagFieldNumber(t); @@ -113,13 +113,9 @@ public class BinaryMapTransportReaderAdapter { codedIS.seek(st.length + st.fileOffset); break; case OsmandOdb.OsmAndTransportIndex.INCOMPLETEROUTES_FIELD_NUMBER : - TIntObjectHashMap stab = new TIntObjectHashMap(); ind.incompleteRoutesLength = codedIS.readRawVarint32(); ind.incompleteRoutesOffset = codedIS.getTotalBytesRead(); - int oldl = codedIS.pushLimit(ind.incompleteRoutesLength); - //may be we should start caching stringTable in advance? - readIncompleteRoutesList(incompleteRoutes, ind.incompleteRoutesLength, ind.incompleteRoutesOffset, stab); - codedIS.popLimit(oldl); + codedIS.seek(ind.incompleteRoutesLength + ind.incompleteRoutesOffset); break; default: @@ -128,6 +124,7 @@ public class BinaryMapTransportReaderAdapter { } } } + private void readTransportBounds(TransportIndex ind) throws IOException { while(true){ @@ -254,8 +251,8 @@ public class BinaryMapTransportReaderAdapter { return ((char) i)+""; } - private void readIncompleteRoutesList(TLongObjectHashMap incompleteRoutes, - int length, int offset, TIntObjectHashMap stringTable) throws IOException { + public void readIncompleteRoutesList(TLongObjectHashMap incompleteRoutes, + int length, int offset) throws IOException { codedIS.seek(offset); boolean end = false; while (!end) { @@ -268,7 +265,7 @@ public class BinaryMapTransportReaderAdapter { case OsmandOdb.IncompleteTransportRoutes.ROUTES_FIELD_NUMBER: int l = codedIS.readRawVarint32(); int olds = codedIS.pushLimit(l); - net.osmand.data.IncompleteTransportRoute ir = readIncompleteRoute(stringTable); + net.osmand.data.IncompleteTransportRoute ir = readIncompleteRoute(); net.osmand.data.IncompleteTransportRoute itr = incompleteRoutes.get(ir.getRouteId()); if(itr != null) { itr.setNextLinkedRoute(ir); @@ -286,7 +283,7 @@ public class BinaryMapTransportReaderAdapter { } - public net.osmand.data.IncompleteTransportRoute readIncompleteRoute(TIntObjectHashMap stringTable) throws IOException { + public net.osmand.data.IncompleteTransportRoute readIncompleteRoute() throws IOException { net.osmand.data.IncompleteTransportRoute dataObject = new net.osmand.data.IncompleteTransportRoute(); boolean end = false; while(!end){ diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 1548bba2f3..9ca8d2a609 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -1126,9 +1126,9 @@ public class TransportRoutePlanner { private List findIncompleteRouteParts(TransportRoute baseRoute) throws IOException { List allRoutes = null; - // TODO completely irrelevant always reiteration over all maps + // TODO completely irrelevant always reiteration over all maps (especially not in bbox of the route probabl) for (BinaryMapIndexReader bmir : routeMap.keySet()) { - IncompleteTransportRoute ptr = bmir.getIncompleteRoutePointers(baseRoute.getId()); + IncompleteTransportRoute ptr = bmir.getIncompleteTransportRoutes().get(baseRoute.getId()); if (ptr != null) { TIntArrayList lst = new TIntArrayList(); while(ptr != null) { From a52767bdb3a819d2eaad2255151f02311354889e Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 17:17:04 +0200 Subject: [PATCH 65/91] clean up --- .../java/net/osmand/data/TransportRoute.java | 34 ++++--------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java index b0df8f2adf..4fd2b7d03a 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java @@ -1,10 +1,5 @@ package net.osmand.data; -import net.osmand.osm.edit.Node; -import net.osmand.osm.edit.Way; -import net.osmand.util.Algorithms; -import net.osmand.util.MapUtils; - import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -12,9 +7,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import gnu.trove.list.array.TIntArrayList; -import gnu.trove.map.hash.TIntObjectHashMap; -import gnu.trove.map.hash.TLongObjectHashMap; +import net.osmand.osm.edit.Node; +import net.osmand.osm.edit.Way; +import net.osmand.util.Algorithms; +import net.osmand.util.MapUtils; public class TransportRoute extends MapObject { private List forwardStops = new ArrayList(); @@ -26,12 +22,11 @@ public class TransportRoute extends MapObject { private List forwardWays; private TransportSchedule schedule; public static final double SAME_STOP = 40; - private boolean combined = false; public TransportRoute() { } - public TransportRoute(TransportRoute r, List mergedSegment, List ways) { + public TransportRoute(TransportRoute r, List forwardStops, List forwardWay) { this.name = r.name; this.enName = r.enName; this.names = r.names; @@ -41,10 +36,8 @@ public class TransportRoute extends MapObject { this.type = r.type; this.color = r.color; this.schedule = r.schedule; - this.combined = true; - this.forwardStops = mergedSegment; - this.dist = calculateDistance(); - this.forwardWays = ways; + this.forwardStops = forwardStops; + this.forwardWays = forwardWay; } public TransportSchedule getSchedule() { @@ -58,19 +51,6 @@ public class TransportRoute extends MapObject { return schedule; } - public boolean isCombined() { - return combined; - } - - public Integer calculateDistance() { - int distance = 0; - for (int i = 0; i < forwardStops.size()-1; i++) { - if (!forwardStops.get(i).isMissingStop() || !forwardStops.get(i+1).isMissingStop()) - distance += MapUtils.getDistance(forwardStops.get(i).getLocation(), forwardStops.get(i+1).getLocation()); - } - return distance; - } - public boolean isIncomplete() { for (TransportStop s : forwardStops) { if (s.isMissingStop()) { From a00011693acdfa4aac0f04fd8557719a07256e29 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 17:18:58 +0200 Subject: [PATCH 66/91] clean up --- .../src/main/java/net/osmand/data/TransportStop.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportStop.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportStop.java index 48eb8e67f7..b7c3687b31 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportStop.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportStop.java @@ -12,6 +12,7 @@ import java.util.List; public class TransportStop extends MapObject { private static final int DELETED_STOP = -1; + public static final String MISSING_STOP_NAME = "#Missing Stop"; private int[] referencesToRoutes = null; private long[] deletedRoutesIds; @@ -22,7 +23,6 @@ public class TransportStop extends MapObject { private List exits; private List routes = null; private LinkedHashMap referencesToRoutesMap; - private boolean missingStop = false; private TransportStopAggregated transportStopAggregated; @@ -32,16 +32,8 @@ public class TransportStop extends MapObject { return routes; } - @Override - public void setName(String name) { - super.setName(name); - if (name != null && name.equals("#Missing Stop")) { - missingStop = true; - } - } - public boolean isMissingStop() { - return missingStop; + return MISSING_STOP_NAME.equals(getName()); } public LinkedHashMap getReferencesToRoutesMap() { From 15ce3fa998e7b65a3943ccef337e141a7fec0944 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 19:57:11 +0200 Subject: [PATCH 67/91] Add incomplete stops to cached indexes --- .../osmand/binary/CachedOsmandIndexes.java | 7 +- .../java/net/osmand/binary/OsmandIndex.java | 10238 ++++++++++++---- .../osmand/router/TransportRoutePlanner.java | 4 - 3 files changed, 7589 insertions(+), 2660 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/CachedOsmandIndexes.java b/OsmAnd-java/src/main/java/net/osmand/binary/CachedOsmandIndexes.java index fced895dfb..4a4bec70a2 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/CachedOsmandIndexes.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/CachedOsmandIndexes.java @@ -26,7 +26,6 @@ import net.osmand.binary.OsmandIndex.PoiPart; import net.osmand.binary.OsmandIndex.RoutingPart; import net.osmand.binary.OsmandIndex.RoutingSubregion; import net.osmand.binary.OsmandIndex.TransportPart; -import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; @@ -131,6 +130,10 @@ public class CachedOsmandIndexes { transport.setBottom(index.getBottom()); transport.setStopsTableLength(index.stopsFileLength); transport.setStopsTableOffset(index.stopsFileOffset); +// if(index.incompleteRoutesLength > 0) { + transport.setIncompleteRoutesLength(index.incompleteRoutesLength); + transport.setIncompleteRoutesOffset(index.incompleteRoutesOffset); +// } transport.setStringTableLength(index.stringTable.length); transport.setStringTableOffset(index.stringTable.fileOffset); fileIndex.addTransportIndex(transport); @@ -269,6 +272,8 @@ public class CachedOsmandIndexes { mi.bottom = index.getBottom(); mi.stopsFileLength = index.getStopsTableLength(); mi.stopsFileOffset = index.getStopsTableOffset(); + mi.incompleteRoutesLength = index.getIncompleteRoutesLength(); + mi.incompleteRoutesOffset = index.getIncompleteRoutesOffset(); mi.stringTable = new IndexStringTable(); mi.stringTable.fileOffset = index.getStringTableOffset(); mi.stringTable.length = index.getStringTableLength(); diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/OsmandIndex.java b/OsmAnd-java/src/main/java/net/osmand/binary/OsmandIndex.java index 3eb3b1164c..aba922cdf8 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/OsmandIndex.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/OsmandIndex.java @@ -8,238 +8,416 @@ public final class OsmandIndex { public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } + public interface OsmAndStoredIndexOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required uint32 version = 1; + /** + * required uint32 version = 1; + */ + boolean hasVersion(); + /** + * required uint32 version = 1; + */ + int getVersion(); + + // required int64 dateCreated = 18; + /** + * required int64 dateCreated = 18; + * + *
+     * System.currentTimeMillis()
+     * 
+ */ + boolean hasDateCreated(); + /** + * required int64 dateCreated = 18; + * + *
+     * System.currentTimeMillis()
+     * 
+ */ + long getDateCreated(); + + // repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + java.util.List + getFileIndexList(); + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + net.osmand.binary.OsmandIndex.FileIndex getFileIndex(int index); + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + int getFileIndexCount(); + } + /** + * Protobuf type {@code OsmAnd.OBF.OsmAndStoredIndex} + */ public static final class OsmAndStoredIndex extends - com.google.protobuf.GeneratedMessageLite { + com.google.protobuf.GeneratedMessageLite + implements OsmAndStoredIndexOrBuilder { // Use OsmAndStoredIndex.newBuilder() to construct. - private OsmAndStoredIndex() { - initFields(); + private OsmAndStoredIndex(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + } private OsmAndStoredIndex(boolean noInit) {} - + private static final OsmAndStoredIndex defaultInstance; public static OsmAndStoredIndex getDefaultInstance() { return defaultInstance; } - + public OsmAndStoredIndex getDefaultInstanceForType() { return defaultInstance; } - + + private OsmAndStoredIndex( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + version_ = input.readUInt32(); + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + fileIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + fileIndex_.add(input.readMessage(net.osmand.binary.OsmandIndex.FileIndex.PARSER, extensionRegistry)); + break; + } + case 144: { + bitField0_ |= 0x00000002; + dateCreated_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + fileIndex_ = java.util.Collections.unmodifiableList(fileIndex_); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public OsmAndStoredIndex parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OsmAndStoredIndex(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; // required uint32 version = 1; public static final int VERSION_FIELD_NUMBER = 1; - private boolean hasVersion; - private int version_ = 0; - public boolean hasVersion() { return hasVersion; } - public int getVersion() { return version_; } - + private int version_; + /** + * required uint32 version = 1; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required uint32 version = 1; + */ + public int getVersion() { + return version_; + } + // required int64 dateCreated = 18; public static final int DATECREATED_FIELD_NUMBER = 18; - private boolean hasDateCreated; - private long dateCreated_ = 0L; - public boolean hasDateCreated() { return hasDateCreated; } - public long getDateCreated() { return dateCreated_; } - - // repeated .FileIndex fileIndex = 7; + private long dateCreated_; + /** + * required int64 dateCreated = 18; + * + *
+     * System.currentTimeMillis()
+     * 
+ */ + public boolean hasDateCreated() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int64 dateCreated = 18; + * + *
+     * System.currentTimeMillis()
+     * 
+ */ + public long getDateCreated() { + return dateCreated_; + } + + // repeated .OsmAnd.OBF.FileIndex fileIndex = 7; public static final int FILEINDEX_FIELD_NUMBER = 7; - private java.util.List fileIndex_ = - java.util.Collections.emptyList(); + private java.util.List fileIndex_; + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ public java.util.List getFileIndexList() { return fileIndex_; } - public int getFileIndexCount() { return fileIndex_.size(); } + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + public java.util.List + getFileIndexOrBuilderList() { + return fileIndex_; + } + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + public int getFileIndexCount() { + return fileIndex_.size(); + } + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ public net.osmand.binary.OsmandIndex.FileIndex getFileIndex(int index) { return fileIndex_.get(index); } - - private void initFields() { + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + public net.osmand.binary.OsmandIndex.FileIndexOrBuilder getFileIndexOrBuilder( + int index) { + return fileIndex_.get(index); } + + private void initFields() { + version_ = 0; + dateCreated_ = 0L; + fileIndex_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { - if (!hasVersion) return false; - if (!hasDateCreated) return false; - for (net.osmand.binary.OsmandIndex.FileIndex element : getFileIndexList()) { - if (!element.isInitialized()) return false; + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasVersion()) { + memoizedIsInitialized = 0; + return false; } + if (!hasDateCreated()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getFileIndexCount(); i++) { + if (!getFileIndex(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasVersion()) { - output.writeUInt32(1, getVersion()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt32(1, version_); } - for (net.osmand.binary.OsmandIndex.FileIndex element : getFileIndexList()) { - output.writeMessage(7, element); + for (int i = 0; i < fileIndex_.size(); i++) { + output.writeMessage(7, fileIndex_.get(i)); } - if (hasDateCreated()) { - output.writeInt64(18, getDateCreated()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(18, dateCreated_); } } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; - if (hasVersion()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, getVersion()); + .computeUInt32Size(1, version_); } - for (net.osmand.binary.OsmandIndex.FileIndex element : getFileIndexList()) { + for (int i = 0; i < fileIndex_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, element); + .computeMessageSize(7, fileIndex_.get(i)); } - if (hasDateCreated()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(18, getDateCreated()); + .computeInt64Size(18, dateCreated_); } memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static net.osmand.binary.OsmandIndex.OsmAndStoredIndex parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.OsmAndStoredIndex parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.OsmAndStoredIndex parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.OsmAndStoredIndex parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.OsmAndStoredIndex parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.OsmAndStoredIndex parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.OsmAndStoredIndex parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static net.osmand.binary.OsmandIndex.OsmAndStoredIndex parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.OsmAndStoredIndex parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.OsmAndStoredIndex parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(net.osmand.binary.OsmandIndex.OsmAndStoredIndex prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + + /** + * Protobuf type {@code OsmAnd.OBF.OsmAndStoredIndex} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - net.osmand.binary.OsmandIndex.OsmAndStoredIndex, Builder> { - private net.osmand.binary.OsmandIndex.OsmAndStoredIndex result; - + net.osmand.binary.OsmandIndex.OsmAndStoredIndex, Builder> + implements net.osmand.binary.OsmandIndex.OsmAndStoredIndexOrBuilder { // Construct using net.osmand.binary.OsmandIndex.OsmAndStoredIndex.newBuilder() - private Builder() {} - + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } private static Builder create() { - Builder builder = new Builder(); - builder.result = new net.osmand.binary.OsmandIndex.OsmAndStoredIndex(); - return builder; + return new Builder(); } - - protected net.osmand.binary.OsmandIndex.OsmAndStoredIndex internalGetResult() { - return result; - } - + public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new net.osmand.binary.OsmandIndex.OsmAndStoredIndex(); + super.clear(); + version_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + dateCreated_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + fileIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); return this; } - + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - + public net.osmand.binary.OsmandIndex.OsmAndStoredIndex getDefaultInstanceForType() { return net.osmand.binary.OsmandIndex.OsmAndStoredIndex.getDefaultInstance(); } - - public boolean isInitialized() { - return result.isInitialized(); - } + public net.osmand.binary.OsmandIndex.OsmAndStoredIndex build() { - if (result != null && !isInitialized()) { + net.osmand.binary.OsmandIndex.OsmAndStoredIndex result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - - private net.osmand.binary.OsmandIndex.OsmAndStoredIndex buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - + public net.osmand.binary.OsmandIndex.OsmAndStoredIndex buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + net.osmand.binary.OsmandIndex.OsmAndStoredIndex result = new net.osmand.binary.OsmandIndex.OsmAndStoredIndex(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - if (result.fileIndex_ != java.util.Collections.EMPTY_LIST) { - result.fileIndex_ = - java.util.Collections.unmodifiableList(result.fileIndex_); + result.version_ = version_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; } - net.osmand.binary.OsmandIndex.OsmAndStoredIndex returnMe = result; - result = null; - return returnMe; + result.dateCreated_ = dateCreated_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + fileIndex_ = java.util.Collections.unmodifiableList(fileIndex_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.fileIndex_ = fileIndex_; + result.bitField0_ = to_bitField0_; + return result; } - + public Builder mergeFrom(net.osmand.binary.OsmandIndex.OsmAndStoredIndex other) { if (other == net.osmand.binary.OsmandIndex.OsmAndStoredIndex.getDefaultInstance()) return this; if (other.hasVersion()) { @@ -249,513 +427,1129 @@ public final class OsmandIndex { setDateCreated(other.getDateCreated()); } if (!other.fileIndex_.isEmpty()) { - if (result.fileIndex_.isEmpty()) { - result.fileIndex_ = new java.util.ArrayList(); + if (fileIndex_.isEmpty()) { + fileIndex_ = other.fileIndex_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureFileIndexIsMutable(); + fileIndex_.addAll(other.fileIndex_); } - result.fileIndex_.addAll(other.fileIndex_); + } return this; } - + + public final boolean isInitialized() { + if (!hasVersion()) { + + return false; + } + if (!hasDateCreated()) { + + return false; + } + for (int i = 0; i < getFileIndexCount(); i++) { + if (!getFileIndex(i).isInitialized()) { + + return false; + } + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setVersion(input.readUInt32()); - break; - } - case 58: { - net.osmand.binary.OsmandIndex.FileIndex.Builder subBuilder = net.osmand.binary.OsmandIndex.FileIndex.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addFileIndex(subBuilder.buildPartial()); - break; - } - case 144: { - setDateCreated(input.readInt64()); - break; - } + net.osmand.binary.OsmandIndex.OsmAndStoredIndex parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (net.osmand.binary.OsmandIndex.OsmAndStoredIndex) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - - + private int bitField0_; + // required uint32 version = 1; + private int version_ ; + /** + * required uint32 version = 1; + */ public boolean hasVersion() { - return result.hasVersion(); + return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required uint32 version = 1; + */ public int getVersion() { - return result.getVersion(); + return version_; } + /** + * required uint32 version = 1; + */ public Builder setVersion(int value) { - result.hasVersion = true; - result.version_ = value; + bitField0_ |= 0x00000001; + version_ = value; + return this; } + /** + * required uint32 version = 1; + */ public Builder clearVersion() { - result.hasVersion = false; - result.version_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 0; + return this; } - + // required int64 dateCreated = 18; + private long dateCreated_ ; + /** + * required int64 dateCreated = 18; + * + *
+       * System.currentTimeMillis()
+       * 
+ */ public boolean hasDateCreated() { - return result.hasDateCreated(); + return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required int64 dateCreated = 18; + * + *
+       * System.currentTimeMillis()
+       * 
+ */ public long getDateCreated() { - return result.getDateCreated(); + return dateCreated_; } + /** + * required int64 dateCreated = 18; + * + *
+       * System.currentTimeMillis()
+       * 
+ */ public Builder setDateCreated(long value) { - result.hasDateCreated = true; - result.dateCreated_ = value; + bitField0_ |= 0x00000002; + dateCreated_ = value; + return this; } + /** + * required int64 dateCreated = 18; + * + *
+       * System.currentTimeMillis()
+       * 
+ */ public Builder clearDateCreated() { - result.hasDateCreated = false; - result.dateCreated_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + dateCreated_ = 0L; + return this; } - - // repeated .FileIndex fileIndex = 7; + + // repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + private java.util.List fileIndex_ = + java.util.Collections.emptyList(); + private void ensureFileIndexIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + fileIndex_ = new java.util.ArrayList(fileIndex_); + bitField0_ |= 0x00000004; + } + } + + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ public java.util.List getFileIndexList() { - return java.util.Collections.unmodifiableList(result.fileIndex_); + return java.util.Collections.unmodifiableList(fileIndex_); } + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ public int getFileIndexCount() { - return result.getFileIndexCount(); + return fileIndex_.size(); } + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ public net.osmand.binary.OsmandIndex.FileIndex getFileIndex(int index) { - return result.getFileIndex(index); + return fileIndex_.get(index); } - public Builder setFileIndex(int index, net.osmand.binary.OsmandIndex.FileIndex value) { + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + public Builder setFileIndex( + int index, net.osmand.binary.OsmandIndex.FileIndex value) { if (value == null) { throw new NullPointerException(); } - result.fileIndex_.set(index, value); + ensureFileIndexIsMutable(); + fileIndex_.set(index, value); + return this; } - public Builder setFileIndex(int index, net.osmand.binary.OsmandIndex.FileIndex.Builder builderForValue) { - result.fileIndex_.set(index, builderForValue.build()); + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + public Builder setFileIndex( + int index, net.osmand.binary.OsmandIndex.FileIndex.Builder builderForValue) { + ensureFileIndexIsMutable(); + fileIndex_.set(index, builderForValue.build()); + return this; } + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ public Builder addFileIndex(net.osmand.binary.OsmandIndex.FileIndex value) { if (value == null) { throw new NullPointerException(); } - if (result.fileIndex_.isEmpty()) { - result.fileIndex_ = new java.util.ArrayList(); - } - result.fileIndex_.add(value); + ensureFileIndexIsMutable(); + fileIndex_.add(value); + return this; } - public Builder addFileIndex(net.osmand.binary.OsmandIndex.FileIndex.Builder builderForValue) { - if (result.fileIndex_.isEmpty()) { - result.fileIndex_ = new java.util.ArrayList(); + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + public Builder addFileIndex( + int index, net.osmand.binary.OsmandIndex.FileIndex value) { + if (value == null) { + throw new NullPointerException(); } - result.fileIndex_.add(builderForValue.build()); + ensureFileIndexIsMutable(); + fileIndex_.add(index, value); + return this; } + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + public Builder addFileIndex( + net.osmand.binary.OsmandIndex.FileIndex.Builder builderForValue) { + ensureFileIndexIsMutable(); + fileIndex_.add(builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + public Builder addFileIndex( + int index, net.osmand.binary.OsmandIndex.FileIndex.Builder builderForValue) { + ensureFileIndexIsMutable(); + fileIndex_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ public Builder addAllFileIndex( java.lang.Iterable values) { - if (result.fileIndex_.isEmpty()) { - result.fileIndex_ = new java.util.ArrayList(); - } - super.addAll(values, result.fileIndex_); + ensureFileIndexIsMutable(); + super.addAll(values, fileIndex_); + return this; } + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ public Builder clearFileIndex() { - result.fileIndex_ = java.util.Collections.emptyList(); + fileIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + return this; } - - // @@protoc_insertion_point(builder_scope:OsmAndStoredIndex) + /** + * repeated .OsmAnd.OBF.FileIndex fileIndex = 7; + */ + public Builder removeFileIndex(int index) { + ensureFileIndexIsMutable(); + fileIndex_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.OsmAndStoredIndex) } - + static { defaultInstance = new OsmAndStoredIndex(true); - net.osmand.binary.OsmandIndex.internalForceInit(); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:OsmAndStoredIndex) + + // @@protoc_insertion_point(class_scope:OsmAnd.OBF.OsmAndStoredIndex) } - + + public interface FileIndexOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required int64 size = 1; + /** + * required int64 size = 1; + */ + boolean hasSize(); + /** + * required int64 size = 1; + */ + long getSize(); + + // required int64 dateModified = 2; + /** + * required int64 dateModified = 2; + */ + boolean hasDateModified(); + /** + * required int64 dateModified = 2; + */ + long getDateModified(); + + // required string fileName = 3; + /** + * required string fileName = 3; + */ + boolean hasFileName(); + /** + * required string fileName = 3; + */ + java.lang.String getFileName(); + /** + * required string fileName = 3; + */ + com.google.protobuf.ByteString + getFileNameBytes(); + + // required int32 version = 4; + /** + * required int32 version = 4; + */ + boolean hasVersion(); + /** + * required int32 version = 4; + */ + int getVersion(); + + // repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + java.util.List + getAddressIndexList(); + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + net.osmand.binary.OsmandIndex.AddressPart getAddressIndex(int index); + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + int getAddressIndexCount(); + + // repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + java.util.List + getTransportIndexList(); + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + net.osmand.binary.OsmandIndex.TransportPart getTransportIndex(int index); + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + int getTransportIndexCount(); + + // repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + java.util.List + getPoiIndexList(); + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + net.osmand.binary.OsmandIndex.PoiPart getPoiIndex(int index); + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + int getPoiIndexCount(); + + // repeated .OsmAnd.OBF.MapPart mapIndex = 11; + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + java.util.List + getMapIndexList(); + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + net.osmand.binary.OsmandIndex.MapPart getMapIndex(int index); + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + int getMapIndexCount(); + + // repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + java.util.List + getRoutingIndexList(); + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + net.osmand.binary.OsmandIndex.RoutingPart getRoutingIndex(int index); + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + int getRoutingIndexCount(); + } + /** + * Protobuf type {@code OsmAnd.OBF.FileIndex} + */ public static final class FileIndex extends - com.google.protobuf.GeneratedMessageLite { + com.google.protobuf.GeneratedMessageLite + implements FileIndexOrBuilder { // Use FileIndex.newBuilder() to construct. - private FileIndex() { - initFields(); + private FileIndex(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + } private FileIndex(boolean noInit) {} - + private static final FileIndex defaultInstance; public static FileIndex getDefaultInstance() { return defaultInstance; } - + public FileIndex getDefaultInstanceForType() { return defaultInstance; } - + + private FileIndex( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + size_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + dateModified_ = input.readInt64(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + fileName_ = input.readBytes(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + version_ = input.readInt32(); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + addressIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + addressIndex_.add(input.readMessage(net.osmand.binary.OsmandIndex.AddressPart.PARSER, extensionRegistry)); + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + transportIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + transportIndex_.add(input.readMessage(net.osmand.binary.OsmandIndex.TransportPart.PARSER, extensionRegistry)); + break; + } + case 82: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + poiIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + poiIndex_.add(input.readMessage(net.osmand.binary.OsmandIndex.PoiPart.PARSER, extensionRegistry)); + break; + } + case 90: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + mapIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + mapIndex_.add(input.readMessage(net.osmand.binary.OsmandIndex.MapPart.PARSER, extensionRegistry)); + break; + } + case 98: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + routingIndex_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + routingIndex_.add(input.readMessage(net.osmand.binary.OsmandIndex.RoutingPart.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + addressIndex_ = java.util.Collections.unmodifiableList(addressIndex_); + } + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + transportIndex_ = java.util.Collections.unmodifiableList(transportIndex_); + } + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + poiIndex_ = java.util.Collections.unmodifiableList(poiIndex_); + } + if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + mapIndex_ = java.util.Collections.unmodifiableList(mapIndex_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + routingIndex_ = java.util.Collections.unmodifiableList(routingIndex_); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public FileIndex parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FileIndex(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; // required int64 size = 1; public static final int SIZE_FIELD_NUMBER = 1; - private boolean hasSize; - private long size_ = 0L; - public boolean hasSize() { return hasSize; } - public long getSize() { return size_; } - + private long size_; + /** + * required int64 size = 1; + */ + public boolean hasSize() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int64 size = 1; + */ + public long getSize() { + return size_; + } + // required int64 dateModified = 2; public static final int DATEMODIFIED_FIELD_NUMBER = 2; - private boolean hasDateModified; - private long dateModified_ = 0L; - public boolean hasDateModified() { return hasDateModified; } - public long getDateModified() { return dateModified_; } - + private long dateModified_; + /** + * required int64 dateModified = 2; + */ + public boolean hasDateModified() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int64 dateModified = 2; + */ + public long getDateModified() { + return dateModified_; + } + // required string fileName = 3; public static final int FILENAME_FIELD_NUMBER = 3; - private boolean hasFileName; - private java.lang.String fileName_ = ""; - public boolean hasFileName() { return hasFileName; } - public java.lang.String getFileName() { return fileName_; } - + private java.lang.Object fileName_; + /** + * required string fileName = 3; + */ + public boolean hasFileName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required string fileName = 3; + */ + public java.lang.String getFileName() { + java.lang.Object ref = fileName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + fileName_ = s; + } + return s; + } + } + /** + * required string fileName = 3; + */ + public com.google.protobuf.ByteString + getFileNameBytes() { + java.lang.Object ref = fileName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + // required int32 version = 4; public static final int VERSION_FIELD_NUMBER = 4; - private boolean hasVersion; - private int version_ = 0; - public boolean hasVersion() { return hasVersion; } - public int getVersion() { return version_; } - - // repeated .AddressPart addressIndex = 8; + private int version_; + /** + * required int32 version = 4; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required int32 version = 4; + */ + public int getVersion() { + return version_; + } + + // repeated .OsmAnd.OBF.AddressPart addressIndex = 8; public static final int ADDRESSINDEX_FIELD_NUMBER = 8; - private java.util.List addressIndex_ = - java.util.Collections.emptyList(); + private java.util.List addressIndex_; + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ public java.util.List getAddressIndexList() { return addressIndex_; } - public int getAddressIndexCount() { return addressIndex_.size(); } + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public java.util.List + getAddressIndexOrBuilderList() { + return addressIndex_; + } + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public int getAddressIndexCount() { + return addressIndex_.size(); + } + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ public net.osmand.binary.OsmandIndex.AddressPart getAddressIndex(int index) { return addressIndex_.get(index); } - - // repeated .TransportPart transportIndex = 9; + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public net.osmand.binary.OsmandIndex.AddressPartOrBuilder getAddressIndexOrBuilder( + int index) { + return addressIndex_.get(index); + } + + // repeated .OsmAnd.OBF.TransportPart transportIndex = 9; public static final int TRANSPORTINDEX_FIELD_NUMBER = 9; - private java.util.List transportIndex_ = - java.util.Collections.emptyList(); + private java.util.List transportIndex_; + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ public java.util.List getTransportIndexList() { return transportIndex_; } - public int getTransportIndexCount() { return transportIndex_.size(); } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public java.util.List + getTransportIndexOrBuilderList() { + return transportIndex_; + } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public int getTransportIndexCount() { + return transportIndex_.size(); + } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ public net.osmand.binary.OsmandIndex.TransportPart getTransportIndex(int index) { return transportIndex_.get(index); } - - // repeated .PoiPart poiIndex = 10; + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public net.osmand.binary.OsmandIndex.TransportPartOrBuilder getTransportIndexOrBuilder( + int index) { + return transportIndex_.get(index); + } + + // repeated .OsmAnd.OBF.PoiPart poiIndex = 10; public static final int POIINDEX_FIELD_NUMBER = 10; - private java.util.List poiIndex_ = - java.util.Collections.emptyList(); + private java.util.List poiIndex_; + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ public java.util.List getPoiIndexList() { return poiIndex_; } - public int getPoiIndexCount() { return poiIndex_.size(); } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public java.util.List + getPoiIndexOrBuilderList() { + return poiIndex_; + } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public int getPoiIndexCount() { + return poiIndex_.size(); + } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ public net.osmand.binary.OsmandIndex.PoiPart getPoiIndex(int index) { return poiIndex_.get(index); } - - // repeated .MapPart mapIndex = 11; + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public net.osmand.binary.OsmandIndex.PoiPartOrBuilder getPoiIndexOrBuilder( + int index) { + return poiIndex_.get(index); + } + + // repeated .OsmAnd.OBF.MapPart mapIndex = 11; public static final int MAPINDEX_FIELD_NUMBER = 11; - private java.util.List mapIndex_ = - java.util.Collections.emptyList(); + private java.util.List mapIndex_; + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ public java.util.List getMapIndexList() { return mapIndex_; } - public int getMapIndexCount() { return mapIndex_.size(); } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public java.util.List + getMapIndexOrBuilderList() { + return mapIndex_; + } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public int getMapIndexCount() { + return mapIndex_.size(); + } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ public net.osmand.binary.OsmandIndex.MapPart getMapIndex(int index) { return mapIndex_.get(index); } - - // repeated .RoutingPart routingIndex = 12; + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public net.osmand.binary.OsmandIndex.MapPartOrBuilder getMapIndexOrBuilder( + int index) { + return mapIndex_.get(index); + } + + // repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; public static final int ROUTINGINDEX_FIELD_NUMBER = 12; - private java.util.List routingIndex_ = - java.util.Collections.emptyList(); + private java.util.List routingIndex_; + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ public java.util.List getRoutingIndexList() { return routingIndex_; } - public int getRoutingIndexCount() { return routingIndex_.size(); } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public java.util.List + getRoutingIndexOrBuilderList() { + return routingIndex_; + } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public int getRoutingIndexCount() { + return routingIndex_.size(); + } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ public net.osmand.binary.OsmandIndex.RoutingPart getRoutingIndex(int index) { return routingIndex_.get(index); } - - private void initFields() { + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public net.osmand.binary.OsmandIndex.RoutingPartOrBuilder getRoutingIndexOrBuilder( + int index) { + return routingIndex_.get(index); } + + private void initFields() { + size_ = 0L; + dateModified_ = 0L; + fileName_ = ""; + version_ = 0; + addressIndex_ = java.util.Collections.emptyList(); + transportIndex_ = java.util.Collections.emptyList(); + poiIndex_ = java.util.Collections.emptyList(); + mapIndex_ = java.util.Collections.emptyList(); + routingIndex_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { - if (!hasSize) return false; - if (!hasDateModified) return false; - if (!hasFileName) return false; - if (!hasVersion) return false; - for (net.osmand.binary.OsmandIndex.AddressPart element : getAddressIndexList()) { - if (!element.isInitialized()) return false; + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSize()) { + memoizedIsInitialized = 0; + return false; } - for (net.osmand.binary.OsmandIndex.TransportPart element : getTransportIndexList()) { - if (!element.isInitialized()) return false; + if (!hasDateModified()) { + memoizedIsInitialized = 0; + return false; } - for (net.osmand.binary.OsmandIndex.PoiPart element : getPoiIndexList()) { - if (!element.isInitialized()) return false; + if (!hasFileName()) { + memoizedIsInitialized = 0; + return false; } - for (net.osmand.binary.OsmandIndex.MapPart element : getMapIndexList()) { - if (!element.isInitialized()) return false; + if (!hasVersion()) { + memoizedIsInitialized = 0; + return false; } - for (net.osmand.binary.OsmandIndex.RoutingPart element : getRoutingIndexList()) { - if (!element.isInitialized()) return false; + for (int i = 0; i < getAddressIndexCount(); i++) { + if (!getAddressIndex(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } } + for (int i = 0; i < getTransportIndexCount(); i++) { + if (!getTransportIndex(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getPoiIndexCount(); i++) { + if (!getPoiIndex(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getMapIndexCount(); i++) { + if (!getMapIndex(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getRoutingIndexCount(); i++) { + if (!getRoutingIndex(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasSize()) { - output.writeInt64(1, getSize()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, size_); } - if (hasDateModified()) { - output.writeInt64(2, getDateModified()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, dateModified_); } - if (hasFileName()) { - output.writeString(3, getFileName()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getFileNameBytes()); } - if (hasVersion()) { - output.writeInt32(4, getVersion()); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, version_); } - for (net.osmand.binary.OsmandIndex.AddressPart element : getAddressIndexList()) { - output.writeMessage(8, element); + for (int i = 0; i < addressIndex_.size(); i++) { + output.writeMessage(8, addressIndex_.get(i)); } - for (net.osmand.binary.OsmandIndex.TransportPart element : getTransportIndexList()) { - output.writeMessage(9, element); + for (int i = 0; i < transportIndex_.size(); i++) { + output.writeMessage(9, transportIndex_.get(i)); } - for (net.osmand.binary.OsmandIndex.PoiPart element : getPoiIndexList()) { - output.writeMessage(10, element); + for (int i = 0; i < poiIndex_.size(); i++) { + output.writeMessage(10, poiIndex_.get(i)); } - for (net.osmand.binary.OsmandIndex.MapPart element : getMapIndexList()) { - output.writeMessage(11, element); + for (int i = 0; i < mapIndex_.size(); i++) { + output.writeMessage(11, mapIndex_.get(i)); } - for (net.osmand.binary.OsmandIndex.RoutingPart element : getRoutingIndexList()) { - output.writeMessage(12, element); + for (int i = 0; i < routingIndex_.size(); i++) { + output.writeMessage(12, routingIndex_.get(i)); } } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; - if (hasSize()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, getSize()); + .computeInt64Size(1, size_); } - if (hasDateModified()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, getDateModified()); + .computeInt64Size(2, dateModified_); } - if (hasFileName()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(3, getFileName()); + .computeBytesSize(3, getFileNameBytes()); } - if (hasVersion()) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, getVersion()); + .computeInt32Size(4, version_); } - for (net.osmand.binary.OsmandIndex.AddressPart element : getAddressIndexList()) { + for (int i = 0; i < addressIndex_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, element); + .computeMessageSize(8, addressIndex_.get(i)); } - for (net.osmand.binary.OsmandIndex.TransportPart element : getTransportIndexList()) { + for (int i = 0; i < transportIndex_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, element); + .computeMessageSize(9, transportIndex_.get(i)); } - for (net.osmand.binary.OsmandIndex.PoiPart element : getPoiIndexList()) { + for (int i = 0; i < poiIndex_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, element); + .computeMessageSize(10, poiIndex_.get(i)); } - for (net.osmand.binary.OsmandIndex.MapPart element : getMapIndexList()) { + for (int i = 0; i < mapIndex_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, element); + .computeMessageSize(11, mapIndex_.get(i)); } - for (net.osmand.binary.OsmandIndex.RoutingPart element : getRoutingIndexList()) { + for (int i = 0; i < routingIndex_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, element); + .computeMessageSize(12, routingIndex_.get(i)); } memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static net.osmand.binary.OsmandIndex.FileIndex parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.FileIndex parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.FileIndex parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.FileIndex parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.FileIndex parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.FileIndex parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.FileIndex parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static net.osmand.binary.OsmandIndex.FileIndex parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.FileIndex parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.FileIndex parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(net.osmand.binary.OsmandIndex.FileIndex prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + + /** + * Protobuf type {@code OsmAnd.OBF.FileIndex} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - net.osmand.binary.OsmandIndex.FileIndex, Builder> { - private net.osmand.binary.OsmandIndex.FileIndex result; - + net.osmand.binary.OsmandIndex.FileIndex, Builder> + implements net.osmand.binary.OsmandIndex.FileIndexOrBuilder { // Construct using net.osmand.binary.OsmandIndex.FileIndex.newBuilder() - private Builder() {} - + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } private static Builder create() { - Builder builder = new Builder(); - builder.result = new net.osmand.binary.OsmandIndex.FileIndex(); - return builder; + return new Builder(); } - - protected net.osmand.binary.OsmandIndex.FileIndex internalGetResult() { - return result; - } - + public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new net.osmand.binary.OsmandIndex.FileIndex(); + super.clear(); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + dateModified_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + fileName_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + version_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + addressIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + transportIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + poiIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + mapIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + routingIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); return this; } - + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - + public net.osmand.binary.OsmandIndex.FileIndex getDefaultInstanceForType() { return net.osmand.binary.OsmandIndex.FileIndex.getDefaultInstance(); } - - public boolean isInitialized() { - return result.isInitialized(); - } + public net.osmand.binary.OsmandIndex.FileIndex build() { - if (result != null && !isInitialized()) { + net.osmand.binary.OsmandIndex.FileIndex result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - - private net.osmand.binary.OsmandIndex.FileIndex buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - + public net.osmand.binary.OsmandIndex.FileIndex buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + net.osmand.binary.OsmandIndex.FileIndex result = new net.osmand.binary.OsmandIndex.FileIndex(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - if (result.addressIndex_ != java.util.Collections.EMPTY_LIST) { - result.addressIndex_ = - java.util.Collections.unmodifiableList(result.addressIndex_); + result.size_ = size_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; } - if (result.transportIndex_ != java.util.Collections.EMPTY_LIST) { - result.transportIndex_ = - java.util.Collections.unmodifiableList(result.transportIndex_); + result.dateModified_ = dateModified_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; } - if (result.poiIndex_ != java.util.Collections.EMPTY_LIST) { - result.poiIndex_ = - java.util.Collections.unmodifiableList(result.poiIndex_); + result.fileName_ = fileName_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; } - if (result.mapIndex_ != java.util.Collections.EMPTY_LIST) { - result.mapIndex_ = - java.util.Collections.unmodifiableList(result.mapIndex_); + result.version_ = version_; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + addressIndex_ = java.util.Collections.unmodifiableList(addressIndex_); + bitField0_ = (bitField0_ & ~0x00000010); } - if (result.routingIndex_ != java.util.Collections.EMPTY_LIST) { - result.routingIndex_ = - java.util.Collections.unmodifiableList(result.routingIndex_); + result.addressIndex_ = addressIndex_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + transportIndex_ = java.util.Collections.unmodifiableList(transportIndex_); + bitField0_ = (bitField0_ & ~0x00000020); } - net.osmand.binary.OsmandIndex.FileIndex returnMe = result; - result = null; - return returnMe; + result.transportIndex_ = transportIndex_; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + poiIndex_ = java.util.Collections.unmodifiableList(poiIndex_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.poiIndex_ = poiIndex_; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + mapIndex_ = java.util.Collections.unmodifiableList(mapIndex_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.mapIndex_ = mapIndex_; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + routingIndex_ = java.util.Collections.unmodifiableList(routingIndex_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.routingIndex_ = routingIndex_; + result.bitField0_ = to_bitField0_; + return result; } - + public Builder mergeFrom(net.osmand.binary.OsmandIndex.FileIndex other) { if (other == net.osmand.binary.OsmandIndex.FileIndex.getDefaultInstance()) return this; if (other.hasSize()) { @@ -765,600 +1559,1452 @@ public final class OsmandIndex { setDateModified(other.getDateModified()); } if (other.hasFileName()) { - setFileName(other.getFileName()); + bitField0_ |= 0x00000004; + fileName_ = other.fileName_; + } if (other.hasVersion()) { setVersion(other.getVersion()); } if (!other.addressIndex_.isEmpty()) { - if (result.addressIndex_.isEmpty()) { - result.addressIndex_ = new java.util.ArrayList(); + if (addressIndex_.isEmpty()) { + addressIndex_ = other.addressIndex_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureAddressIndexIsMutable(); + addressIndex_.addAll(other.addressIndex_); } - result.addressIndex_.addAll(other.addressIndex_); + } if (!other.transportIndex_.isEmpty()) { - if (result.transportIndex_.isEmpty()) { - result.transportIndex_ = new java.util.ArrayList(); + if (transportIndex_.isEmpty()) { + transportIndex_ = other.transportIndex_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureTransportIndexIsMutable(); + transportIndex_.addAll(other.transportIndex_); } - result.transportIndex_.addAll(other.transportIndex_); + } if (!other.poiIndex_.isEmpty()) { - if (result.poiIndex_.isEmpty()) { - result.poiIndex_ = new java.util.ArrayList(); + if (poiIndex_.isEmpty()) { + poiIndex_ = other.poiIndex_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensurePoiIndexIsMutable(); + poiIndex_.addAll(other.poiIndex_); } - result.poiIndex_.addAll(other.poiIndex_); + } if (!other.mapIndex_.isEmpty()) { - if (result.mapIndex_.isEmpty()) { - result.mapIndex_ = new java.util.ArrayList(); + if (mapIndex_.isEmpty()) { + mapIndex_ = other.mapIndex_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureMapIndexIsMutable(); + mapIndex_.addAll(other.mapIndex_); } - result.mapIndex_.addAll(other.mapIndex_); + } if (!other.routingIndex_.isEmpty()) { - if (result.routingIndex_.isEmpty()) { - result.routingIndex_ = new java.util.ArrayList(); + if (routingIndex_.isEmpty()) { + routingIndex_ = other.routingIndex_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureRoutingIndexIsMutable(); + routingIndex_.addAll(other.routingIndex_); } - result.routingIndex_.addAll(other.routingIndex_); + } return this; } - + + public final boolean isInitialized() { + if (!hasSize()) { + + return false; + } + if (!hasDateModified()) { + + return false; + } + if (!hasFileName()) { + + return false; + } + if (!hasVersion()) { + + return false; + } + for (int i = 0; i < getAddressIndexCount(); i++) { + if (!getAddressIndex(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getTransportIndexCount(); i++) { + if (!getTransportIndex(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getPoiIndexCount(); i++) { + if (!getPoiIndex(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getMapIndexCount(); i++) { + if (!getMapIndex(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getRoutingIndexCount(); i++) { + if (!getRoutingIndex(i).isInitialized()) { + + return false; + } + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setSize(input.readInt64()); - break; - } - case 16: { - setDateModified(input.readInt64()); - break; - } - case 26: { - setFileName(input.readString()); - break; - } - case 32: { - setVersion(input.readInt32()); - break; - } - case 66: { - net.osmand.binary.OsmandIndex.AddressPart.Builder subBuilder = net.osmand.binary.OsmandIndex.AddressPart.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addAddressIndex(subBuilder.buildPartial()); - break; - } - case 74: { - net.osmand.binary.OsmandIndex.TransportPart.Builder subBuilder = net.osmand.binary.OsmandIndex.TransportPart.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addTransportIndex(subBuilder.buildPartial()); - break; - } - case 82: { - net.osmand.binary.OsmandIndex.PoiPart.Builder subBuilder = net.osmand.binary.OsmandIndex.PoiPart.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addPoiIndex(subBuilder.buildPartial()); - break; - } - case 90: { - net.osmand.binary.OsmandIndex.MapPart.Builder subBuilder = net.osmand.binary.OsmandIndex.MapPart.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addMapIndex(subBuilder.buildPartial()); - break; - } - case 98: { - net.osmand.binary.OsmandIndex.RoutingPart.Builder subBuilder = net.osmand.binary.OsmandIndex.RoutingPart.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addRoutingIndex(subBuilder.buildPartial()); - break; - } + net.osmand.binary.OsmandIndex.FileIndex parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (net.osmand.binary.OsmandIndex.FileIndex) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - - + private int bitField0_; + // required int64 size = 1; + private long size_ ; + /** + * required int64 size = 1; + */ public boolean hasSize() { - return result.hasSize(); + return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int64 size = 1; + */ public long getSize() { - return result.getSize(); + return size_; } + /** + * required int64 size = 1; + */ public Builder setSize(long value) { - result.hasSize = true; - result.size_ = value; + bitField0_ |= 0x00000001; + size_ = value; + return this; } + /** + * required int64 size = 1; + */ public Builder clearSize() { - result.hasSize = false; - result.size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + return this; } - + // required int64 dateModified = 2; + private long dateModified_ ; + /** + * required int64 dateModified = 2; + */ public boolean hasDateModified() { - return result.hasDateModified(); + return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required int64 dateModified = 2; + */ public long getDateModified() { - return result.getDateModified(); + return dateModified_; } + /** + * required int64 dateModified = 2; + */ public Builder setDateModified(long value) { - result.hasDateModified = true; - result.dateModified_ = value; + bitField0_ |= 0x00000002; + dateModified_ = value; + return this; } + /** + * required int64 dateModified = 2; + */ public Builder clearDateModified() { - result.hasDateModified = false; - result.dateModified_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + dateModified_ = 0L; + return this; } - + // required string fileName = 3; + private java.lang.Object fileName_ = ""; + /** + * required string fileName = 3; + */ public boolean hasFileName() { - return result.hasFileName(); + return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * required string fileName = 3; + */ public java.lang.String getFileName() { - return result.getFileName(); + java.lang.Object ref = fileName_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + fileName_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - public Builder setFileName(java.lang.String value) { + /** + * required string fileName = 3; + */ + public com.google.protobuf.ByteString + getFileNameBytes() { + java.lang.Object ref = fileName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string fileName = 3; + */ + public Builder setFileName( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - result.hasFileName = true; - result.fileName_ = value; + bitField0_ |= 0x00000004; + fileName_ = value; + return this; } + /** + * required string fileName = 3; + */ public Builder clearFileName() { - result.hasFileName = false; - result.fileName_ = getDefaultInstance().getFileName(); + bitField0_ = (bitField0_ & ~0x00000004); + fileName_ = getDefaultInstance().getFileName(); + return this; } - + /** + * required string fileName = 3; + */ + public Builder setFileNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + fileName_ = value; + + return this; + } + // required int32 version = 4; + private int version_ ; + /** + * required int32 version = 4; + */ public boolean hasVersion() { - return result.hasVersion(); + return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * required int32 version = 4; + */ public int getVersion() { - return result.getVersion(); + return version_; } + /** + * required int32 version = 4; + */ public Builder setVersion(int value) { - result.hasVersion = true; - result.version_ = value; + bitField0_ |= 0x00000008; + version_ = value; + return this; } + /** + * required int32 version = 4; + */ public Builder clearVersion() { - result.hasVersion = false; - result.version_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + version_ = 0; + return this; } - - // repeated .AddressPart addressIndex = 8; + + // repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + private java.util.List addressIndex_ = + java.util.Collections.emptyList(); + private void ensureAddressIndexIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + addressIndex_ = new java.util.ArrayList(addressIndex_); + bitField0_ |= 0x00000010; + } + } + + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ public java.util.List getAddressIndexList() { - return java.util.Collections.unmodifiableList(result.addressIndex_); + return java.util.Collections.unmodifiableList(addressIndex_); } + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ public int getAddressIndexCount() { - return result.getAddressIndexCount(); + return addressIndex_.size(); } + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ public net.osmand.binary.OsmandIndex.AddressPart getAddressIndex(int index) { - return result.getAddressIndex(index); + return addressIndex_.get(index); } - public Builder setAddressIndex(int index, net.osmand.binary.OsmandIndex.AddressPart value) { + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public Builder setAddressIndex( + int index, net.osmand.binary.OsmandIndex.AddressPart value) { if (value == null) { throw new NullPointerException(); } - result.addressIndex_.set(index, value); + ensureAddressIndexIsMutable(); + addressIndex_.set(index, value); + return this; } - public Builder setAddressIndex(int index, net.osmand.binary.OsmandIndex.AddressPart.Builder builderForValue) { - result.addressIndex_.set(index, builderForValue.build()); + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public Builder setAddressIndex( + int index, net.osmand.binary.OsmandIndex.AddressPart.Builder builderForValue) { + ensureAddressIndexIsMutable(); + addressIndex_.set(index, builderForValue.build()); + return this; } + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ public Builder addAddressIndex(net.osmand.binary.OsmandIndex.AddressPart value) { if (value == null) { throw new NullPointerException(); } - if (result.addressIndex_.isEmpty()) { - result.addressIndex_ = new java.util.ArrayList(); - } - result.addressIndex_.add(value); + ensureAddressIndexIsMutable(); + addressIndex_.add(value); + return this; } - public Builder addAddressIndex(net.osmand.binary.OsmandIndex.AddressPart.Builder builderForValue) { - if (result.addressIndex_.isEmpty()) { - result.addressIndex_ = new java.util.ArrayList(); - } - result.addressIndex_.add(builderForValue.build()); - return this; - } - public Builder addAllAddressIndex( - java.lang.Iterable values) { - if (result.addressIndex_.isEmpty()) { - result.addressIndex_ = new java.util.ArrayList(); - } - super.addAll(values, result.addressIndex_); - return this; - } - public Builder clearAddressIndex() { - result.addressIndex_ = java.util.Collections.emptyList(); - return this; - } - - // repeated .TransportPart transportIndex = 9; - public java.util.List getTransportIndexList() { - return java.util.Collections.unmodifiableList(result.transportIndex_); - } - public int getTransportIndexCount() { - return result.getTransportIndexCount(); - } - public net.osmand.binary.OsmandIndex.TransportPart getTransportIndex(int index) { - return result.getTransportIndex(index); - } - public Builder setTransportIndex(int index, net.osmand.binary.OsmandIndex.TransportPart value) { + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public Builder addAddressIndex( + int index, net.osmand.binary.OsmandIndex.AddressPart value) { if (value == null) { throw new NullPointerException(); } - result.transportIndex_.set(index, value); + ensureAddressIndexIsMutable(); + addressIndex_.add(index, value); + return this; } - public Builder setTransportIndex(int index, net.osmand.binary.OsmandIndex.TransportPart.Builder builderForValue) { - result.transportIndex_.set(index, builderForValue.build()); + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public Builder addAddressIndex( + net.osmand.binary.OsmandIndex.AddressPart.Builder builderForValue) { + ensureAddressIndexIsMutable(); + addressIndex_.add(builderForValue.build()); + return this; } + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public Builder addAddressIndex( + int index, net.osmand.binary.OsmandIndex.AddressPart.Builder builderForValue) { + ensureAddressIndexIsMutable(); + addressIndex_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public Builder addAllAddressIndex( + java.lang.Iterable values) { + ensureAddressIndexIsMutable(); + super.addAll(values, addressIndex_); + + return this; + } + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public Builder clearAddressIndex() { + addressIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + + return this; + } + /** + * repeated .OsmAnd.OBF.AddressPart addressIndex = 8; + */ + public Builder removeAddressIndex(int index) { + ensureAddressIndexIsMutable(); + addressIndex_.remove(index); + + return this; + } + + // repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + private java.util.List transportIndex_ = + java.util.Collections.emptyList(); + private void ensureTransportIndexIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + transportIndex_ = new java.util.ArrayList(transportIndex_); + bitField0_ |= 0x00000020; + } + } + + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public java.util.List getTransportIndexList() { + return java.util.Collections.unmodifiableList(transportIndex_); + } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public int getTransportIndexCount() { + return transportIndex_.size(); + } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public net.osmand.binary.OsmandIndex.TransportPart getTransportIndex(int index) { + return transportIndex_.get(index); + } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public Builder setTransportIndex( + int index, net.osmand.binary.OsmandIndex.TransportPart value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransportIndexIsMutable(); + transportIndex_.set(index, value); + + return this; + } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public Builder setTransportIndex( + int index, net.osmand.binary.OsmandIndex.TransportPart.Builder builderForValue) { + ensureTransportIndexIsMutable(); + transportIndex_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ public Builder addTransportIndex(net.osmand.binary.OsmandIndex.TransportPart value) { if (value == null) { throw new NullPointerException(); } - if (result.transportIndex_.isEmpty()) { - result.transportIndex_ = new java.util.ArrayList(); - } - result.transportIndex_.add(value); + ensureTransportIndexIsMutable(); + transportIndex_.add(value); + return this; } - public Builder addTransportIndex(net.osmand.binary.OsmandIndex.TransportPart.Builder builderForValue) { - if (result.transportIndex_.isEmpty()) { - result.transportIndex_ = new java.util.ArrayList(); - } - result.transportIndex_.add(builderForValue.build()); - return this; - } - public Builder addAllTransportIndex( - java.lang.Iterable values) { - if (result.transportIndex_.isEmpty()) { - result.transportIndex_ = new java.util.ArrayList(); - } - super.addAll(values, result.transportIndex_); - return this; - } - public Builder clearTransportIndex() { - result.transportIndex_ = java.util.Collections.emptyList(); - return this; - } - - // repeated .PoiPart poiIndex = 10; - public java.util.List getPoiIndexList() { - return java.util.Collections.unmodifiableList(result.poiIndex_); - } - public int getPoiIndexCount() { - return result.getPoiIndexCount(); - } - public net.osmand.binary.OsmandIndex.PoiPart getPoiIndex(int index) { - return result.getPoiIndex(index); - } - public Builder setPoiIndex(int index, net.osmand.binary.OsmandIndex.PoiPart value) { + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public Builder addTransportIndex( + int index, net.osmand.binary.OsmandIndex.TransportPart value) { if (value == null) { throw new NullPointerException(); } - result.poiIndex_.set(index, value); + ensureTransportIndexIsMutable(); + transportIndex_.add(index, value); + return this; } - public Builder setPoiIndex(int index, net.osmand.binary.OsmandIndex.PoiPart.Builder builderForValue) { - result.poiIndex_.set(index, builderForValue.build()); + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public Builder addTransportIndex( + net.osmand.binary.OsmandIndex.TransportPart.Builder builderForValue) { + ensureTransportIndexIsMutable(); + transportIndex_.add(builderForValue.build()); + return this; } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public Builder addTransportIndex( + int index, net.osmand.binary.OsmandIndex.TransportPart.Builder builderForValue) { + ensureTransportIndexIsMutable(); + transportIndex_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public Builder addAllTransportIndex( + java.lang.Iterable values) { + ensureTransportIndexIsMutable(); + super.addAll(values, transportIndex_); + + return this; + } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public Builder clearTransportIndex() { + transportIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + + return this; + } + /** + * repeated .OsmAnd.OBF.TransportPart transportIndex = 9; + */ + public Builder removeTransportIndex(int index) { + ensureTransportIndexIsMutable(); + transportIndex_.remove(index); + + return this; + } + + // repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + private java.util.List poiIndex_ = + java.util.Collections.emptyList(); + private void ensurePoiIndexIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + poiIndex_ = new java.util.ArrayList(poiIndex_); + bitField0_ |= 0x00000040; + } + } + + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public java.util.List getPoiIndexList() { + return java.util.Collections.unmodifiableList(poiIndex_); + } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public int getPoiIndexCount() { + return poiIndex_.size(); + } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public net.osmand.binary.OsmandIndex.PoiPart getPoiIndex(int index) { + return poiIndex_.get(index); + } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public Builder setPoiIndex( + int index, net.osmand.binary.OsmandIndex.PoiPart value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePoiIndexIsMutable(); + poiIndex_.set(index, value); + + return this; + } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public Builder setPoiIndex( + int index, net.osmand.binary.OsmandIndex.PoiPart.Builder builderForValue) { + ensurePoiIndexIsMutable(); + poiIndex_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ public Builder addPoiIndex(net.osmand.binary.OsmandIndex.PoiPart value) { if (value == null) { throw new NullPointerException(); } - if (result.poiIndex_.isEmpty()) { - result.poiIndex_ = new java.util.ArrayList(); - } - result.poiIndex_.add(value); + ensurePoiIndexIsMutable(); + poiIndex_.add(value); + return this; } - public Builder addPoiIndex(net.osmand.binary.OsmandIndex.PoiPart.Builder builderForValue) { - if (result.poiIndex_.isEmpty()) { - result.poiIndex_ = new java.util.ArrayList(); - } - result.poiIndex_.add(builderForValue.build()); - return this; - } - public Builder addAllPoiIndex( - java.lang.Iterable values) { - if (result.poiIndex_.isEmpty()) { - result.poiIndex_ = new java.util.ArrayList(); - } - super.addAll(values, result.poiIndex_); - return this; - } - public Builder clearPoiIndex() { - result.poiIndex_ = java.util.Collections.emptyList(); - return this; - } - - // repeated .MapPart mapIndex = 11; - public java.util.List getMapIndexList() { - return java.util.Collections.unmodifiableList(result.mapIndex_); - } - public int getMapIndexCount() { - return result.getMapIndexCount(); - } - public net.osmand.binary.OsmandIndex.MapPart getMapIndex(int index) { - return result.getMapIndex(index); - } - public Builder setMapIndex(int index, net.osmand.binary.OsmandIndex.MapPart value) { + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public Builder addPoiIndex( + int index, net.osmand.binary.OsmandIndex.PoiPart value) { if (value == null) { throw new NullPointerException(); } - result.mapIndex_.set(index, value); + ensurePoiIndexIsMutable(); + poiIndex_.add(index, value); + return this; } - public Builder setMapIndex(int index, net.osmand.binary.OsmandIndex.MapPart.Builder builderForValue) { - result.mapIndex_.set(index, builderForValue.build()); + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public Builder addPoiIndex( + net.osmand.binary.OsmandIndex.PoiPart.Builder builderForValue) { + ensurePoiIndexIsMutable(); + poiIndex_.add(builderForValue.build()); + return this; } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public Builder addPoiIndex( + int index, net.osmand.binary.OsmandIndex.PoiPart.Builder builderForValue) { + ensurePoiIndexIsMutable(); + poiIndex_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public Builder addAllPoiIndex( + java.lang.Iterable values) { + ensurePoiIndexIsMutable(); + super.addAll(values, poiIndex_); + + return this; + } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public Builder clearPoiIndex() { + poiIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + + return this; + } + /** + * repeated .OsmAnd.OBF.PoiPart poiIndex = 10; + */ + public Builder removePoiIndex(int index) { + ensurePoiIndexIsMutable(); + poiIndex_.remove(index); + + return this; + } + + // repeated .OsmAnd.OBF.MapPart mapIndex = 11; + private java.util.List mapIndex_ = + java.util.Collections.emptyList(); + private void ensureMapIndexIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + mapIndex_ = new java.util.ArrayList(mapIndex_); + bitField0_ |= 0x00000080; + } + } + + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public java.util.List getMapIndexList() { + return java.util.Collections.unmodifiableList(mapIndex_); + } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public int getMapIndexCount() { + return mapIndex_.size(); + } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public net.osmand.binary.OsmandIndex.MapPart getMapIndex(int index) { + return mapIndex_.get(index); + } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public Builder setMapIndex( + int index, net.osmand.binary.OsmandIndex.MapPart value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMapIndexIsMutable(); + mapIndex_.set(index, value); + + return this; + } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public Builder setMapIndex( + int index, net.osmand.binary.OsmandIndex.MapPart.Builder builderForValue) { + ensureMapIndexIsMutable(); + mapIndex_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ public Builder addMapIndex(net.osmand.binary.OsmandIndex.MapPart value) { if (value == null) { throw new NullPointerException(); } - if (result.mapIndex_.isEmpty()) { - result.mapIndex_ = new java.util.ArrayList(); - } - result.mapIndex_.add(value); + ensureMapIndexIsMutable(); + mapIndex_.add(value); + return this; } - public Builder addMapIndex(net.osmand.binary.OsmandIndex.MapPart.Builder builderForValue) { - if (result.mapIndex_.isEmpty()) { - result.mapIndex_ = new java.util.ArrayList(); - } - result.mapIndex_.add(builderForValue.build()); - return this; - } - public Builder addAllMapIndex( - java.lang.Iterable values) { - if (result.mapIndex_.isEmpty()) { - result.mapIndex_ = new java.util.ArrayList(); - } - super.addAll(values, result.mapIndex_); - return this; - } - public Builder clearMapIndex() { - result.mapIndex_ = java.util.Collections.emptyList(); - return this; - } - - // repeated .RoutingPart routingIndex = 12; - public java.util.List getRoutingIndexList() { - return java.util.Collections.unmodifiableList(result.routingIndex_); - } - public int getRoutingIndexCount() { - return result.getRoutingIndexCount(); - } - public net.osmand.binary.OsmandIndex.RoutingPart getRoutingIndex(int index) { - return result.getRoutingIndex(index); - } - public Builder setRoutingIndex(int index, net.osmand.binary.OsmandIndex.RoutingPart value) { + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public Builder addMapIndex( + int index, net.osmand.binary.OsmandIndex.MapPart value) { if (value == null) { throw new NullPointerException(); } - result.routingIndex_.set(index, value); + ensureMapIndexIsMutable(); + mapIndex_.add(index, value); + return this; } - public Builder setRoutingIndex(int index, net.osmand.binary.OsmandIndex.RoutingPart.Builder builderForValue) { - result.routingIndex_.set(index, builderForValue.build()); + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public Builder addMapIndex( + net.osmand.binary.OsmandIndex.MapPart.Builder builderForValue) { + ensureMapIndexIsMutable(); + mapIndex_.add(builderForValue.build()); + return this; } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public Builder addMapIndex( + int index, net.osmand.binary.OsmandIndex.MapPart.Builder builderForValue) { + ensureMapIndexIsMutable(); + mapIndex_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public Builder addAllMapIndex( + java.lang.Iterable values) { + ensureMapIndexIsMutable(); + super.addAll(values, mapIndex_); + + return this; + } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public Builder clearMapIndex() { + mapIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + + return this; + } + /** + * repeated .OsmAnd.OBF.MapPart mapIndex = 11; + */ + public Builder removeMapIndex(int index) { + ensureMapIndexIsMutable(); + mapIndex_.remove(index); + + return this; + } + + // repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + private java.util.List routingIndex_ = + java.util.Collections.emptyList(); + private void ensureRoutingIndexIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + routingIndex_ = new java.util.ArrayList(routingIndex_); + bitField0_ |= 0x00000100; + } + } + + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public java.util.List getRoutingIndexList() { + return java.util.Collections.unmodifiableList(routingIndex_); + } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public int getRoutingIndexCount() { + return routingIndex_.size(); + } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public net.osmand.binary.OsmandIndex.RoutingPart getRoutingIndex(int index) { + return routingIndex_.get(index); + } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public Builder setRoutingIndex( + int index, net.osmand.binary.OsmandIndex.RoutingPart value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutingIndexIsMutable(); + routingIndex_.set(index, value); + + return this; + } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public Builder setRoutingIndex( + int index, net.osmand.binary.OsmandIndex.RoutingPart.Builder builderForValue) { + ensureRoutingIndexIsMutable(); + routingIndex_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ public Builder addRoutingIndex(net.osmand.binary.OsmandIndex.RoutingPart value) { if (value == null) { throw new NullPointerException(); } - if (result.routingIndex_.isEmpty()) { - result.routingIndex_ = new java.util.ArrayList(); - } - result.routingIndex_.add(value); + ensureRoutingIndexIsMutable(); + routingIndex_.add(value); + return this; } - public Builder addRoutingIndex(net.osmand.binary.OsmandIndex.RoutingPart.Builder builderForValue) { - if (result.routingIndex_.isEmpty()) { - result.routingIndex_ = new java.util.ArrayList(); + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public Builder addRoutingIndex( + int index, net.osmand.binary.OsmandIndex.RoutingPart value) { + if (value == null) { + throw new NullPointerException(); } - result.routingIndex_.add(builderForValue.build()); + ensureRoutingIndexIsMutable(); + routingIndex_.add(index, value); + return this; } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public Builder addRoutingIndex( + net.osmand.binary.OsmandIndex.RoutingPart.Builder builderForValue) { + ensureRoutingIndexIsMutable(); + routingIndex_.add(builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public Builder addRoutingIndex( + int index, net.osmand.binary.OsmandIndex.RoutingPart.Builder builderForValue) { + ensureRoutingIndexIsMutable(); + routingIndex_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ public Builder addAllRoutingIndex( java.lang.Iterable values) { - if (result.routingIndex_.isEmpty()) { - result.routingIndex_ = new java.util.ArrayList(); - } - super.addAll(values, result.routingIndex_); + ensureRoutingIndexIsMutable(); + super.addAll(values, routingIndex_); + return this; } + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ public Builder clearRoutingIndex() { - result.routingIndex_ = java.util.Collections.emptyList(); + routingIndex_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + return this; } - - // @@protoc_insertion_point(builder_scope:FileIndex) + /** + * repeated .OsmAnd.OBF.RoutingPart routingIndex = 12; + */ + public Builder removeRoutingIndex(int index) { + ensureRoutingIndexIsMutable(); + routingIndex_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.FileIndex) } - + static { defaultInstance = new FileIndex(true); - net.osmand.binary.OsmandIndex.internalForceInit(); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:FileIndex) + + // @@protoc_insertion_point(class_scope:OsmAnd.OBF.FileIndex) } - + + public interface AddressPartOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required int64 size = 1; + /** + * required int64 size = 1; + */ + boolean hasSize(); + /** + * required int64 size = 1; + */ + long getSize(); + + // required int64 offset = 2; + /** + * required int64 offset = 2; + */ + boolean hasOffset(); + /** + * required int64 offset = 2; + */ + long getOffset(); + + // optional string name = 3; + /** + * optional string name = 3; + */ + boolean hasName(); + /** + * optional string name = 3; + */ + java.lang.String getName(); + /** + * optional string name = 3; + */ + com.google.protobuf.ByteString + getNameBytes(); + + // optional string nameEn = 4; + /** + * optional string nameEn = 4; + */ + boolean hasNameEn(); + /** + * optional string nameEn = 4; + */ + java.lang.String getNameEn(); + /** + * optional string nameEn = 4; + */ + com.google.protobuf.ByteString + getNameEnBytes(); + + // optional int32 indexNameOffset = 5; + /** + * optional int32 indexNameOffset = 5; + */ + boolean hasIndexNameOffset(); + /** + * optional int32 indexNameOffset = 5; + */ + int getIndexNameOffset(); + + // repeated .OsmAnd.OBF.CityBlock cities = 8; + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + java.util.List + getCitiesList(); + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + net.osmand.binary.OsmandIndex.CityBlock getCities(int index); + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + int getCitiesCount(); + + // repeated string additionalTags = 9; + /** + * repeated string additionalTags = 9; + */ + java.util.List + getAdditionalTagsList(); + /** + * repeated string additionalTags = 9; + */ + int getAdditionalTagsCount(); + /** + * repeated string additionalTags = 9; + */ + java.lang.String getAdditionalTags(int index); + /** + * repeated string additionalTags = 9; + */ + com.google.protobuf.ByteString + getAdditionalTagsBytes(int index); + } + /** + * Protobuf type {@code OsmAnd.OBF.AddressPart} + */ public static final class AddressPart extends - com.google.protobuf.GeneratedMessageLite { + com.google.protobuf.GeneratedMessageLite + implements AddressPartOrBuilder { // Use AddressPart.newBuilder() to construct. - private AddressPart() { - initFields(); + private AddressPart(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + } private AddressPart(boolean noInit) {} - + private static final AddressPart defaultInstance; public static AddressPart getDefaultInstance() { return defaultInstance; } - + public AddressPart getDefaultInstanceForType() { return defaultInstance; } - + + private AddressPart( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + size_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + offset_ = input.readInt64(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + name_ = input.readBytes(); + break; + } + case 34: { + bitField0_ |= 0x00000008; + nameEn_ = input.readBytes(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + indexNameOffset_ = input.readInt32(); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + cities_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + cities_.add(input.readMessage(net.osmand.binary.OsmandIndex.CityBlock.PARSER, extensionRegistry)); + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + additionalTags_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000040; + } + additionalTags_.add(input.readBytes()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + cities_ = java.util.Collections.unmodifiableList(cities_); + } + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + additionalTags_ = new com.google.protobuf.UnmodifiableLazyStringList(additionalTags_); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public AddressPart parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddressPart(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; // required int64 size = 1; public static final int SIZE_FIELD_NUMBER = 1; - private boolean hasSize; - private long size_ = 0L; - public boolean hasSize() { return hasSize; } - public long getSize() { return size_; } - + private long size_; + /** + * required int64 size = 1; + */ + public boolean hasSize() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int64 size = 1; + */ + public long getSize() { + return size_; + } + // required int64 offset = 2; public static final int OFFSET_FIELD_NUMBER = 2; - private boolean hasOffset; - private long offset_ = 0L; - public boolean hasOffset() { return hasOffset; } - public long getOffset() { return offset_; } - + private long offset_; + /** + * required int64 offset = 2; + */ + public boolean hasOffset() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int64 offset = 2; + */ + public long getOffset() { + return offset_; + } + // optional string name = 3; public static final int NAME_FIELD_NUMBER = 3; - private boolean hasName; - private java.lang.String name_ = ""; - public boolean hasName() { return hasName; } - public java.lang.String getName() { return name_; } - + private java.lang.Object name_; + /** + * optional string name = 3; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string name = 3; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * optional string name = 3; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + // optional string nameEn = 4; public static final int NAMEEN_FIELD_NUMBER = 4; - private boolean hasNameEn; - private java.lang.String nameEn_ = ""; - public boolean hasNameEn() { return hasNameEn; } - public java.lang.String getNameEn() { return nameEn_; } - + private java.lang.Object nameEn_; + /** + * optional string nameEn = 4; + */ + public boolean hasNameEn() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string nameEn = 4; + */ + public java.lang.String getNameEn() { + java.lang.Object ref = nameEn_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + nameEn_ = s; + } + return s; + } + } + /** + * optional string nameEn = 4; + */ + public com.google.protobuf.ByteString + getNameEnBytes() { + java.lang.Object ref = nameEn_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nameEn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + // optional int32 indexNameOffset = 5; public static final int INDEXNAMEOFFSET_FIELD_NUMBER = 5; - private boolean hasIndexNameOffset; - private int indexNameOffset_ = 0; - public boolean hasIndexNameOffset() { return hasIndexNameOffset; } - public int getIndexNameOffset() { return indexNameOffset_; } - - // repeated .CityBlock cities = 8; + private int indexNameOffset_; + /** + * optional int32 indexNameOffset = 5; + */ + public boolean hasIndexNameOffset() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 indexNameOffset = 5; + */ + public int getIndexNameOffset() { + return indexNameOffset_; + } + + // repeated .OsmAnd.OBF.CityBlock cities = 8; public static final int CITIES_FIELD_NUMBER = 8; - private java.util.List cities_ = - java.util.Collections.emptyList(); + private java.util.List cities_; + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ public java.util.List getCitiesList() { return cities_; } - public int getCitiesCount() { return cities_.size(); } + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + public java.util.List + getCitiesOrBuilderList() { + return cities_; + } + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + public int getCitiesCount() { + return cities_.size(); + } + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ public net.osmand.binary.OsmandIndex.CityBlock getCities(int index) { return cities_.get(index); } - + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + public net.osmand.binary.OsmandIndex.CityBlockOrBuilder getCitiesOrBuilder( + int index) { + return cities_.get(index); + } + // repeated string additionalTags = 9; public static final int ADDITIONALTAGS_FIELD_NUMBER = 9; - private java.util.List additionalTags_ = - java.util.Collections.emptyList(); - public java.util.List getAdditionalTagsList() { + private com.google.protobuf.LazyStringList additionalTags_; + /** + * repeated string additionalTags = 9; + */ + public java.util.List + getAdditionalTagsList() { return additionalTags_; } - public int getAdditionalTagsCount() { return additionalTags_.size(); } + /** + * repeated string additionalTags = 9; + */ + public int getAdditionalTagsCount() { + return additionalTags_.size(); + } + /** + * repeated string additionalTags = 9; + */ public java.lang.String getAdditionalTags(int index) { return additionalTags_.get(index); } - - private void initFields() { + /** + * repeated string additionalTags = 9; + */ + public com.google.protobuf.ByteString + getAdditionalTagsBytes(int index) { + return additionalTags_.getByteString(index); } + + private void initFields() { + size_ = 0L; + offset_ = 0L; + name_ = ""; + nameEn_ = ""; + indexNameOffset_ = 0; + cities_ = java.util.Collections.emptyList(); + additionalTags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { - if (!hasSize) return false; - if (!hasOffset) return false; - for (net.osmand.binary.OsmandIndex.CityBlock element : getCitiesList()) { - if (!element.isInitialized()) return false; + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSize()) { + memoizedIsInitialized = 0; + return false; } + if (!hasOffset()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getCitiesCount(); i++) { + if (!getCities(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasSize()) { - output.writeInt64(1, getSize()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, size_); } - if (hasOffset()) { - output.writeInt64(2, getOffset()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, offset_); } - if (hasName()) { - output.writeString(3, getName()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getNameBytes()); } - if (hasNameEn()) { - output.writeString(4, getNameEn()); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(4, getNameEnBytes()); } - if (hasIndexNameOffset()) { - output.writeInt32(5, getIndexNameOffset()); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, indexNameOffset_); } - for (net.osmand.binary.OsmandIndex.CityBlock element : getCitiesList()) { - output.writeMessage(8, element); + for (int i = 0; i < cities_.size(); i++) { + output.writeMessage(8, cities_.get(i)); } - for (java.lang.String element : getAdditionalTagsList()) { - output.writeString(9, element); + for (int i = 0; i < additionalTags_.size(); i++) { + output.writeBytes(9, additionalTags_.getByteString(i)); } } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; - if (hasSize()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, getSize()); + .computeInt64Size(1, size_); } - if (hasOffset()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, getOffset()); + .computeInt64Size(2, offset_); } - if (hasName()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(3, getName()); + .computeBytesSize(3, getNameBytes()); } - if (hasNameEn()) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(4, getNameEn()); + .computeBytesSize(4, getNameEnBytes()); } - if (hasIndexNameOffset()) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, getIndexNameOffset()); + .computeInt32Size(5, indexNameOffset_); } - for (net.osmand.binary.OsmandIndex.CityBlock element : getCitiesList()) { + for (int i = 0; i < cities_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, element); + .computeMessageSize(8, cities_.get(i)); } { int dataSize = 0; - for (java.lang.String element : getAdditionalTagsList()) { + for (int i = 0; i < additionalTags_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream - .computeStringSizeNoTag(element); + .computeBytesSizeNoTag(additionalTags_.getByteString(i)); } size += dataSize; size += 1 * getAdditionalTagsList().size(); @@ -1366,153 +3012,166 @@ public final class OsmandIndex { memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static net.osmand.binary.OsmandIndex.AddressPart parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.AddressPart parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.AddressPart parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.AddressPart parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.AddressPart parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.AddressPart parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.AddressPart parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static net.osmand.binary.OsmandIndex.AddressPart parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.AddressPart parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.AddressPart parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(net.osmand.binary.OsmandIndex.AddressPart prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + + /** + * Protobuf type {@code OsmAnd.OBF.AddressPart} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - net.osmand.binary.OsmandIndex.AddressPart, Builder> { - private net.osmand.binary.OsmandIndex.AddressPart result; - + net.osmand.binary.OsmandIndex.AddressPart, Builder> + implements net.osmand.binary.OsmandIndex.AddressPartOrBuilder { // Construct using net.osmand.binary.OsmandIndex.AddressPart.newBuilder() - private Builder() {} - + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } private static Builder create() { - Builder builder = new Builder(); - builder.result = new net.osmand.binary.OsmandIndex.AddressPart(); - return builder; + return new Builder(); } - - protected net.osmand.binary.OsmandIndex.AddressPart internalGetResult() { - return result; - } - + public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new net.osmand.binary.OsmandIndex.AddressPart(); + super.clear(); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + nameEn_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + indexNameOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + cities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + additionalTags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000040); return this; } - + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - + public net.osmand.binary.OsmandIndex.AddressPart getDefaultInstanceForType() { return net.osmand.binary.OsmandIndex.AddressPart.getDefaultInstance(); } - - public boolean isInitialized() { - return result.isInitialized(); - } + public net.osmand.binary.OsmandIndex.AddressPart build() { - if (result != null && !isInitialized()) { + net.osmand.binary.OsmandIndex.AddressPart result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - - private net.osmand.binary.OsmandIndex.AddressPart buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - + public net.osmand.binary.OsmandIndex.AddressPart buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + net.osmand.binary.OsmandIndex.AddressPart result = new net.osmand.binary.OsmandIndex.AddressPart(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - if (result.cities_ != java.util.Collections.EMPTY_LIST) { - result.cities_ = - java.util.Collections.unmodifiableList(result.cities_); + result.size_ = size_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; } - if (result.additionalTags_ != java.util.Collections.EMPTY_LIST) { - result.additionalTags_ = - java.util.Collections.unmodifiableList(result.additionalTags_); + result.offset_ = offset_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; } - net.osmand.binary.OsmandIndex.AddressPart returnMe = result; - result = null; - return returnMe; + result.name_ = name_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.nameEn_ = nameEn_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.indexNameOffset_ = indexNameOffset_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + cities_ = java.util.Collections.unmodifiableList(cities_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.cities_ = cities_; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + additionalTags_ = new com.google.protobuf.UnmodifiableLazyStringList( + additionalTags_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.additionalTags_ = additionalTags_; + result.bitField0_ = to_bitField0_; + return result; } - + public Builder mergeFrom(net.osmand.binary.OsmandIndex.AddressPart other) { if (other == net.osmand.binary.OsmandIndex.AddressPart.getDefaultInstance()) return this; if (other.hasSize()) { @@ -1522,499 +3181,914 @@ public final class OsmandIndex { setOffset(other.getOffset()); } if (other.hasName()) { - setName(other.getName()); + bitField0_ |= 0x00000004; + name_ = other.name_; + } if (other.hasNameEn()) { - setNameEn(other.getNameEn()); + bitField0_ |= 0x00000008; + nameEn_ = other.nameEn_; + } if (other.hasIndexNameOffset()) { setIndexNameOffset(other.getIndexNameOffset()); } if (!other.cities_.isEmpty()) { - if (result.cities_.isEmpty()) { - result.cities_ = new java.util.ArrayList(); + if (cities_.isEmpty()) { + cities_ = other.cities_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureCitiesIsMutable(); + cities_.addAll(other.cities_); } - result.cities_.addAll(other.cities_); + } if (!other.additionalTags_.isEmpty()) { - if (result.additionalTags_.isEmpty()) { - result.additionalTags_ = new java.util.ArrayList(); + if (additionalTags_.isEmpty()) { + additionalTags_ = other.additionalTags_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureAdditionalTagsIsMutable(); + additionalTags_.addAll(other.additionalTags_); } - result.additionalTags_.addAll(other.additionalTags_); + } return this; } - + + public final boolean isInitialized() { + if (!hasSize()) { + + return false; + } + if (!hasOffset()) { + + return false; + } + for (int i = 0; i < getCitiesCount(); i++) { + if (!getCities(i).isInitialized()) { + + return false; + } + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setSize(input.readInt64()); - break; - } - case 16: { - setOffset(input.readInt64()); - break; - } - case 26: { - setName(input.readString()); - break; - } - case 34: { - setNameEn(input.readString()); - break; - } - case 40: { - setIndexNameOffset(input.readInt32()); - break; - } - case 66: { - net.osmand.binary.OsmandIndex.CityBlock.Builder subBuilder = net.osmand.binary.OsmandIndex.CityBlock.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addCities(subBuilder.buildPartial()); - break; - } - case 74: { - addAdditionalTags(input.readString()); - break; - } + net.osmand.binary.OsmandIndex.AddressPart parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (net.osmand.binary.OsmandIndex.AddressPart) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - - + private int bitField0_; + // required int64 size = 1; + private long size_ ; + /** + * required int64 size = 1; + */ public boolean hasSize() { - return result.hasSize(); + return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int64 size = 1; + */ public long getSize() { - return result.getSize(); + return size_; } + /** + * required int64 size = 1; + */ public Builder setSize(long value) { - result.hasSize = true; - result.size_ = value; + bitField0_ |= 0x00000001; + size_ = value; + return this; } + /** + * required int64 size = 1; + */ public Builder clearSize() { - result.hasSize = false; - result.size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + return this; } - + // required int64 offset = 2; + private long offset_ ; + /** + * required int64 offset = 2; + */ public boolean hasOffset() { - return result.hasOffset(); + return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required int64 offset = 2; + */ public long getOffset() { - return result.getOffset(); + return offset_; } + /** + * required int64 offset = 2; + */ public Builder setOffset(long value) { - result.hasOffset = true; - result.offset_ = value; + bitField0_ |= 0x00000002; + offset_ = value; + return this; } + /** + * required int64 offset = 2; + */ public Builder clearOffset() { - result.hasOffset = false; - result.offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + offset_ = 0L; + return this; } - + // optional string name = 3; + private java.lang.Object name_ = ""; + /** + * optional string name = 3; + */ public boolean hasName() { - return result.hasName(); + return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional string name = 3; + */ public java.lang.String getName() { - return result.getName(); + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - public Builder setName(java.lang.String value) { + /** + * optional string name = 3; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string name = 3; + */ + public Builder setName( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - result.hasName = true; - result.name_ = value; + bitField0_ |= 0x00000004; + name_ = value; + return this; } + /** + * optional string name = 3; + */ public Builder clearName() { - result.hasName = false; - result.name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + name_ = getDefaultInstance().getName(); + return this; } - - // optional string nameEn = 4; - public boolean hasNameEn() { - return result.hasNameEn(); - } - public java.lang.String getNameEn() { - return result.getNameEn(); - } - public Builder setNameEn(java.lang.String value) { + /** + * optional string name = 3; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - result.hasNameEn = true; - result.nameEn_ = value; + bitField0_ |= 0x00000004; + name_ = value; + return this; } + + // optional string nameEn = 4; + private java.lang.Object nameEn_ = ""; + /** + * optional string nameEn = 4; + */ + public boolean hasNameEn() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string nameEn = 4; + */ + public java.lang.String getNameEn() { + java.lang.Object ref = nameEn_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + nameEn_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string nameEn = 4; + */ + public com.google.protobuf.ByteString + getNameEnBytes() { + java.lang.Object ref = nameEn_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nameEn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string nameEn = 4; + */ + public Builder setNameEn( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + nameEn_ = value; + + return this; + } + /** + * optional string nameEn = 4; + */ public Builder clearNameEn() { - result.hasNameEn = false; - result.nameEn_ = getDefaultInstance().getNameEn(); + bitField0_ = (bitField0_ & ~0x00000008); + nameEn_ = getDefaultInstance().getNameEn(); + return this; } - + /** + * optional string nameEn = 4; + */ + public Builder setNameEnBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + nameEn_ = value; + + return this; + } + // optional int32 indexNameOffset = 5; + private int indexNameOffset_ ; + /** + * optional int32 indexNameOffset = 5; + */ public boolean hasIndexNameOffset() { - return result.hasIndexNameOffset(); + return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * optional int32 indexNameOffset = 5; + */ public int getIndexNameOffset() { - return result.getIndexNameOffset(); + return indexNameOffset_; } + /** + * optional int32 indexNameOffset = 5; + */ public Builder setIndexNameOffset(int value) { - result.hasIndexNameOffset = true; - result.indexNameOffset_ = value; + bitField0_ |= 0x00000010; + indexNameOffset_ = value; + return this; } + /** + * optional int32 indexNameOffset = 5; + */ public Builder clearIndexNameOffset() { - result.hasIndexNameOffset = false; - result.indexNameOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + indexNameOffset_ = 0; + return this; } - - // repeated .CityBlock cities = 8; + + // repeated .OsmAnd.OBF.CityBlock cities = 8; + private java.util.List cities_ = + java.util.Collections.emptyList(); + private void ensureCitiesIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + cities_ = new java.util.ArrayList(cities_); + bitField0_ |= 0x00000020; + } + } + + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ public java.util.List getCitiesList() { - return java.util.Collections.unmodifiableList(result.cities_); + return java.util.Collections.unmodifiableList(cities_); } + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ public int getCitiesCount() { - return result.getCitiesCount(); + return cities_.size(); } + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ public net.osmand.binary.OsmandIndex.CityBlock getCities(int index) { - return result.getCities(index); + return cities_.get(index); } - public Builder setCities(int index, net.osmand.binary.OsmandIndex.CityBlock value) { + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + public Builder setCities( + int index, net.osmand.binary.OsmandIndex.CityBlock value) { if (value == null) { throw new NullPointerException(); } - result.cities_.set(index, value); + ensureCitiesIsMutable(); + cities_.set(index, value); + return this; } - public Builder setCities(int index, net.osmand.binary.OsmandIndex.CityBlock.Builder builderForValue) { - result.cities_.set(index, builderForValue.build()); + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + public Builder setCities( + int index, net.osmand.binary.OsmandIndex.CityBlock.Builder builderForValue) { + ensureCitiesIsMutable(); + cities_.set(index, builderForValue.build()); + return this; } + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ public Builder addCities(net.osmand.binary.OsmandIndex.CityBlock value) { if (value == null) { throw new NullPointerException(); } - if (result.cities_.isEmpty()) { - result.cities_ = new java.util.ArrayList(); - } - result.cities_.add(value); + ensureCitiesIsMutable(); + cities_.add(value); + return this; } - public Builder addCities(net.osmand.binary.OsmandIndex.CityBlock.Builder builderForValue) { - if (result.cities_.isEmpty()) { - result.cities_ = new java.util.ArrayList(); + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + public Builder addCities( + int index, net.osmand.binary.OsmandIndex.CityBlock value) { + if (value == null) { + throw new NullPointerException(); } - result.cities_.add(builderForValue.build()); + ensureCitiesIsMutable(); + cities_.add(index, value); + return this; } + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + public Builder addCities( + net.osmand.binary.OsmandIndex.CityBlock.Builder builderForValue) { + ensureCitiesIsMutable(); + cities_.add(builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + public Builder addCities( + int index, net.osmand.binary.OsmandIndex.CityBlock.Builder builderForValue) { + ensureCitiesIsMutable(); + cities_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ public Builder addAllCities( java.lang.Iterable values) { - if (result.cities_.isEmpty()) { - result.cities_ = new java.util.ArrayList(); - } - super.addAll(values, result.cities_); + ensureCitiesIsMutable(); + super.addAll(values, cities_); + return this; } + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ public Builder clearCities() { - result.cities_ = java.util.Collections.emptyList(); + cities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + return this; } - + /** + * repeated .OsmAnd.OBF.CityBlock cities = 8; + */ + public Builder removeCities(int index) { + ensureCitiesIsMutable(); + cities_.remove(index); + + return this; + } + // repeated string additionalTags = 9; - public java.util.List getAdditionalTagsList() { - return java.util.Collections.unmodifiableList(result.additionalTags_); + private com.google.protobuf.LazyStringList additionalTags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureAdditionalTagsIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + additionalTags_ = new com.google.protobuf.LazyStringArrayList(additionalTags_); + bitField0_ |= 0x00000040; + } } + /** + * repeated string additionalTags = 9; + */ + public java.util.List + getAdditionalTagsList() { + return java.util.Collections.unmodifiableList(additionalTags_); + } + /** + * repeated string additionalTags = 9; + */ public int getAdditionalTagsCount() { - return result.getAdditionalTagsCount(); + return additionalTags_.size(); } + /** + * repeated string additionalTags = 9; + */ public java.lang.String getAdditionalTags(int index) { - return result.getAdditionalTags(index); + return additionalTags_.get(index); } - public Builder setAdditionalTags(int index, java.lang.String value) { + /** + * repeated string additionalTags = 9; + */ + public com.google.protobuf.ByteString + getAdditionalTagsBytes(int index) { + return additionalTags_.getByteString(index); + } + /** + * repeated string additionalTags = 9; + */ + public Builder setAdditionalTags( + int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } - result.additionalTags_.set(index, value); + ensureAdditionalTagsIsMutable(); + additionalTags_.set(index, value); + return this; } - public Builder addAdditionalTags(java.lang.String value) { + /** + * repeated string additionalTags = 9; + */ + public Builder addAdditionalTags( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - if (result.additionalTags_.isEmpty()) { - result.additionalTags_ = new java.util.ArrayList(); - } - result.additionalTags_.add(value); + ensureAdditionalTagsIsMutable(); + additionalTags_.add(value); + return this; } + /** + * repeated string additionalTags = 9; + */ public Builder addAllAdditionalTags( - java.lang.Iterable values) { - if (result.additionalTags_.isEmpty()) { - result.additionalTags_ = new java.util.ArrayList(); - } - super.addAll(values, result.additionalTags_); + java.lang.Iterable values) { + ensureAdditionalTagsIsMutable(); + super.addAll(values, additionalTags_); + return this; } + /** + * repeated string additionalTags = 9; + */ public Builder clearAdditionalTags() { - result.additionalTags_ = java.util.Collections.emptyList(); + additionalTags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000040); + return this; } - - // @@protoc_insertion_point(builder_scope:AddressPart) + /** + * repeated string additionalTags = 9; + */ + public Builder addAdditionalTagsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalTagsIsMutable(); + additionalTags_.add(value); + + return this; + } + + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.AddressPart) } - + static { defaultInstance = new AddressPart(true); - net.osmand.binary.OsmandIndex.internalForceInit(); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:AddressPart) + + // @@protoc_insertion_point(class_scope:OsmAnd.OBF.AddressPart) } - + + public interface CityBlockOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required int64 size = 1; + /** + * required int64 size = 1; + */ + boolean hasSize(); + /** + * required int64 size = 1; + */ + long getSize(); + + // required int64 offset = 2; + /** + * required int64 offset = 2; + */ + boolean hasOffset(); + /** + * required int64 offset = 2; + */ + long getOffset(); + + // required int32 type = 3; + /** + * required int32 type = 3; + */ + boolean hasType(); + /** + * required int32 type = 3; + */ + int getType(); + } + /** + * Protobuf type {@code OsmAnd.OBF.CityBlock} + */ public static final class CityBlock extends - com.google.protobuf.GeneratedMessageLite { + com.google.protobuf.GeneratedMessageLite + implements CityBlockOrBuilder { // Use CityBlock.newBuilder() to construct. - private CityBlock() { - initFields(); + private CityBlock(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + } private CityBlock(boolean noInit) {} - + private static final CityBlock defaultInstance; public static CityBlock getDefaultInstance() { return defaultInstance; } - + public CityBlock getDefaultInstanceForType() { return defaultInstance; } - + + private CityBlock( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + size_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + offset_ = input.readInt64(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + type_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public CityBlock parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CityBlock(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; // required int64 size = 1; public static final int SIZE_FIELD_NUMBER = 1; - private boolean hasSize; - private long size_ = 0L; - public boolean hasSize() { return hasSize; } - public long getSize() { return size_; } - + private long size_; + /** + * required int64 size = 1; + */ + public boolean hasSize() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int64 size = 1; + */ + public long getSize() { + return size_; + } + // required int64 offset = 2; public static final int OFFSET_FIELD_NUMBER = 2; - private boolean hasOffset; - private long offset_ = 0L; - public boolean hasOffset() { return hasOffset; } - public long getOffset() { return offset_; } - + private long offset_; + /** + * required int64 offset = 2; + */ + public boolean hasOffset() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int64 offset = 2; + */ + public long getOffset() { + return offset_; + } + // required int32 type = 3; public static final int TYPE_FIELD_NUMBER = 3; - private boolean hasType; - private int type_ = 0; - public boolean hasType() { return hasType; } - public int getType() { return type_; } - - private void initFields() { + private int type_; + /** + * required int32 type = 3; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * required int32 type = 3; + */ + public int getType() { + return type_; + } + + private void initFields() { + size_ = 0L; + offset_ = 0L; + type_ = 0; + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { - if (!hasSize) return false; - if (!hasOffset) return false; - if (!hasType) return false; + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSize()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasOffset()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasType()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasSize()) { - output.writeInt64(1, getSize()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, size_); } - if (hasOffset()) { - output.writeInt64(2, getOffset()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, offset_); } - if (hasType()) { - output.writeInt32(3, getType()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(3, type_); } } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; - if (hasSize()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, getSize()); + .computeInt64Size(1, size_); } - if (hasOffset()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, getOffset()); + .computeInt64Size(2, offset_); } - if (hasType()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, getType()); + .computeInt32Size(3, type_); } memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static net.osmand.binary.OsmandIndex.CityBlock parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.CityBlock parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.CityBlock parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.CityBlock parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.CityBlock parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.CityBlock parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.CityBlock parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static net.osmand.binary.OsmandIndex.CityBlock parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.CityBlock parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.CityBlock parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(net.osmand.binary.OsmandIndex.CityBlock prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + + /** + * Protobuf type {@code OsmAnd.OBF.CityBlock} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - net.osmand.binary.OsmandIndex.CityBlock, Builder> { - private net.osmand.binary.OsmandIndex.CityBlock result; - + net.osmand.binary.OsmandIndex.CityBlock, Builder> + implements net.osmand.binary.OsmandIndex.CityBlockOrBuilder { // Construct using net.osmand.binary.OsmandIndex.CityBlock.newBuilder() - private Builder() {} - + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } private static Builder create() { - Builder builder = new Builder(); - builder.result = new net.osmand.binary.OsmandIndex.CityBlock(); - return builder; + return new Builder(); } - - protected net.osmand.binary.OsmandIndex.CityBlock internalGetResult() { - return result; - } - + public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new net.osmand.binary.OsmandIndex.CityBlock(); + super.clear(); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + type_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); return this; } - + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - + public net.osmand.binary.OsmandIndex.CityBlock getDefaultInstanceForType() { return net.osmand.binary.OsmandIndex.CityBlock.getDefaultInstance(); } - - public boolean isInitialized() { - return result.isInitialized(); - } + public net.osmand.binary.OsmandIndex.CityBlock build() { - if (result != null && !isInitialized()) { + net.osmand.binary.OsmandIndex.CityBlock result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - - private net.osmand.binary.OsmandIndex.CityBlock buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - + public net.osmand.binary.OsmandIndex.CityBlock buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + net.osmand.binary.OsmandIndex.CityBlock result = new net.osmand.binary.OsmandIndex.CityBlock(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - net.osmand.binary.OsmandIndex.CityBlock returnMe = result; - result = null; - return returnMe; + result.size_ = size_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.offset_ = offset_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.type_ = type_; + result.bitField0_ = to_bitField0_; + return result; } - + public Builder mergeFrom(net.osmand.binary.OsmandIndex.CityBlock other) { if (other == net.osmand.binary.OsmandIndex.CityBlock.getDefaultInstance()) return this; if (other.hasSize()) { @@ -2028,385 +4102,736 @@ public final class OsmandIndex { } return this; } - + + public final boolean isInitialized() { + if (!hasSize()) { + + return false; + } + if (!hasOffset()) { + + return false; + } + if (!hasType()) { + + return false; + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setSize(input.readInt64()); - break; - } - case 16: { - setOffset(input.readInt64()); - break; - } - case 24: { - setType(input.readInt32()); - break; - } + net.osmand.binary.OsmandIndex.CityBlock parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (net.osmand.binary.OsmandIndex.CityBlock) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - - + private int bitField0_; + // required int64 size = 1; + private long size_ ; + /** + * required int64 size = 1; + */ public boolean hasSize() { - return result.hasSize(); + return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int64 size = 1; + */ public long getSize() { - return result.getSize(); + return size_; } + /** + * required int64 size = 1; + */ public Builder setSize(long value) { - result.hasSize = true; - result.size_ = value; + bitField0_ |= 0x00000001; + size_ = value; + return this; } + /** + * required int64 size = 1; + */ public Builder clearSize() { - result.hasSize = false; - result.size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + return this; } - + // required int64 offset = 2; + private long offset_ ; + /** + * required int64 offset = 2; + */ public boolean hasOffset() { - return result.hasOffset(); + return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required int64 offset = 2; + */ public long getOffset() { - return result.getOffset(); + return offset_; } + /** + * required int64 offset = 2; + */ public Builder setOffset(long value) { - result.hasOffset = true; - result.offset_ = value; + bitField0_ |= 0x00000002; + offset_ = value; + return this; } + /** + * required int64 offset = 2; + */ public Builder clearOffset() { - result.hasOffset = false; - result.offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + offset_ = 0L; + return this; } - + // required int32 type = 3; + private int type_ ; + /** + * required int32 type = 3; + */ public boolean hasType() { - return result.hasType(); + return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * required int32 type = 3; + */ public int getType() { - return result.getType(); + return type_; } + /** + * required int32 type = 3; + */ public Builder setType(int value) { - result.hasType = true; - result.type_ = value; + bitField0_ |= 0x00000004; + type_ = value; + return this; } + /** + * required int32 type = 3; + */ public Builder clearType() { - result.hasType = false; - result.type_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + type_ = 0; + return this; } - - // @@protoc_insertion_point(builder_scope:CityBlock) + + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.CityBlock) } - + static { defaultInstance = new CityBlock(true); - net.osmand.binary.OsmandIndex.internalForceInit(); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:CityBlock) + + // @@protoc_insertion_point(class_scope:OsmAnd.OBF.CityBlock) } - + + public interface PoiPartOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required int64 size = 1; + /** + * required int64 size = 1; + */ + boolean hasSize(); + /** + * required int64 size = 1; + */ + long getSize(); + + // required int64 offset = 2; + /** + * required int64 offset = 2; + */ + boolean hasOffset(); + /** + * required int64 offset = 2; + */ + long getOffset(); + + // optional string name = 3; + /** + * optional string name = 3; + */ + boolean hasName(); + /** + * optional string name = 3; + */ + java.lang.String getName(); + /** + * optional string name = 3; + */ + com.google.protobuf.ByteString + getNameBytes(); + + // required int32 left = 4; + /** + * required int32 left = 4; + */ + boolean hasLeft(); + /** + * required int32 left = 4; + */ + int getLeft(); + + // required int32 right = 5; + /** + * required int32 right = 5; + */ + boolean hasRight(); + /** + * required int32 right = 5; + */ + int getRight(); + + // required int32 top = 6; + /** + * required int32 top = 6; + */ + boolean hasTop(); + /** + * required int32 top = 6; + */ + int getTop(); + + // required int32 bottom = 7; + /** + * required int32 bottom = 7; + */ + boolean hasBottom(); + /** + * required int32 bottom = 7; + */ + int getBottom(); + } + /** + * Protobuf type {@code OsmAnd.OBF.PoiPart} + */ public static final class PoiPart extends - com.google.protobuf.GeneratedMessageLite { + com.google.protobuf.GeneratedMessageLite + implements PoiPartOrBuilder { // Use PoiPart.newBuilder() to construct. - private PoiPart() { - initFields(); + private PoiPart(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + } private PoiPart(boolean noInit) {} - + private static final PoiPart defaultInstance; public static PoiPart getDefaultInstance() { return defaultInstance; } - + public PoiPart getDefaultInstanceForType() { return defaultInstance; } - + + private PoiPart( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + size_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + offset_ = input.readInt64(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + name_ = input.readBytes(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + left_ = input.readInt32(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + right_ = input.readInt32(); + break; + } + case 48: { + bitField0_ |= 0x00000020; + top_ = input.readInt32(); + break; + } + case 56: { + bitField0_ |= 0x00000040; + bottom_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public PoiPart parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PoiPart(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; // required int64 size = 1; public static final int SIZE_FIELD_NUMBER = 1; - private boolean hasSize; - private long size_ = 0L; - public boolean hasSize() { return hasSize; } - public long getSize() { return size_; } - + private long size_; + /** + * required int64 size = 1; + */ + public boolean hasSize() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int64 size = 1; + */ + public long getSize() { + return size_; + } + // required int64 offset = 2; public static final int OFFSET_FIELD_NUMBER = 2; - private boolean hasOffset; - private long offset_ = 0L; - public boolean hasOffset() { return hasOffset; } - public long getOffset() { return offset_; } - + private long offset_; + /** + * required int64 offset = 2; + */ + public boolean hasOffset() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int64 offset = 2; + */ + public long getOffset() { + return offset_; + } + // optional string name = 3; public static final int NAME_FIELD_NUMBER = 3; - private boolean hasName; - private java.lang.String name_ = ""; - public boolean hasName() { return hasName; } - public java.lang.String getName() { return name_; } - + private java.lang.Object name_; + /** + * optional string name = 3; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string name = 3; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * optional string name = 3; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + // required int32 left = 4; public static final int LEFT_FIELD_NUMBER = 4; - private boolean hasLeft; - private int left_ = 0; - public boolean hasLeft() { return hasLeft; } - public int getLeft() { return left_; } - + private int left_; + /** + * required int32 left = 4; + */ + public boolean hasLeft() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required int32 left = 4; + */ + public int getLeft() { + return left_; + } + // required int32 right = 5; public static final int RIGHT_FIELD_NUMBER = 5; - private boolean hasRight; - private int right_ = 0; - public boolean hasRight() { return hasRight; } - public int getRight() { return right_; } - + private int right_; + /** + * required int32 right = 5; + */ + public boolean hasRight() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * required int32 right = 5; + */ + public int getRight() { + return right_; + } + // required int32 top = 6; public static final int TOP_FIELD_NUMBER = 6; - private boolean hasTop; - private int top_ = 0; - public boolean hasTop() { return hasTop; } - public int getTop() { return top_; } - + private int top_; + /** + * required int32 top = 6; + */ + public boolean hasTop() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * required int32 top = 6; + */ + public int getTop() { + return top_; + } + // required int32 bottom = 7; public static final int BOTTOM_FIELD_NUMBER = 7; - private boolean hasBottom; - private int bottom_ = 0; - public boolean hasBottom() { return hasBottom; } - public int getBottom() { return bottom_; } - - private void initFields() { + private int bottom_; + /** + * required int32 bottom = 7; + */ + public boolean hasBottom() { + return ((bitField0_ & 0x00000040) == 0x00000040); } + /** + * required int32 bottom = 7; + */ + public int getBottom() { + return bottom_; + } + + private void initFields() { + size_ = 0L; + offset_ = 0L; + name_ = ""; + left_ = 0; + right_ = 0; + top_ = 0; + bottom_ = 0; + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { - if (!hasSize) return false; - if (!hasOffset) return false; - if (!hasLeft) return false; - if (!hasRight) return false; - if (!hasTop) return false; - if (!hasBottom) return false; + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSize()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasOffset()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasLeft()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRight()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTop()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasBottom()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasSize()) { - output.writeInt64(1, getSize()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, size_); } - if (hasOffset()) { - output.writeInt64(2, getOffset()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, offset_); } - if (hasName()) { - output.writeString(3, getName()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getNameBytes()); } - if (hasLeft()) { - output.writeInt32(4, getLeft()); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, left_); } - if (hasRight()) { - output.writeInt32(5, getRight()); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, right_); } - if (hasTop()) { - output.writeInt32(6, getTop()); + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(6, top_); } - if (hasBottom()) { - output.writeInt32(7, getBottom()); + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(7, bottom_); } } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; - if (hasSize()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, getSize()); + .computeInt64Size(1, size_); } - if (hasOffset()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, getOffset()); + .computeInt64Size(2, offset_); } - if (hasName()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(3, getName()); + .computeBytesSize(3, getNameBytes()); } - if (hasLeft()) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, getLeft()); + .computeInt32Size(4, left_); } - if (hasRight()) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, getRight()); + .computeInt32Size(5, right_); } - if (hasTop()) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, getTop()); + .computeInt32Size(6, top_); } - if (hasBottom()) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, getBottom()); + .computeInt32Size(7, bottom_); } memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static net.osmand.binary.OsmandIndex.PoiPart parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.PoiPart parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.PoiPart parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.PoiPart parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.PoiPart parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.PoiPart parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.PoiPart parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static net.osmand.binary.OsmandIndex.PoiPart parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.PoiPart parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.PoiPart parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(net.osmand.binary.OsmandIndex.PoiPart prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + + /** + * Protobuf type {@code OsmAnd.OBF.PoiPart} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - net.osmand.binary.OsmandIndex.PoiPart, Builder> { - private net.osmand.binary.OsmandIndex.PoiPart result; - + net.osmand.binary.OsmandIndex.PoiPart, Builder> + implements net.osmand.binary.OsmandIndex.PoiPartOrBuilder { // Construct using net.osmand.binary.OsmandIndex.PoiPart.newBuilder() - private Builder() {} - + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } private static Builder create() { - Builder builder = new Builder(); - builder.result = new net.osmand.binary.OsmandIndex.PoiPart(); - return builder; + return new Builder(); } - - protected net.osmand.binary.OsmandIndex.PoiPart internalGetResult() { - return result; - } - + public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new net.osmand.binary.OsmandIndex.PoiPart(); + super.clear(); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + left_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + right_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + top_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + bottom_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); return this; } - + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - + public net.osmand.binary.OsmandIndex.PoiPart getDefaultInstanceForType() { return net.osmand.binary.OsmandIndex.PoiPart.getDefaultInstance(); } - - public boolean isInitialized() { - return result.isInitialized(); - } + public net.osmand.binary.OsmandIndex.PoiPart build() { - if (result != null && !isInitialized()) { + net.osmand.binary.OsmandIndex.PoiPart result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - - private net.osmand.binary.OsmandIndex.PoiPart buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - + public net.osmand.binary.OsmandIndex.PoiPart buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + net.osmand.binary.OsmandIndex.PoiPart result = new net.osmand.binary.OsmandIndex.PoiPart(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - net.osmand.binary.OsmandIndex.PoiPart returnMe = result; - result = null; - return returnMe; + result.size_ = size_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.offset_ = offset_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.left_ = left_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.right_ = right_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.top_ = top_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.bottom_ = bottom_; + result.bitField0_ = to_bitField0_; + return result; } - + public Builder mergeFrom(net.osmand.binary.OsmandIndex.PoiPart other) { if (other == net.osmand.binary.OsmandIndex.PoiPart.getDefaultInstance()) return this; if (other.hasSize()) { @@ -2416,7 +4841,9 @@ public final class OsmandIndex { setOffset(other.getOffset()); } if (other.hasName()) { - setName(other.getName()); + bitField0_ |= 0x00000004; + name_ = other.name_; + } if (other.hasLeft()) { setLeft(other.getLeft()); @@ -2432,490 +4859,934 @@ public final class OsmandIndex { } return this; } - + + public final boolean isInitialized() { + if (!hasSize()) { + + return false; + } + if (!hasOffset()) { + + return false; + } + if (!hasLeft()) { + + return false; + } + if (!hasRight()) { + + return false; + } + if (!hasTop()) { + + return false; + } + if (!hasBottom()) { + + return false; + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setSize(input.readInt64()); - break; - } - case 16: { - setOffset(input.readInt64()); - break; - } - case 26: { - setName(input.readString()); - break; - } - case 32: { - setLeft(input.readInt32()); - break; - } - case 40: { - setRight(input.readInt32()); - break; - } - case 48: { - setTop(input.readInt32()); - break; - } - case 56: { - setBottom(input.readInt32()); - break; - } + net.osmand.binary.OsmandIndex.PoiPart parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (net.osmand.binary.OsmandIndex.PoiPart) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - - + private int bitField0_; + // required int64 size = 1; + private long size_ ; + /** + * required int64 size = 1; + */ public boolean hasSize() { - return result.hasSize(); + return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int64 size = 1; + */ public long getSize() { - return result.getSize(); + return size_; } + /** + * required int64 size = 1; + */ public Builder setSize(long value) { - result.hasSize = true; - result.size_ = value; + bitField0_ |= 0x00000001; + size_ = value; + return this; } + /** + * required int64 size = 1; + */ public Builder clearSize() { - result.hasSize = false; - result.size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + return this; } - + // required int64 offset = 2; + private long offset_ ; + /** + * required int64 offset = 2; + */ public boolean hasOffset() { - return result.hasOffset(); + return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required int64 offset = 2; + */ public long getOffset() { - return result.getOffset(); + return offset_; } + /** + * required int64 offset = 2; + */ public Builder setOffset(long value) { - result.hasOffset = true; - result.offset_ = value; + bitField0_ |= 0x00000002; + offset_ = value; + return this; } + /** + * required int64 offset = 2; + */ public Builder clearOffset() { - result.hasOffset = false; - result.offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + offset_ = 0L; + return this; } - + // optional string name = 3; + private java.lang.Object name_ = ""; + /** + * optional string name = 3; + */ public boolean hasName() { - return result.hasName(); + return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional string name = 3; + */ public java.lang.String getName() { - return result.getName(); + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - public Builder setName(java.lang.String value) { + /** + * optional string name = 3; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string name = 3; + */ + public Builder setName( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - result.hasName = true; - result.name_ = value; + bitField0_ |= 0x00000004; + name_ = value; + return this; } + /** + * optional string name = 3; + */ public Builder clearName() { - result.hasName = false; - result.name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + name_ = getDefaultInstance().getName(); + return this; } - + /** + * optional string name = 3; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + name_ = value; + + return this; + } + // required int32 left = 4; + private int left_ ; + /** + * required int32 left = 4; + */ public boolean hasLeft() { - return result.hasLeft(); + return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * required int32 left = 4; + */ public int getLeft() { - return result.getLeft(); + return left_; } + /** + * required int32 left = 4; + */ public Builder setLeft(int value) { - result.hasLeft = true; - result.left_ = value; + bitField0_ |= 0x00000008; + left_ = value; + return this; } + /** + * required int32 left = 4; + */ public Builder clearLeft() { - result.hasLeft = false; - result.left_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + left_ = 0; + return this; } - + // required int32 right = 5; + private int right_ ; + /** + * required int32 right = 5; + */ public boolean hasRight() { - return result.hasRight(); + return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * required int32 right = 5; + */ public int getRight() { - return result.getRight(); + return right_; } + /** + * required int32 right = 5; + */ public Builder setRight(int value) { - result.hasRight = true; - result.right_ = value; + bitField0_ |= 0x00000010; + right_ = value; + return this; } + /** + * required int32 right = 5; + */ public Builder clearRight() { - result.hasRight = false; - result.right_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + right_ = 0; + return this; } - + // required int32 top = 6; + private int top_ ; + /** + * required int32 top = 6; + */ public boolean hasTop() { - return result.hasTop(); + return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * required int32 top = 6; + */ public int getTop() { - return result.getTop(); + return top_; } + /** + * required int32 top = 6; + */ public Builder setTop(int value) { - result.hasTop = true; - result.top_ = value; + bitField0_ |= 0x00000020; + top_ = value; + return this; } + /** + * required int32 top = 6; + */ public Builder clearTop() { - result.hasTop = false; - result.top_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + top_ = 0; + return this; } - + // required int32 bottom = 7; + private int bottom_ ; + /** + * required int32 bottom = 7; + */ public boolean hasBottom() { - return result.hasBottom(); + return ((bitField0_ & 0x00000040) == 0x00000040); } + /** + * required int32 bottom = 7; + */ public int getBottom() { - return result.getBottom(); + return bottom_; } + /** + * required int32 bottom = 7; + */ public Builder setBottom(int value) { - result.hasBottom = true; - result.bottom_ = value; + bitField0_ |= 0x00000040; + bottom_ = value; + return this; } + /** + * required int32 bottom = 7; + */ public Builder clearBottom() { - result.hasBottom = false; - result.bottom_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + bottom_ = 0; + return this; } - - // @@protoc_insertion_point(builder_scope:PoiPart) + + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.PoiPart) } - + static { defaultInstance = new PoiPart(true); - net.osmand.binary.OsmandIndex.internalForceInit(); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:PoiPart) + + // @@protoc_insertion_point(class_scope:OsmAnd.OBF.PoiPart) } - + + public interface MapLevelOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required int64 size = 1; + /** + * required int64 size = 1; + */ + boolean hasSize(); + /** + * required int64 size = 1; + */ + long getSize(); + + // required int64 offset = 2; + /** + * required int64 offset = 2; + */ + boolean hasOffset(); + /** + * required int64 offset = 2; + */ + long getOffset(); + + // required int32 left = 4; + /** + * required int32 left = 4; + */ + boolean hasLeft(); + /** + * required int32 left = 4; + */ + int getLeft(); + + // required int32 right = 5; + /** + * required int32 right = 5; + */ + boolean hasRight(); + /** + * required int32 right = 5; + */ + int getRight(); + + // required int32 top = 6; + /** + * required int32 top = 6; + */ + boolean hasTop(); + /** + * required int32 top = 6; + */ + int getTop(); + + // required int32 bottom = 7; + /** + * required int32 bottom = 7; + */ + boolean hasBottom(); + /** + * required int32 bottom = 7; + */ + int getBottom(); + + // optional int32 minzoom = 8; + /** + * optional int32 minzoom = 8; + */ + boolean hasMinzoom(); + /** + * optional int32 minzoom = 8; + */ + int getMinzoom(); + + // optional int32 maxzoom = 9; + /** + * optional int32 maxzoom = 9; + */ + boolean hasMaxzoom(); + /** + * optional int32 maxzoom = 9; + */ + int getMaxzoom(); + } + /** + * Protobuf type {@code OsmAnd.OBF.MapLevel} + */ public static final class MapLevel extends - com.google.protobuf.GeneratedMessageLite { + com.google.protobuf.GeneratedMessageLite + implements MapLevelOrBuilder { // Use MapLevel.newBuilder() to construct. - private MapLevel() { - initFields(); + private MapLevel(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + } private MapLevel(boolean noInit) {} - + private static final MapLevel defaultInstance; public static MapLevel getDefaultInstance() { return defaultInstance; } - + public MapLevel getDefaultInstanceForType() { return defaultInstance; } - + + private MapLevel( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + size_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + offset_ = input.readInt64(); + break; + } + case 32: { + bitField0_ |= 0x00000004; + left_ = input.readInt32(); + break; + } + case 40: { + bitField0_ |= 0x00000008; + right_ = input.readInt32(); + break; + } + case 48: { + bitField0_ |= 0x00000010; + top_ = input.readInt32(); + break; + } + case 56: { + bitField0_ |= 0x00000020; + bottom_ = input.readInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000040; + minzoom_ = input.readInt32(); + break; + } + case 72: { + bitField0_ |= 0x00000080; + maxzoom_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public MapLevel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MapLevel(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; // required int64 size = 1; public static final int SIZE_FIELD_NUMBER = 1; - private boolean hasSize; - private long size_ = 0L; - public boolean hasSize() { return hasSize; } - public long getSize() { return size_; } - + private long size_; + /** + * required int64 size = 1; + */ + public boolean hasSize() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int64 size = 1; + */ + public long getSize() { + return size_; + } + // required int64 offset = 2; public static final int OFFSET_FIELD_NUMBER = 2; - private boolean hasOffset; - private long offset_ = 0L; - public boolean hasOffset() { return hasOffset; } - public long getOffset() { return offset_; } - + private long offset_; + /** + * required int64 offset = 2; + */ + public boolean hasOffset() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int64 offset = 2; + */ + public long getOffset() { + return offset_; + } + // required int32 left = 4; public static final int LEFT_FIELD_NUMBER = 4; - private boolean hasLeft; - private int left_ = 0; - public boolean hasLeft() { return hasLeft; } - public int getLeft() { return left_; } - + private int left_; + /** + * required int32 left = 4; + */ + public boolean hasLeft() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required int32 left = 4; + */ + public int getLeft() { + return left_; + } + // required int32 right = 5; public static final int RIGHT_FIELD_NUMBER = 5; - private boolean hasRight; - private int right_ = 0; - public boolean hasRight() { return hasRight; } - public int getRight() { return right_; } - + private int right_; + /** + * required int32 right = 5; + */ + public boolean hasRight() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required int32 right = 5; + */ + public int getRight() { + return right_; + } + // required int32 top = 6; public static final int TOP_FIELD_NUMBER = 6; - private boolean hasTop; - private int top_ = 0; - public boolean hasTop() { return hasTop; } - public int getTop() { return top_; } - + private int top_; + /** + * required int32 top = 6; + */ + public boolean hasTop() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * required int32 top = 6; + */ + public int getTop() { + return top_; + } + // required int32 bottom = 7; public static final int BOTTOM_FIELD_NUMBER = 7; - private boolean hasBottom; - private int bottom_ = 0; - public boolean hasBottom() { return hasBottom; } - public int getBottom() { return bottom_; } - + private int bottom_; + /** + * required int32 bottom = 7; + */ + public boolean hasBottom() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * required int32 bottom = 7; + */ + public int getBottom() { + return bottom_; + } + // optional int32 minzoom = 8; public static final int MINZOOM_FIELD_NUMBER = 8; - private boolean hasMinzoom; - private int minzoom_ = 0; - public boolean hasMinzoom() { return hasMinzoom; } - public int getMinzoom() { return minzoom_; } - + private int minzoom_; + /** + * optional int32 minzoom = 8; + */ + public boolean hasMinzoom() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 minzoom = 8; + */ + public int getMinzoom() { + return minzoom_; + } + // optional int32 maxzoom = 9; public static final int MAXZOOM_FIELD_NUMBER = 9; - private boolean hasMaxzoom; - private int maxzoom_ = 0; - public boolean hasMaxzoom() { return hasMaxzoom; } - public int getMaxzoom() { return maxzoom_; } - - private void initFields() { + private int maxzoom_; + /** + * optional int32 maxzoom = 9; + */ + public boolean hasMaxzoom() { + return ((bitField0_ & 0x00000080) == 0x00000080); } + /** + * optional int32 maxzoom = 9; + */ + public int getMaxzoom() { + return maxzoom_; + } + + private void initFields() { + size_ = 0L; + offset_ = 0L; + left_ = 0; + right_ = 0; + top_ = 0; + bottom_ = 0; + minzoom_ = 0; + maxzoom_ = 0; + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { - if (!hasSize) return false; - if (!hasOffset) return false; - if (!hasLeft) return false; - if (!hasRight) return false; - if (!hasTop) return false; - if (!hasBottom) return false; + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSize()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasOffset()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasLeft()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRight()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTop()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasBottom()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasSize()) { - output.writeInt64(1, getSize()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, size_); } - if (hasOffset()) { - output.writeInt64(2, getOffset()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, offset_); } - if (hasLeft()) { - output.writeInt32(4, getLeft()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(4, left_); } - if (hasRight()) { - output.writeInt32(5, getRight()); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(5, right_); } - if (hasTop()) { - output.writeInt32(6, getTop()); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(6, top_); } - if (hasBottom()) { - output.writeInt32(7, getBottom()); + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(7, bottom_); } - if (hasMinzoom()) { - output.writeInt32(8, getMinzoom()); + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(8, minzoom_); } - if (hasMaxzoom()) { - output.writeInt32(9, getMaxzoom()); + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeInt32(9, maxzoom_); } } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; - if (hasSize()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, getSize()); + .computeInt64Size(1, size_); } - if (hasOffset()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, getOffset()); + .computeInt64Size(2, offset_); } - if (hasLeft()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, getLeft()); + .computeInt32Size(4, left_); } - if (hasRight()) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, getRight()); + .computeInt32Size(5, right_); } - if (hasTop()) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, getTop()); + .computeInt32Size(6, top_); } - if (hasBottom()) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, getBottom()); + .computeInt32Size(7, bottom_); } - if (hasMinzoom()) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(8, getMinzoom()); + .computeInt32Size(8, minzoom_); } - if (hasMaxzoom()) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(9, getMaxzoom()); + .computeInt32Size(9, maxzoom_); } memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static net.osmand.binary.OsmandIndex.MapLevel parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.MapLevel parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.MapLevel parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.MapLevel parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.MapLevel parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.MapLevel parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.MapLevel parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static net.osmand.binary.OsmandIndex.MapLevel parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.MapLevel parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.MapLevel parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(net.osmand.binary.OsmandIndex.MapLevel prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + + /** + * Protobuf type {@code OsmAnd.OBF.MapLevel} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - net.osmand.binary.OsmandIndex.MapLevel, Builder> { - private net.osmand.binary.OsmandIndex.MapLevel result; - + net.osmand.binary.OsmandIndex.MapLevel, Builder> + implements net.osmand.binary.OsmandIndex.MapLevelOrBuilder { // Construct using net.osmand.binary.OsmandIndex.MapLevel.newBuilder() - private Builder() {} - + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } private static Builder create() { - Builder builder = new Builder(); - builder.result = new net.osmand.binary.OsmandIndex.MapLevel(); - return builder; + return new Builder(); } - - protected net.osmand.binary.OsmandIndex.MapLevel internalGetResult() { - return result; - } - + public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new net.osmand.binary.OsmandIndex.MapLevel(); + super.clear(); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + left_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + right_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + top_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + bottom_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + minzoom_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + maxzoom_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); return this; } - + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - + public net.osmand.binary.OsmandIndex.MapLevel getDefaultInstanceForType() { return net.osmand.binary.OsmandIndex.MapLevel.getDefaultInstance(); } - - public boolean isInitialized() { - return result.isInitialized(); - } + public net.osmand.binary.OsmandIndex.MapLevel build() { - if (result != null && !isInitialized()) { + net.osmand.binary.OsmandIndex.MapLevel result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - - private net.osmand.binary.OsmandIndex.MapLevel buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - + public net.osmand.binary.OsmandIndex.MapLevel buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + net.osmand.binary.OsmandIndex.MapLevel result = new net.osmand.binary.OsmandIndex.MapLevel(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - net.osmand.binary.OsmandIndex.MapLevel returnMe = result; - result = null; - return returnMe; + result.size_ = size_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.offset_ = offset_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.left_ = left_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.right_ = right_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.top_ = top_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.bottom_ = bottom_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.minzoom_ = minzoom_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.maxzoom_ = maxzoom_; + result.bitField0_ = to_bitField0_; + return result; } - + public Builder mergeFrom(net.osmand.binary.OsmandIndex.MapLevel other) { if (other == net.osmand.binary.OsmandIndex.MapLevel.getDefaultInstance()) return this; if (other.hasSize()) { @@ -2944,461 +5815,800 @@ public final class OsmandIndex { } return this; } - + + public final boolean isInitialized() { + if (!hasSize()) { + + return false; + } + if (!hasOffset()) { + + return false; + } + if (!hasLeft()) { + + return false; + } + if (!hasRight()) { + + return false; + } + if (!hasTop()) { + + return false; + } + if (!hasBottom()) { + + return false; + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setSize(input.readInt64()); - break; - } - case 16: { - setOffset(input.readInt64()); - break; - } - case 32: { - setLeft(input.readInt32()); - break; - } - case 40: { - setRight(input.readInt32()); - break; - } - case 48: { - setTop(input.readInt32()); - break; - } - case 56: { - setBottom(input.readInt32()); - break; - } - case 64: { - setMinzoom(input.readInt32()); - break; - } - case 72: { - setMaxzoom(input.readInt32()); - break; - } + net.osmand.binary.OsmandIndex.MapLevel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (net.osmand.binary.OsmandIndex.MapLevel) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - - + private int bitField0_; + // required int64 size = 1; + private long size_ ; + /** + * required int64 size = 1; + */ public boolean hasSize() { - return result.hasSize(); + return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int64 size = 1; + */ public long getSize() { - return result.getSize(); + return size_; } + /** + * required int64 size = 1; + */ public Builder setSize(long value) { - result.hasSize = true; - result.size_ = value; + bitField0_ |= 0x00000001; + size_ = value; + return this; } + /** + * required int64 size = 1; + */ public Builder clearSize() { - result.hasSize = false; - result.size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + return this; } - + // required int64 offset = 2; + private long offset_ ; + /** + * required int64 offset = 2; + */ public boolean hasOffset() { - return result.hasOffset(); + return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required int64 offset = 2; + */ public long getOffset() { - return result.getOffset(); + return offset_; } + /** + * required int64 offset = 2; + */ public Builder setOffset(long value) { - result.hasOffset = true; - result.offset_ = value; + bitField0_ |= 0x00000002; + offset_ = value; + return this; } + /** + * required int64 offset = 2; + */ public Builder clearOffset() { - result.hasOffset = false; - result.offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + offset_ = 0L; + return this; } - + // required int32 left = 4; + private int left_ ; + /** + * required int32 left = 4; + */ public boolean hasLeft() { - return result.hasLeft(); + return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * required int32 left = 4; + */ public int getLeft() { - return result.getLeft(); + return left_; } + /** + * required int32 left = 4; + */ public Builder setLeft(int value) { - result.hasLeft = true; - result.left_ = value; + bitField0_ |= 0x00000004; + left_ = value; + return this; } + /** + * required int32 left = 4; + */ public Builder clearLeft() { - result.hasLeft = false; - result.left_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + left_ = 0; + return this; } - + // required int32 right = 5; + private int right_ ; + /** + * required int32 right = 5; + */ public boolean hasRight() { - return result.hasRight(); + return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * required int32 right = 5; + */ public int getRight() { - return result.getRight(); + return right_; } + /** + * required int32 right = 5; + */ public Builder setRight(int value) { - result.hasRight = true; - result.right_ = value; + bitField0_ |= 0x00000008; + right_ = value; + return this; } + /** + * required int32 right = 5; + */ public Builder clearRight() { - result.hasRight = false; - result.right_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + right_ = 0; + return this; } - + // required int32 top = 6; + private int top_ ; + /** + * required int32 top = 6; + */ public boolean hasTop() { - return result.hasTop(); + return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * required int32 top = 6; + */ public int getTop() { - return result.getTop(); + return top_; } + /** + * required int32 top = 6; + */ public Builder setTop(int value) { - result.hasTop = true; - result.top_ = value; + bitField0_ |= 0x00000010; + top_ = value; + return this; } + /** + * required int32 top = 6; + */ public Builder clearTop() { - result.hasTop = false; - result.top_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + top_ = 0; + return this; } - + // required int32 bottom = 7; + private int bottom_ ; + /** + * required int32 bottom = 7; + */ public boolean hasBottom() { - return result.hasBottom(); + return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * required int32 bottom = 7; + */ public int getBottom() { - return result.getBottom(); + return bottom_; } + /** + * required int32 bottom = 7; + */ public Builder setBottom(int value) { - result.hasBottom = true; - result.bottom_ = value; + bitField0_ |= 0x00000020; + bottom_ = value; + return this; } + /** + * required int32 bottom = 7; + */ public Builder clearBottom() { - result.hasBottom = false; - result.bottom_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + bottom_ = 0; + return this; } - + // optional int32 minzoom = 8; + private int minzoom_ ; + /** + * optional int32 minzoom = 8; + */ public boolean hasMinzoom() { - return result.hasMinzoom(); + return ((bitField0_ & 0x00000040) == 0x00000040); } + /** + * optional int32 minzoom = 8; + */ public int getMinzoom() { - return result.getMinzoom(); + return minzoom_; } + /** + * optional int32 minzoom = 8; + */ public Builder setMinzoom(int value) { - result.hasMinzoom = true; - result.minzoom_ = value; + bitField0_ |= 0x00000040; + minzoom_ = value; + return this; } + /** + * optional int32 minzoom = 8; + */ public Builder clearMinzoom() { - result.hasMinzoom = false; - result.minzoom_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + minzoom_ = 0; + return this; } - + // optional int32 maxzoom = 9; + private int maxzoom_ ; + /** + * optional int32 maxzoom = 9; + */ public boolean hasMaxzoom() { - return result.hasMaxzoom(); + return ((bitField0_ & 0x00000080) == 0x00000080); } + /** + * optional int32 maxzoom = 9; + */ public int getMaxzoom() { - return result.getMaxzoom(); + return maxzoom_; } + /** + * optional int32 maxzoom = 9; + */ public Builder setMaxzoom(int value) { - result.hasMaxzoom = true; - result.maxzoom_ = value; + bitField0_ |= 0x00000080; + maxzoom_ = value; + return this; } + /** + * optional int32 maxzoom = 9; + */ public Builder clearMaxzoom() { - result.hasMaxzoom = false; - result.maxzoom_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); + maxzoom_ = 0; + return this; } - - // @@protoc_insertion_point(builder_scope:MapLevel) + + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.MapLevel) } - + static { defaultInstance = new MapLevel(true); - net.osmand.binary.OsmandIndex.internalForceInit(); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:MapLevel) + + // @@protoc_insertion_point(class_scope:OsmAnd.OBF.MapLevel) } - + + public interface MapPartOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required int64 size = 1; + /** + * required int64 size = 1; + */ + boolean hasSize(); + /** + * required int64 size = 1; + */ + long getSize(); + + // required int64 offset = 2; + /** + * required int64 offset = 2; + */ + boolean hasOffset(); + /** + * required int64 offset = 2; + */ + long getOffset(); + + // optional string name = 3; + /** + * optional string name = 3; + */ + boolean hasName(); + /** + * optional string name = 3; + */ + java.lang.String getName(); + /** + * optional string name = 3; + */ + com.google.protobuf.ByteString + getNameBytes(); + + // repeated .OsmAnd.OBF.MapLevel levels = 5; + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + java.util.List + getLevelsList(); + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + net.osmand.binary.OsmandIndex.MapLevel getLevels(int index); + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + int getLevelsCount(); + } + /** + * Protobuf type {@code OsmAnd.OBF.MapPart} + */ public static final class MapPart extends - com.google.protobuf.GeneratedMessageLite { + com.google.protobuf.GeneratedMessageLite + implements MapPartOrBuilder { // Use MapPart.newBuilder() to construct. - private MapPart() { - initFields(); + private MapPart(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + } private MapPart(boolean noInit) {} - + private static final MapPart defaultInstance; public static MapPart getDefaultInstance() { return defaultInstance; } - + public MapPart getDefaultInstanceForType() { return defaultInstance; } - + + private MapPart( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + size_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + offset_ = input.readInt64(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + name_ = input.readBytes(); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + levels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + levels_.add(input.readMessage(net.osmand.binary.OsmandIndex.MapLevel.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + levels_ = java.util.Collections.unmodifiableList(levels_); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public MapPart parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MapPart(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; // required int64 size = 1; public static final int SIZE_FIELD_NUMBER = 1; - private boolean hasSize; - private long size_ = 0L; - public boolean hasSize() { return hasSize; } - public long getSize() { return size_; } - + private long size_; + /** + * required int64 size = 1; + */ + public boolean hasSize() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int64 size = 1; + */ + public long getSize() { + return size_; + } + // required int64 offset = 2; public static final int OFFSET_FIELD_NUMBER = 2; - private boolean hasOffset; - private long offset_ = 0L; - public boolean hasOffset() { return hasOffset; } - public long getOffset() { return offset_; } - + private long offset_; + /** + * required int64 offset = 2; + */ + public boolean hasOffset() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int64 offset = 2; + */ + public long getOffset() { + return offset_; + } + // optional string name = 3; public static final int NAME_FIELD_NUMBER = 3; - private boolean hasName; - private java.lang.String name_ = ""; - public boolean hasName() { return hasName; } - public java.lang.String getName() { return name_; } - - // repeated .MapLevel levels = 5; + private java.lang.Object name_; + /** + * optional string name = 3; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string name = 3; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * optional string name = 3; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // repeated .OsmAnd.OBF.MapLevel levels = 5; public static final int LEVELS_FIELD_NUMBER = 5; - private java.util.List levels_ = - java.util.Collections.emptyList(); + private java.util.List levels_; + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ public java.util.List getLevelsList() { return levels_; } - public int getLevelsCount() { return levels_.size(); } + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + public java.util.List + getLevelsOrBuilderList() { + return levels_; + } + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + public int getLevelsCount() { + return levels_.size(); + } + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ public net.osmand.binary.OsmandIndex.MapLevel getLevels(int index) { return levels_.get(index); } - - private void initFields() { + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + public net.osmand.binary.OsmandIndex.MapLevelOrBuilder getLevelsOrBuilder( + int index) { + return levels_.get(index); } + + private void initFields() { + size_ = 0L; + offset_ = 0L; + name_ = ""; + levels_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { - if (!hasSize) return false; - if (!hasOffset) return false; - for (net.osmand.binary.OsmandIndex.MapLevel element : getLevelsList()) { - if (!element.isInitialized()) return false; + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSize()) { + memoizedIsInitialized = 0; + return false; } + if (!hasOffset()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getLevelsCount(); i++) { + if (!getLevels(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasSize()) { - output.writeInt64(1, getSize()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, size_); } - if (hasOffset()) { - output.writeInt64(2, getOffset()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, offset_); } - if (hasName()) { - output.writeString(3, getName()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getNameBytes()); } - for (net.osmand.binary.OsmandIndex.MapLevel element : getLevelsList()) { - output.writeMessage(5, element); + for (int i = 0; i < levels_.size(); i++) { + output.writeMessage(5, levels_.get(i)); } } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; - if (hasSize()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, getSize()); + .computeInt64Size(1, size_); } - if (hasOffset()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, getOffset()); + .computeInt64Size(2, offset_); } - if (hasName()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(3, getName()); + .computeBytesSize(3, getNameBytes()); } - for (net.osmand.binary.OsmandIndex.MapLevel element : getLevelsList()) { + for (int i = 0; i < levels_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, element); + .computeMessageSize(5, levels_.get(i)); } memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static net.osmand.binary.OsmandIndex.MapPart parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.MapPart parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.MapPart parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.MapPart parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.MapPart parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.MapPart parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.MapPart parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static net.osmand.binary.OsmandIndex.MapPart parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.MapPart parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.MapPart parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(net.osmand.binary.OsmandIndex.MapPart prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + + /** + * Protobuf type {@code OsmAnd.OBF.MapPart} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - net.osmand.binary.OsmandIndex.MapPart, Builder> { - private net.osmand.binary.OsmandIndex.MapPart result; - + net.osmand.binary.OsmandIndex.MapPart, Builder> + implements net.osmand.binary.OsmandIndex.MapPartOrBuilder { // Construct using net.osmand.binary.OsmandIndex.MapPart.newBuilder() - private Builder() {} - + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } private static Builder create() { - Builder builder = new Builder(); - builder.result = new net.osmand.binary.OsmandIndex.MapPart(); - return builder; + return new Builder(); } - - protected net.osmand.binary.OsmandIndex.MapPart internalGetResult() { - return result; - } - + public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new net.osmand.binary.OsmandIndex.MapPart(); + super.clear(); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + levels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); return this; } - + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - + public net.osmand.binary.OsmandIndex.MapPart getDefaultInstanceForType() { return net.osmand.binary.OsmandIndex.MapPart.getDefaultInstance(); } - - public boolean isInitialized() { - return result.isInitialized(); - } + public net.osmand.binary.OsmandIndex.MapPart build() { - if (result != null && !isInitialized()) { + net.osmand.binary.OsmandIndex.MapPart result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - - private net.osmand.binary.OsmandIndex.MapPart buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - + public net.osmand.binary.OsmandIndex.MapPart buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + net.osmand.binary.OsmandIndex.MapPart result = new net.osmand.binary.OsmandIndex.MapPart(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - if (result.levels_ != java.util.Collections.EMPTY_LIST) { - result.levels_ = - java.util.Collections.unmodifiableList(result.levels_); + result.size_ = size_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; } - net.osmand.binary.OsmandIndex.MapPart returnMe = result; - result = null; - return returnMe; + result.offset_ = offset_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.name_ = name_; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + levels_ = java.util.Collections.unmodifiableList(levels_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.levels_ = levels_; + result.bitField0_ = to_bitField0_; + return result; } - + public Builder mergeFrom(net.osmand.binary.OsmandIndex.MapPart other) { if (other == net.osmand.binary.OsmandIndex.MapPart.getDefaultInstance()) return this; if (other.hasSize()) { @@ -3408,470 +6618,937 @@ public final class OsmandIndex { setOffset(other.getOffset()); } if (other.hasName()) { - setName(other.getName()); + bitField0_ |= 0x00000004; + name_ = other.name_; + } if (!other.levels_.isEmpty()) { - if (result.levels_.isEmpty()) { - result.levels_ = new java.util.ArrayList(); + if (levels_.isEmpty()) { + levels_ = other.levels_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureLevelsIsMutable(); + levels_.addAll(other.levels_); } - result.levels_.addAll(other.levels_); + } return this; } - + + public final boolean isInitialized() { + if (!hasSize()) { + + return false; + } + if (!hasOffset()) { + + return false; + } + for (int i = 0; i < getLevelsCount(); i++) { + if (!getLevels(i).isInitialized()) { + + return false; + } + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setSize(input.readInt64()); - break; - } - case 16: { - setOffset(input.readInt64()); - break; - } - case 26: { - setName(input.readString()); - break; - } - case 42: { - net.osmand.binary.OsmandIndex.MapLevel.Builder subBuilder = net.osmand.binary.OsmandIndex.MapLevel.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addLevels(subBuilder.buildPartial()); - break; - } + net.osmand.binary.OsmandIndex.MapPart parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (net.osmand.binary.OsmandIndex.MapPart) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - - + private int bitField0_; + // required int64 size = 1; + private long size_ ; + /** + * required int64 size = 1; + */ public boolean hasSize() { - return result.hasSize(); + return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int64 size = 1; + */ public long getSize() { - return result.getSize(); + return size_; } + /** + * required int64 size = 1; + */ public Builder setSize(long value) { - result.hasSize = true; - result.size_ = value; + bitField0_ |= 0x00000001; + size_ = value; + return this; } + /** + * required int64 size = 1; + */ public Builder clearSize() { - result.hasSize = false; - result.size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + return this; } - + // required int64 offset = 2; + private long offset_ ; + /** + * required int64 offset = 2; + */ public boolean hasOffset() { - return result.hasOffset(); + return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required int64 offset = 2; + */ public long getOffset() { - return result.getOffset(); + return offset_; } + /** + * required int64 offset = 2; + */ public Builder setOffset(long value) { - result.hasOffset = true; - result.offset_ = value; + bitField0_ |= 0x00000002; + offset_ = value; + return this; } + /** + * required int64 offset = 2; + */ public Builder clearOffset() { - result.hasOffset = false; - result.offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + offset_ = 0L; + return this; } - + // optional string name = 3; + private java.lang.Object name_ = ""; + /** + * optional string name = 3; + */ public boolean hasName() { - return result.hasName(); + return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional string name = 3; + */ public java.lang.String getName() { - return result.getName(); + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - public Builder setName(java.lang.String value) { + /** + * optional string name = 3; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string name = 3; + */ + public Builder setName( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - result.hasName = true; - result.name_ = value; + bitField0_ |= 0x00000004; + name_ = value; + return this; } + /** + * optional string name = 3; + */ public Builder clearName() { - result.hasName = false; - result.name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + name_ = getDefaultInstance().getName(); + return this; } - - // repeated .MapLevel levels = 5; + /** + * optional string name = 3; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + name_ = value; + + return this; + } + + // repeated .OsmAnd.OBF.MapLevel levels = 5; + private java.util.List levels_ = + java.util.Collections.emptyList(); + private void ensureLevelsIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + levels_ = new java.util.ArrayList(levels_); + bitField0_ |= 0x00000008; + } + } + + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ public java.util.List getLevelsList() { - return java.util.Collections.unmodifiableList(result.levels_); + return java.util.Collections.unmodifiableList(levels_); } + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ public int getLevelsCount() { - return result.getLevelsCount(); + return levels_.size(); } + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ public net.osmand.binary.OsmandIndex.MapLevel getLevels(int index) { - return result.getLevels(index); + return levels_.get(index); } - public Builder setLevels(int index, net.osmand.binary.OsmandIndex.MapLevel value) { + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + public Builder setLevels( + int index, net.osmand.binary.OsmandIndex.MapLevel value) { if (value == null) { throw new NullPointerException(); } - result.levels_.set(index, value); + ensureLevelsIsMutable(); + levels_.set(index, value); + return this; } - public Builder setLevels(int index, net.osmand.binary.OsmandIndex.MapLevel.Builder builderForValue) { - result.levels_.set(index, builderForValue.build()); + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + public Builder setLevels( + int index, net.osmand.binary.OsmandIndex.MapLevel.Builder builderForValue) { + ensureLevelsIsMutable(); + levels_.set(index, builderForValue.build()); + return this; } + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ public Builder addLevels(net.osmand.binary.OsmandIndex.MapLevel value) { if (value == null) { throw new NullPointerException(); } - if (result.levels_.isEmpty()) { - result.levels_ = new java.util.ArrayList(); - } - result.levels_.add(value); + ensureLevelsIsMutable(); + levels_.add(value); + return this; } - public Builder addLevels(net.osmand.binary.OsmandIndex.MapLevel.Builder builderForValue) { - if (result.levels_.isEmpty()) { - result.levels_ = new java.util.ArrayList(); + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + public Builder addLevels( + int index, net.osmand.binary.OsmandIndex.MapLevel value) { + if (value == null) { + throw new NullPointerException(); } - result.levels_.add(builderForValue.build()); + ensureLevelsIsMutable(); + levels_.add(index, value); + return this; } + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + public Builder addLevels( + net.osmand.binary.OsmandIndex.MapLevel.Builder builderForValue) { + ensureLevelsIsMutable(); + levels_.add(builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + public Builder addLevels( + int index, net.osmand.binary.OsmandIndex.MapLevel.Builder builderForValue) { + ensureLevelsIsMutable(); + levels_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ public Builder addAllLevels( java.lang.Iterable values) { - if (result.levels_.isEmpty()) { - result.levels_ = new java.util.ArrayList(); - } - super.addAll(values, result.levels_); + ensureLevelsIsMutable(); + super.addAll(values, levels_); + return this; } + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ public Builder clearLevels() { - result.levels_ = java.util.Collections.emptyList(); + levels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + return this; } - - // @@protoc_insertion_point(builder_scope:MapPart) + /** + * repeated .OsmAnd.OBF.MapLevel levels = 5; + */ + public Builder removeLevels(int index) { + ensureLevelsIsMutable(); + levels_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.MapPart) } - + static { defaultInstance = new MapPart(true); - net.osmand.binary.OsmandIndex.internalForceInit(); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:MapPart) + + // @@protoc_insertion_point(class_scope:OsmAnd.OBF.MapPart) } - + + public interface RoutingSubregionOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required int64 size = 1; + /** + * required int64 size = 1; + */ + boolean hasSize(); + /** + * required int64 size = 1; + */ + long getSize(); + + // required int64 offset = 2; + /** + * required int64 offset = 2; + */ + boolean hasOffset(); + /** + * required int64 offset = 2; + */ + long getOffset(); + + // optional bool basemap = 3; + /** + * optional bool basemap = 3; + */ + boolean hasBasemap(); + /** + * optional bool basemap = 3; + */ + boolean getBasemap(); + + // required int32 left = 4; + /** + * required int32 left = 4; + */ + boolean hasLeft(); + /** + * required int32 left = 4; + */ + int getLeft(); + + // required int32 right = 5; + /** + * required int32 right = 5; + */ + boolean hasRight(); + /** + * required int32 right = 5; + */ + int getRight(); + + // required int32 top = 6; + /** + * required int32 top = 6; + */ + boolean hasTop(); + /** + * required int32 top = 6; + */ + int getTop(); + + // required int32 bottom = 7; + /** + * required int32 bottom = 7; + */ + boolean hasBottom(); + /** + * required int32 bottom = 7; + */ + int getBottom(); + + // required uint32 shifToData = 8; + /** + * required uint32 shifToData = 8; + */ + boolean hasShifToData(); + /** + * required uint32 shifToData = 8; + */ + int getShifToData(); + } + /** + * Protobuf type {@code OsmAnd.OBF.RoutingSubregion} + */ public static final class RoutingSubregion extends - com.google.protobuf.GeneratedMessageLite { + com.google.protobuf.GeneratedMessageLite + implements RoutingSubregionOrBuilder { // Use RoutingSubregion.newBuilder() to construct. - private RoutingSubregion() { - initFields(); + private RoutingSubregion(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + } private RoutingSubregion(boolean noInit) {} - + private static final RoutingSubregion defaultInstance; public static RoutingSubregion getDefaultInstance() { return defaultInstance; } - + public RoutingSubregion getDefaultInstanceForType() { return defaultInstance; } - + + private RoutingSubregion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + size_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + offset_ = input.readInt64(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + basemap_ = input.readBool(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + left_ = input.readInt32(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + right_ = input.readInt32(); + break; + } + case 48: { + bitField0_ |= 0x00000020; + top_ = input.readInt32(); + break; + } + case 56: { + bitField0_ |= 0x00000040; + bottom_ = input.readInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000080; + shifToData_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public RoutingSubregion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RoutingSubregion(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; // required int64 size = 1; public static final int SIZE_FIELD_NUMBER = 1; - private boolean hasSize; - private long size_ = 0L; - public boolean hasSize() { return hasSize; } - public long getSize() { return size_; } - + private long size_; + /** + * required int64 size = 1; + */ + public boolean hasSize() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int64 size = 1; + */ + public long getSize() { + return size_; + } + // required int64 offset = 2; public static final int OFFSET_FIELD_NUMBER = 2; - private boolean hasOffset; - private long offset_ = 0L; - public boolean hasOffset() { return hasOffset; } - public long getOffset() { return offset_; } - + private long offset_; + /** + * required int64 offset = 2; + */ + public boolean hasOffset() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int64 offset = 2; + */ + public long getOffset() { + return offset_; + } + // optional bool basemap = 3; public static final int BASEMAP_FIELD_NUMBER = 3; - private boolean hasBasemap; - private boolean basemap_ = false; - public boolean hasBasemap() { return hasBasemap; } - public boolean getBasemap() { return basemap_; } - + private boolean basemap_; + /** + * optional bool basemap = 3; + */ + public boolean hasBasemap() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bool basemap = 3; + */ + public boolean getBasemap() { + return basemap_; + } + // required int32 left = 4; public static final int LEFT_FIELD_NUMBER = 4; - private boolean hasLeft; - private int left_ = 0; - public boolean hasLeft() { return hasLeft; } - public int getLeft() { return left_; } - + private int left_; + /** + * required int32 left = 4; + */ + public boolean hasLeft() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required int32 left = 4; + */ + public int getLeft() { + return left_; + } + // required int32 right = 5; public static final int RIGHT_FIELD_NUMBER = 5; - private boolean hasRight; - private int right_ = 0; - public boolean hasRight() { return hasRight; } - public int getRight() { return right_; } - + private int right_; + /** + * required int32 right = 5; + */ + public boolean hasRight() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * required int32 right = 5; + */ + public int getRight() { + return right_; + } + // required int32 top = 6; public static final int TOP_FIELD_NUMBER = 6; - private boolean hasTop; - private int top_ = 0; - public boolean hasTop() { return hasTop; } - public int getTop() { return top_; } - + private int top_; + /** + * required int32 top = 6; + */ + public boolean hasTop() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * required int32 top = 6; + */ + public int getTop() { + return top_; + } + // required int32 bottom = 7; public static final int BOTTOM_FIELD_NUMBER = 7; - private boolean hasBottom; - private int bottom_ = 0; - public boolean hasBottom() { return hasBottom; } - public int getBottom() { return bottom_; } - + private int bottom_; + /** + * required int32 bottom = 7; + */ + public boolean hasBottom() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * required int32 bottom = 7; + */ + public int getBottom() { + return bottom_; + } + // required uint32 shifToData = 8; public static final int SHIFTODATA_FIELD_NUMBER = 8; - private boolean hasShifToData; - private int shifToData_ = 0; - public boolean hasShifToData() { return hasShifToData; } - public int getShifToData() { return shifToData_; } - - private void initFields() { + private int shifToData_; + /** + * required uint32 shifToData = 8; + */ + public boolean hasShifToData() { + return ((bitField0_ & 0x00000080) == 0x00000080); } + /** + * required uint32 shifToData = 8; + */ + public int getShifToData() { + return shifToData_; + } + + private void initFields() { + size_ = 0L; + offset_ = 0L; + basemap_ = false; + left_ = 0; + right_ = 0; + top_ = 0; + bottom_ = 0; + shifToData_ = 0; + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { - if (!hasSize) return false; - if (!hasOffset) return false; - if (!hasLeft) return false; - if (!hasRight) return false; - if (!hasTop) return false; - if (!hasBottom) return false; - if (!hasShifToData) return false; + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSize()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasOffset()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasLeft()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRight()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTop()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasBottom()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasShifToData()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasSize()) { - output.writeInt64(1, getSize()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, size_); } - if (hasOffset()) { - output.writeInt64(2, getOffset()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, offset_); } - if (hasBasemap()) { - output.writeBool(3, getBasemap()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(3, basemap_); } - if (hasLeft()) { - output.writeInt32(4, getLeft()); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, left_); } - if (hasRight()) { - output.writeInt32(5, getRight()); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, right_); } - if (hasTop()) { - output.writeInt32(6, getTop()); + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(6, top_); } - if (hasBottom()) { - output.writeInt32(7, getBottom()); + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(7, bottom_); } - if (hasShifToData()) { - output.writeUInt32(8, getShifToData()); + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeUInt32(8, shifToData_); } } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; - if (hasSize()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, getSize()); + .computeInt64Size(1, size_); } - if (hasOffset()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, getOffset()); + .computeInt64Size(2, offset_); } - if (hasBasemap()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, getBasemap()); + .computeBoolSize(3, basemap_); } - if (hasLeft()) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, getLeft()); + .computeInt32Size(4, left_); } - if (hasRight()) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, getRight()); + .computeInt32Size(5, right_); } - if (hasTop()) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, getTop()); + .computeInt32Size(6, top_); } - if (hasBottom()) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, getBottom()); + .computeInt32Size(7, bottom_); } - if (hasShifToData()) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(8, getShifToData()); + .computeUInt32Size(8, shifToData_); } memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static net.osmand.binary.OsmandIndex.RoutingSubregion parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.RoutingSubregion parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.RoutingSubregion parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.RoutingSubregion parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.RoutingSubregion parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.RoutingSubregion parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.RoutingSubregion parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static net.osmand.binary.OsmandIndex.RoutingSubregion parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.RoutingSubregion parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.RoutingSubregion parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(net.osmand.binary.OsmandIndex.RoutingSubregion prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + + /** + * Protobuf type {@code OsmAnd.OBF.RoutingSubregion} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - net.osmand.binary.OsmandIndex.RoutingSubregion, Builder> { - private net.osmand.binary.OsmandIndex.RoutingSubregion result; - + net.osmand.binary.OsmandIndex.RoutingSubregion, Builder> + implements net.osmand.binary.OsmandIndex.RoutingSubregionOrBuilder { // Construct using net.osmand.binary.OsmandIndex.RoutingSubregion.newBuilder() - private Builder() {} - + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } private static Builder create() { - Builder builder = new Builder(); - builder.result = new net.osmand.binary.OsmandIndex.RoutingSubregion(); - return builder; + return new Builder(); } - - protected net.osmand.binary.OsmandIndex.RoutingSubregion internalGetResult() { - return result; - } - + public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new net.osmand.binary.OsmandIndex.RoutingSubregion(); + super.clear(); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + basemap_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + left_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + right_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + top_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + bottom_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + shifToData_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); return this; } - + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - + public net.osmand.binary.OsmandIndex.RoutingSubregion getDefaultInstanceForType() { return net.osmand.binary.OsmandIndex.RoutingSubregion.getDefaultInstance(); } - - public boolean isInitialized() { - return result.isInitialized(); - } + public net.osmand.binary.OsmandIndex.RoutingSubregion build() { - if (result != null && !isInitialized()) { + net.osmand.binary.OsmandIndex.RoutingSubregion result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - - private net.osmand.binary.OsmandIndex.RoutingSubregion buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - + public net.osmand.binary.OsmandIndex.RoutingSubregion buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + net.osmand.binary.OsmandIndex.RoutingSubregion result = new net.osmand.binary.OsmandIndex.RoutingSubregion(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - net.osmand.binary.OsmandIndex.RoutingSubregion returnMe = result; - result = null; - return returnMe; + result.size_ = size_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.offset_ = offset_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.basemap_ = basemap_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.left_ = left_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.right_ = right_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.top_ = top_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.bottom_ = bottom_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.shifToData_ = shifToData_; + result.bitField0_ = to_bitField0_; + return result; } - + public Builder mergeFrom(net.osmand.binary.OsmandIndex.RoutingSubregion other) { if (other == net.osmand.binary.OsmandIndex.RoutingSubregion.getDefaultInstance()) return this; if (other.hasSize()) { @@ -3900,461 +7577,804 @@ public final class OsmandIndex { } return this; } - + + public final boolean isInitialized() { + if (!hasSize()) { + + return false; + } + if (!hasOffset()) { + + return false; + } + if (!hasLeft()) { + + return false; + } + if (!hasRight()) { + + return false; + } + if (!hasTop()) { + + return false; + } + if (!hasBottom()) { + + return false; + } + if (!hasShifToData()) { + + return false; + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setSize(input.readInt64()); - break; - } - case 16: { - setOffset(input.readInt64()); - break; - } - case 24: { - setBasemap(input.readBool()); - break; - } - case 32: { - setLeft(input.readInt32()); - break; - } - case 40: { - setRight(input.readInt32()); - break; - } - case 48: { - setTop(input.readInt32()); - break; - } - case 56: { - setBottom(input.readInt32()); - break; - } - case 64: { - setShifToData(input.readUInt32()); - break; - } + net.osmand.binary.OsmandIndex.RoutingSubregion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (net.osmand.binary.OsmandIndex.RoutingSubregion) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - - + private int bitField0_; + // required int64 size = 1; + private long size_ ; + /** + * required int64 size = 1; + */ public boolean hasSize() { - return result.hasSize(); + return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int64 size = 1; + */ public long getSize() { - return result.getSize(); + return size_; } + /** + * required int64 size = 1; + */ public Builder setSize(long value) { - result.hasSize = true; - result.size_ = value; + bitField0_ |= 0x00000001; + size_ = value; + return this; } + /** + * required int64 size = 1; + */ public Builder clearSize() { - result.hasSize = false; - result.size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + return this; } - + // required int64 offset = 2; + private long offset_ ; + /** + * required int64 offset = 2; + */ public boolean hasOffset() { - return result.hasOffset(); + return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required int64 offset = 2; + */ public long getOffset() { - return result.getOffset(); + return offset_; } + /** + * required int64 offset = 2; + */ public Builder setOffset(long value) { - result.hasOffset = true; - result.offset_ = value; + bitField0_ |= 0x00000002; + offset_ = value; + return this; } + /** + * required int64 offset = 2; + */ public Builder clearOffset() { - result.hasOffset = false; - result.offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + offset_ = 0L; + return this; } - + // optional bool basemap = 3; + private boolean basemap_ ; + /** + * optional bool basemap = 3; + */ public boolean hasBasemap() { - return result.hasBasemap(); + return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional bool basemap = 3; + */ public boolean getBasemap() { - return result.getBasemap(); + return basemap_; } + /** + * optional bool basemap = 3; + */ public Builder setBasemap(boolean value) { - result.hasBasemap = true; - result.basemap_ = value; + bitField0_ |= 0x00000004; + basemap_ = value; + return this; } + /** + * optional bool basemap = 3; + */ public Builder clearBasemap() { - result.hasBasemap = false; - result.basemap_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + basemap_ = false; + return this; } - + // required int32 left = 4; + private int left_ ; + /** + * required int32 left = 4; + */ public boolean hasLeft() { - return result.hasLeft(); + return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * required int32 left = 4; + */ public int getLeft() { - return result.getLeft(); + return left_; } + /** + * required int32 left = 4; + */ public Builder setLeft(int value) { - result.hasLeft = true; - result.left_ = value; + bitField0_ |= 0x00000008; + left_ = value; + return this; } + /** + * required int32 left = 4; + */ public Builder clearLeft() { - result.hasLeft = false; - result.left_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + left_ = 0; + return this; } - + // required int32 right = 5; + private int right_ ; + /** + * required int32 right = 5; + */ public boolean hasRight() { - return result.hasRight(); + return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * required int32 right = 5; + */ public int getRight() { - return result.getRight(); + return right_; } + /** + * required int32 right = 5; + */ public Builder setRight(int value) { - result.hasRight = true; - result.right_ = value; + bitField0_ |= 0x00000010; + right_ = value; + return this; } + /** + * required int32 right = 5; + */ public Builder clearRight() { - result.hasRight = false; - result.right_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + right_ = 0; + return this; } - + // required int32 top = 6; + private int top_ ; + /** + * required int32 top = 6; + */ public boolean hasTop() { - return result.hasTop(); + return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * required int32 top = 6; + */ public int getTop() { - return result.getTop(); + return top_; } + /** + * required int32 top = 6; + */ public Builder setTop(int value) { - result.hasTop = true; - result.top_ = value; + bitField0_ |= 0x00000020; + top_ = value; + return this; } + /** + * required int32 top = 6; + */ public Builder clearTop() { - result.hasTop = false; - result.top_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + top_ = 0; + return this; } - + // required int32 bottom = 7; + private int bottom_ ; + /** + * required int32 bottom = 7; + */ public boolean hasBottom() { - return result.hasBottom(); + return ((bitField0_ & 0x00000040) == 0x00000040); } + /** + * required int32 bottom = 7; + */ public int getBottom() { - return result.getBottom(); + return bottom_; } + /** + * required int32 bottom = 7; + */ public Builder setBottom(int value) { - result.hasBottom = true; - result.bottom_ = value; + bitField0_ |= 0x00000040; + bottom_ = value; + return this; } + /** + * required int32 bottom = 7; + */ public Builder clearBottom() { - result.hasBottom = false; - result.bottom_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + bottom_ = 0; + return this; } - + // required uint32 shifToData = 8; + private int shifToData_ ; + /** + * required uint32 shifToData = 8; + */ public boolean hasShifToData() { - return result.hasShifToData(); + return ((bitField0_ & 0x00000080) == 0x00000080); } + /** + * required uint32 shifToData = 8; + */ public int getShifToData() { - return result.getShifToData(); + return shifToData_; } + /** + * required uint32 shifToData = 8; + */ public Builder setShifToData(int value) { - result.hasShifToData = true; - result.shifToData_ = value; + bitField0_ |= 0x00000080; + shifToData_ = value; + return this; } + /** + * required uint32 shifToData = 8; + */ public Builder clearShifToData() { - result.hasShifToData = false; - result.shifToData_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); + shifToData_ = 0; + return this; } - - // @@protoc_insertion_point(builder_scope:RoutingSubregion) + + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.RoutingSubregion) } - + static { defaultInstance = new RoutingSubregion(true); - net.osmand.binary.OsmandIndex.internalForceInit(); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:RoutingSubregion) + + // @@protoc_insertion_point(class_scope:OsmAnd.OBF.RoutingSubregion) } - + + public interface RoutingPartOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required int64 size = 1; + /** + * required int64 size = 1; + */ + boolean hasSize(); + /** + * required int64 size = 1; + */ + long getSize(); + + // required int64 offset = 2; + /** + * required int64 offset = 2; + */ + boolean hasOffset(); + /** + * required int64 offset = 2; + */ + long getOffset(); + + // optional string name = 3; + /** + * optional string name = 3; + */ + boolean hasName(); + /** + * optional string name = 3; + */ + java.lang.String getName(); + /** + * optional string name = 3; + */ + com.google.protobuf.ByteString + getNameBytes(); + + // repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + java.util.List + getSubregionsList(); + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + net.osmand.binary.OsmandIndex.RoutingSubregion getSubregions(int index); + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + int getSubregionsCount(); + } + /** + * Protobuf type {@code OsmAnd.OBF.RoutingPart} + */ public static final class RoutingPart extends - com.google.protobuf.GeneratedMessageLite { + com.google.protobuf.GeneratedMessageLite + implements RoutingPartOrBuilder { // Use RoutingPart.newBuilder() to construct. - private RoutingPart() { - initFields(); + private RoutingPart(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + } private RoutingPart(boolean noInit) {} - + private static final RoutingPart defaultInstance; public static RoutingPart getDefaultInstance() { return defaultInstance; } - + public RoutingPart getDefaultInstanceForType() { return defaultInstance; } - + + private RoutingPart( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + size_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + offset_ = input.readInt64(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + name_ = input.readBytes(); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + subregions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + subregions_.add(input.readMessage(net.osmand.binary.OsmandIndex.RoutingSubregion.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + subregions_ = java.util.Collections.unmodifiableList(subregions_); + } + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public RoutingPart parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RoutingPart(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; // required int64 size = 1; public static final int SIZE_FIELD_NUMBER = 1; - private boolean hasSize; - private long size_ = 0L; - public boolean hasSize() { return hasSize; } - public long getSize() { return size_; } - + private long size_; + /** + * required int64 size = 1; + */ + public boolean hasSize() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int64 size = 1; + */ + public long getSize() { + return size_; + } + // required int64 offset = 2; public static final int OFFSET_FIELD_NUMBER = 2; - private boolean hasOffset; - private long offset_ = 0L; - public boolean hasOffset() { return hasOffset; } - public long getOffset() { return offset_; } - + private long offset_; + /** + * required int64 offset = 2; + */ + public boolean hasOffset() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int64 offset = 2; + */ + public long getOffset() { + return offset_; + } + // optional string name = 3; public static final int NAME_FIELD_NUMBER = 3; - private boolean hasName; - private java.lang.String name_ = ""; - public boolean hasName() { return hasName; } - public java.lang.String getName() { return name_; } - - // repeated .RoutingSubregion subregions = 5; + private java.lang.Object name_; + /** + * optional string name = 3; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string name = 3; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * optional string name = 3; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; public static final int SUBREGIONS_FIELD_NUMBER = 5; - private java.util.List subregions_ = - java.util.Collections.emptyList(); + private java.util.List subregions_; + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ public java.util.List getSubregionsList() { return subregions_; } - public int getSubregionsCount() { return subregions_.size(); } + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + public java.util.List + getSubregionsOrBuilderList() { + return subregions_; + } + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + public int getSubregionsCount() { + return subregions_.size(); + } + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ public net.osmand.binary.OsmandIndex.RoutingSubregion getSubregions(int index) { return subregions_.get(index); } - - private void initFields() { + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + public net.osmand.binary.OsmandIndex.RoutingSubregionOrBuilder getSubregionsOrBuilder( + int index) { + return subregions_.get(index); } + + private void initFields() { + size_ = 0L; + offset_ = 0L; + name_ = ""; + subregions_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { - if (!hasSize) return false; - if (!hasOffset) return false; - for (net.osmand.binary.OsmandIndex.RoutingSubregion element : getSubregionsList()) { - if (!element.isInitialized()) return false; + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSize()) { + memoizedIsInitialized = 0; + return false; } + if (!hasOffset()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getSubregionsCount(); i++) { + if (!getSubregions(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasSize()) { - output.writeInt64(1, getSize()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, size_); } - if (hasOffset()) { - output.writeInt64(2, getOffset()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, offset_); } - if (hasName()) { - output.writeString(3, getName()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getNameBytes()); } - for (net.osmand.binary.OsmandIndex.RoutingSubregion element : getSubregionsList()) { - output.writeMessage(5, element); + for (int i = 0; i < subregions_.size(); i++) { + output.writeMessage(5, subregions_.get(i)); } } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; - if (hasSize()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, getSize()); + .computeInt64Size(1, size_); } - if (hasOffset()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, getOffset()); + .computeInt64Size(2, offset_); } - if (hasName()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(3, getName()); + .computeBytesSize(3, getNameBytes()); } - for (net.osmand.binary.OsmandIndex.RoutingSubregion element : getSubregionsList()) { + for (int i = 0; i < subregions_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, element); + .computeMessageSize(5, subregions_.get(i)); } memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static net.osmand.binary.OsmandIndex.RoutingPart parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.RoutingPart parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.RoutingPart parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.RoutingPart parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.RoutingPart parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.RoutingPart parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.RoutingPart parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static net.osmand.binary.OsmandIndex.RoutingPart parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.RoutingPart parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.RoutingPart parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(net.osmand.binary.OsmandIndex.RoutingPart prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + + /** + * Protobuf type {@code OsmAnd.OBF.RoutingPart} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - net.osmand.binary.OsmandIndex.RoutingPart, Builder> { - private net.osmand.binary.OsmandIndex.RoutingPart result; - + net.osmand.binary.OsmandIndex.RoutingPart, Builder> + implements net.osmand.binary.OsmandIndex.RoutingPartOrBuilder { // Construct using net.osmand.binary.OsmandIndex.RoutingPart.newBuilder() - private Builder() {} - + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } private static Builder create() { - Builder builder = new Builder(); - builder.result = new net.osmand.binary.OsmandIndex.RoutingPart(); - return builder; + return new Builder(); } - - protected net.osmand.binary.OsmandIndex.RoutingPart internalGetResult() { - return result; - } - + public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new net.osmand.binary.OsmandIndex.RoutingPart(); + super.clear(); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + subregions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); return this; } - + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - + public net.osmand.binary.OsmandIndex.RoutingPart getDefaultInstanceForType() { return net.osmand.binary.OsmandIndex.RoutingPart.getDefaultInstance(); } - - public boolean isInitialized() { - return result.isInitialized(); - } + public net.osmand.binary.OsmandIndex.RoutingPart build() { - if (result != null && !isInitialized()) { + net.osmand.binary.OsmandIndex.RoutingPart result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - - private net.osmand.binary.OsmandIndex.RoutingPart buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - + public net.osmand.binary.OsmandIndex.RoutingPart buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + net.osmand.binary.OsmandIndex.RoutingPart result = new net.osmand.binary.OsmandIndex.RoutingPart(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - if (result.subregions_ != java.util.Collections.EMPTY_LIST) { - result.subregions_ = - java.util.Collections.unmodifiableList(result.subregions_); + result.size_ = size_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; } - net.osmand.binary.OsmandIndex.RoutingPart returnMe = result; - result = null; - return returnMe; + result.offset_ = offset_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.name_ = name_; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subregions_ = java.util.Collections.unmodifiableList(subregions_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.subregions_ = subregions_; + result.bitField0_ = to_bitField0_; + return result; } - + public Builder mergeFrom(net.osmand.binary.OsmandIndex.RoutingPart other) { if (other == net.osmand.binary.OsmandIndex.RoutingPart.getDefaultInstance()) return this; if (other.hasSize()) { @@ -4364,507 +8384,1174 @@ public final class OsmandIndex { setOffset(other.getOffset()); } if (other.hasName()) { - setName(other.getName()); + bitField0_ |= 0x00000004; + name_ = other.name_; + } if (!other.subregions_.isEmpty()) { - if (result.subregions_.isEmpty()) { - result.subregions_ = new java.util.ArrayList(); + if (subregions_.isEmpty()) { + subregions_ = other.subregions_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSubregionsIsMutable(); + subregions_.addAll(other.subregions_); } - result.subregions_.addAll(other.subregions_); + } return this; } - + + public final boolean isInitialized() { + if (!hasSize()) { + + return false; + } + if (!hasOffset()) { + + return false; + } + for (int i = 0; i < getSubregionsCount(); i++) { + if (!getSubregions(i).isInitialized()) { + + return false; + } + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setSize(input.readInt64()); - break; - } - case 16: { - setOffset(input.readInt64()); - break; - } - case 26: { - setName(input.readString()); - break; - } - case 42: { - net.osmand.binary.OsmandIndex.RoutingSubregion.Builder subBuilder = net.osmand.binary.OsmandIndex.RoutingSubregion.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addSubregions(subBuilder.buildPartial()); - break; - } + net.osmand.binary.OsmandIndex.RoutingPart parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (net.osmand.binary.OsmandIndex.RoutingPart) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - - + private int bitField0_; + // required int64 size = 1; + private long size_ ; + /** + * required int64 size = 1; + */ public boolean hasSize() { - return result.hasSize(); + return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int64 size = 1; + */ public long getSize() { - return result.getSize(); + return size_; } + /** + * required int64 size = 1; + */ public Builder setSize(long value) { - result.hasSize = true; - result.size_ = value; + bitField0_ |= 0x00000001; + size_ = value; + return this; } + /** + * required int64 size = 1; + */ public Builder clearSize() { - result.hasSize = false; - result.size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + return this; } - + // required int64 offset = 2; + private long offset_ ; + /** + * required int64 offset = 2; + */ public boolean hasOffset() { - return result.hasOffset(); + return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required int64 offset = 2; + */ public long getOffset() { - return result.getOffset(); + return offset_; } + /** + * required int64 offset = 2; + */ public Builder setOffset(long value) { - result.hasOffset = true; - result.offset_ = value; + bitField0_ |= 0x00000002; + offset_ = value; + return this; } + /** + * required int64 offset = 2; + */ public Builder clearOffset() { - result.hasOffset = false; - result.offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + offset_ = 0L; + return this; } - + // optional string name = 3; + private java.lang.Object name_ = ""; + /** + * optional string name = 3; + */ public boolean hasName() { - return result.hasName(); + return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional string name = 3; + */ public java.lang.String getName() { - return result.getName(); + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - public Builder setName(java.lang.String value) { + /** + * optional string name = 3; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string name = 3; + */ + public Builder setName( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - result.hasName = true; - result.name_ = value; + bitField0_ |= 0x00000004; + name_ = value; + return this; } + /** + * optional string name = 3; + */ public Builder clearName() { - result.hasName = false; - result.name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + name_ = getDefaultInstance().getName(); + return this; } - - // repeated .RoutingSubregion subregions = 5; + /** + * optional string name = 3; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + name_ = value; + + return this; + } + + // repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + private java.util.List subregions_ = + java.util.Collections.emptyList(); + private void ensureSubregionsIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + subregions_ = new java.util.ArrayList(subregions_); + bitField0_ |= 0x00000008; + } + } + + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ public java.util.List getSubregionsList() { - return java.util.Collections.unmodifiableList(result.subregions_); + return java.util.Collections.unmodifiableList(subregions_); } + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ public int getSubregionsCount() { - return result.getSubregionsCount(); + return subregions_.size(); } + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ public net.osmand.binary.OsmandIndex.RoutingSubregion getSubregions(int index) { - return result.getSubregions(index); + return subregions_.get(index); } - public Builder setSubregions(int index, net.osmand.binary.OsmandIndex.RoutingSubregion value) { + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + public Builder setSubregions( + int index, net.osmand.binary.OsmandIndex.RoutingSubregion value) { if (value == null) { throw new NullPointerException(); } - result.subregions_.set(index, value); + ensureSubregionsIsMutable(); + subregions_.set(index, value); + return this; } - public Builder setSubregions(int index, net.osmand.binary.OsmandIndex.RoutingSubregion.Builder builderForValue) { - result.subregions_.set(index, builderForValue.build()); + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + public Builder setSubregions( + int index, net.osmand.binary.OsmandIndex.RoutingSubregion.Builder builderForValue) { + ensureSubregionsIsMutable(); + subregions_.set(index, builderForValue.build()); + return this; } + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ public Builder addSubregions(net.osmand.binary.OsmandIndex.RoutingSubregion value) { if (value == null) { throw new NullPointerException(); } - if (result.subregions_.isEmpty()) { - result.subregions_ = new java.util.ArrayList(); - } - result.subregions_.add(value); + ensureSubregionsIsMutable(); + subregions_.add(value); + return this; } - public Builder addSubregions(net.osmand.binary.OsmandIndex.RoutingSubregion.Builder builderForValue) { - if (result.subregions_.isEmpty()) { - result.subregions_ = new java.util.ArrayList(); + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + public Builder addSubregions( + int index, net.osmand.binary.OsmandIndex.RoutingSubregion value) { + if (value == null) { + throw new NullPointerException(); } - result.subregions_.add(builderForValue.build()); + ensureSubregionsIsMutable(); + subregions_.add(index, value); + return this; } + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + public Builder addSubregions( + net.osmand.binary.OsmandIndex.RoutingSubregion.Builder builderForValue) { + ensureSubregionsIsMutable(); + subregions_.add(builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + public Builder addSubregions( + int index, net.osmand.binary.OsmandIndex.RoutingSubregion.Builder builderForValue) { + ensureSubregionsIsMutable(); + subregions_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ public Builder addAllSubregions( java.lang.Iterable values) { - if (result.subregions_.isEmpty()) { - result.subregions_ = new java.util.ArrayList(); - } - super.addAll(values, result.subregions_); + ensureSubregionsIsMutable(); + super.addAll(values, subregions_); + return this; } + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ public Builder clearSubregions() { - result.subregions_ = java.util.Collections.emptyList(); + subregions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + return this; } - - // @@protoc_insertion_point(builder_scope:RoutingPart) + /** + * repeated .OsmAnd.OBF.RoutingSubregion subregions = 5; + */ + public Builder removeSubregions(int index) { + ensureSubregionsIsMutable(); + subregions_.remove(index); + + return this; + } + + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.RoutingPart) } - + static { defaultInstance = new RoutingPart(true); - net.osmand.binary.OsmandIndex.internalForceInit(); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:RoutingPart) + + // @@protoc_insertion_point(class_scope:OsmAnd.OBF.RoutingPart) } - + + public interface TransportPartOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // required int64 size = 1; + /** + * required int64 size = 1; + */ + boolean hasSize(); + /** + * required int64 size = 1; + */ + long getSize(); + + // required int64 offset = 2; + /** + * required int64 offset = 2; + */ + boolean hasOffset(); + /** + * required int64 offset = 2; + */ + long getOffset(); + + // optional string name = 3; + /** + * optional string name = 3; + */ + boolean hasName(); + /** + * optional string name = 3; + */ + java.lang.String getName(); + /** + * optional string name = 3; + */ + com.google.protobuf.ByteString + getNameBytes(); + + // optional int32 left = 4; + /** + * optional int32 left = 4; + */ + boolean hasLeft(); + /** + * optional int32 left = 4; + */ + int getLeft(); + + // optional int32 right = 5; + /** + * optional int32 right = 5; + */ + boolean hasRight(); + /** + * optional int32 right = 5; + */ + int getRight(); + + // optional int32 top = 6; + /** + * optional int32 top = 6; + */ + boolean hasTop(); + /** + * optional int32 top = 6; + */ + int getTop(); + + // optional int32 bottom = 7; + /** + * optional int32 bottom = 7; + */ + boolean hasBottom(); + /** + * optional int32 bottom = 7; + */ + int getBottom(); + + // optional uint32 stringTableOffset = 8; + /** + * optional uint32 stringTableOffset = 8; + */ + boolean hasStringTableOffset(); + /** + * optional uint32 stringTableOffset = 8; + */ + int getStringTableOffset(); + + // optional uint32 stringTableLength = 9; + /** + * optional uint32 stringTableLength = 9; + */ + boolean hasStringTableLength(); + /** + * optional uint32 stringTableLength = 9; + */ + int getStringTableLength(); + + // optional uint32 stopsTableOffset = 10; + /** + * optional uint32 stopsTableOffset = 10; + */ + boolean hasStopsTableOffset(); + /** + * optional uint32 stopsTableOffset = 10; + */ + int getStopsTableOffset(); + + // optional uint32 stopsTableLength = 11; + /** + * optional uint32 stopsTableLength = 11; + */ + boolean hasStopsTableLength(); + /** + * optional uint32 stopsTableLength = 11; + */ + int getStopsTableLength(); + + // optional uint32 incompleteRoutesOffset = 12; + /** + * optional uint32 incompleteRoutesOffset = 12; + */ + boolean hasIncompleteRoutesOffset(); + /** + * optional uint32 incompleteRoutesOffset = 12; + */ + int getIncompleteRoutesOffset(); + + // optional uint32 incompleteRoutesLength = 13; + /** + * optional uint32 incompleteRoutesLength = 13; + */ + boolean hasIncompleteRoutesLength(); + /** + * optional uint32 incompleteRoutesLength = 13; + */ + int getIncompleteRoutesLength(); + } + /** + * Protobuf type {@code OsmAnd.OBF.TransportPart} + */ public static final class TransportPart extends - com.google.protobuf.GeneratedMessageLite { + com.google.protobuf.GeneratedMessageLite + implements TransportPartOrBuilder { // Use TransportPart.newBuilder() to construct. - private TransportPart() { - initFields(); + private TransportPart(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + } private TransportPart(boolean noInit) {} - + private static final TransportPart defaultInstance; public static TransportPart getDefaultInstance() { return defaultInstance; } - + public TransportPart getDefaultInstanceForType() { return defaultInstance; } - + + private TransportPart( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + size_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + offset_ = input.readInt64(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + name_ = input.readBytes(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + left_ = input.readInt32(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + right_ = input.readInt32(); + break; + } + case 48: { + bitField0_ |= 0x00000020; + top_ = input.readInt32(); + break; + } + case 56: { + bitField0_ |= 0x00000040; + bottom_ = input.readInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000080; + stringTableOffset_ = input.readUInt32(); + break; + } + case 72: { + bitField0_ |= 0x00000100; + stringTableLength_ = input.readUInt32(); + break; + } + case 80: { + bitField0_ |= 0x00000200; + stopsTableOffset_ = input.readUInt32(); + break; + } + case 88: { + bitField0_ |= 0x00000400; + stopsTableLength_ = input.readUInt32(); + break; + } + case 96: { + bitField0_ |= 0x00000800; + incompleteRoutesOffset_ = input.readUInt32(); + break; + } + case 104: { + bitField0_ |= 0x00001000; + incompleteRoutesLength_ = input.readUInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public TransportPart parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TransportPart(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; // required int64 size = 1; public static final int SIZE_FIELD_NUMBER = 1; - private boolean hasSize; - private long size_ = 0L; - public boolean hasSize() { return hasSize; } - public long getSize() { return size_; } - + private long size_; + /** + * required int64 size = 1; + */ + public boolean hasSize() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int64 size = 1; + */ + public long getSize() { + return size_; + } + // required int64 offset = 2; public static final int OFFSET_FIELD_NUMBER = 2; - private boolean hasOffset; - private long offset_ = 0L; - public boolean hasOffset() { return hasOffset; } - public long getOffset() { return offset_; } - + private long offset_; + /** + * required int64 offset = 2; + */ + public boolean hasOffset() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required int64 offset = 2; + */ + public long getOffset() { + return offset_; + } + // optional string name = 3; public static final int NAME_FIELD_NUMBER = 3; - private boolean hasName; - private java.lang.String name_ = ""; - public boolean hasName() { return hasName; } - public java.lang.String getName() { return name_; } - + private java.lang.Object name_; + /** + * optional string name = 3; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string name = 3; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * optional string name = 3; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + // optional int32 left = 4; public static final int LEFT_FIELD_NUMBER = 4; - private boolean hasLeft; - private int left_ = 0; - public boolean hasLeft() { return hasLeft; } - public int getLeft() { return left_; } - + private int left_; + /** + * optional int32 left = 4; + */ + public boolean hasLeft() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 left = 4; + */ + public int getLeft() { + return left_; + } + // optional int32 right = 5; public static final int RIGHT_FIELD_NUMBER = 5; - private boolean hasRight; - private int right_ = 0; - public boolean hasRight() { return hasRight; } - public int getRight() { return right_; } - + private int right_; + /** + * optional int32 right = 5; + */ + public boolean hasRight() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 right = 5; + */ + public int getRight() { + return right_; + } + // optional int32 top = 6; public static final int TOP_FIELD_NUMBER = 6; - private boolean hasTop; - private int top_ = 0; - public boolean hasTop() { return hasTop; } - public int getTop() { return top_; } - + private int top_; + /** + * optional int32 top = 6; + */ + public boolean hasTop() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 top = 6; + */ + public int getTop() { + return top_; + } + // optional int32 bottom = 7; public static final int BOTTOM_FIELD_NUMBER = 7; - private boolean hasBottom; - private int bottom_ = 0; - public boolean hasBottom() { return hasBottom; } - public int getBottom() { return bottom_; } - + private int bottom_; + /** + * optional int32 bottom = 7; + */ + public boolean hasBottom() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 bottom = 7; + */ + public int getBottom() { + return bottom_; + } + // optional uint32 stringTableOffset = 8; public static final int STRINGTABLEOFFSET_FIELD_NUMBER = 8; - private boolean hasStringTableOffset; - private int stringTableOffset_ = 0; - public boolean hasStringTableOffset() { return hasStringTableOffset; } - public int getStringTableOffset() { return stringTableOffset_; } - + private int stringTableOffset_; + /** + * optional uint32 stringTableOffset = 8; + */ + public boolean hasStringTableOffset() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional uint32 stringTableOffset = 8; + */ + public int getStringTableOffset() { + return stringTableOffset_; + } + // optional uint32 stringTableLength = 9; public static final int STRINGTABLELENGTH_FIELD_NUMBER = 9; - private boolean hasStringTableLength; - private int stringTableLength_ = 0; - public boolean hasStringTableLength() { return hasStringTableLength; } - public int getStringTableLength() { return stringTableLength_; } - + private int stringTableLength_; + /** + * optional uint32 stringTableLength = 9; + */ + public boolean hasStringTableLength() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional uint32 stringTableLength = 9; + */ + public int getStringTableLength() { + return stringTableLength_; + } + // optional uint32 stopsTableOffset = 10; public static final int STOPSTABLEOFFSET_FIELD_NUMBER = 10; - private boolean hasStopsTableOffset; - private int stopsTableOffset_ = 0; - public boolean hasStopsTableOffset() { return hasStopsTableOffset; } - public int getStopsTableOffset() { return stopsTableOffset_; } - + private int stopsTableOffset_; + /** + * optional uint32 stopsTableOffset = 10; + */ + public boolean hasStopsTableOffset() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional uint32 stopsTableOffset = 10; + */ + public int getStopsTableOffset() { + return stopsTableOffset_; + } + // optional uint32 stopsTableLength = 11; public static final int STOPSTABLELENGTH_FIELD_NUMBER = 11; - private boolean hasStopsTableLength; - private int stopsTableLength_ = 0; - public boolean hasStopsTableLength() { return hasStopsTableLength; } - public int getStopsTableLength() { return stopsTableLength_; } - - private void initFields() { + private int stopsTableLength_; + /** + * optional uint32 stopsTableLength = 11; + */ + public boolean hasStopsTableLength() { + return ((bitField0_ & 0x00000400) == 0x00000400); } + /** + * optional uint32 stopsTableLength = 11; + */ + public int getStopsTableLength() { + return stopsTableLength_; + } + + // optional uint32 incompleteRoutesOffset = 12; + public static final int INCOMPLETEROUTESOFFSET_FIELD_NUMBER = 12; + private int incompleteRoutesOffset_; + /** + * optional uint32 incompleteRoutesOffset = 12; + */ + public boolean hasIncompleteRoutesOffset() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional uint32 incompleteRoutesOffset = 12; + */ + public int getIncompleteRoutesOffset() { + return incompleteRoutesOffset_; + } + + // optional uint32 incompleteRoutesLength = 13; + public static final int INCOMPLETEROUTESLENGTH_FIELD_NUMBER = 13; + private int incompleteRoutesLength_; + /** + * optional uint32 incompleteRoutesLength = 13; + */ + public boolean hasIncompleteRoutesLength() { + return ((bitField0_ & 0x00001000) == 0x00001000); + } + /** + * optional uint32 incompleteRoutesLength = 13; + */ + public int getIncompleteRoutesLength() { + return incompleteRoutesLength_; + } + + private void initFields() { + size_ = 0L; + offset_ = 0L; + name_ = ""; + left_ = 0; + right_ = 0; + top_ = 0; + bottom_ = 0; + stringTableOffset_ = 0; + stringTableLength_ = 0; + stopsTableOffset_ = 0; + stopsTableLength_ = 0; + incompleteRoutesOffset_ = 0; + incompleteRoutesLength_ = 0; + } + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { - if (!hasSize) return false; - if (!hasOffset) return false; + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasSize()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasOffset()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasSize()) { - output.writeInt64(1, getSize()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, size_); } - if (hasOffset()) { - output.writeInt64(2, getOffset()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, offset_); } - if (hasName()) { - output.writeString(3, getName()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getNameBytes()); } - if (hasLeft()) { - output.writeInt32(4, getLeft()); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, left_); } - if (hasRight()) { - output.writeInt32(5, getRight()); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, right_); } - if (hasTop()) { - output.writeInt32(6, getTop()); + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(6, top_); } - if (hasBottom()) { - output.writeInt32(7, getBottom()); + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(7, bottom_); } - if (hasStringTableOffset()) { - output.writeUInt32(8, getStringTableOffset()); + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeUInt32(8, stringTableOffset_); } - if (hasStringTableLength()) { - output.writeUInt32(9, getStringTableLength()); + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeUInt32(9, stringTableLength_); } - if (hasStopsTableOffset()) { - output.writeUInt32(10, getStopsTableOffset()); + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeUInt32(10, stopsTableOffset_); } - if (hasStopsTableLength()) { - output.writeUInt32(11, getStopsTableLength()); + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeUInt32(11, stopsTableLength_); + } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + output.writeUInt32(12, incompleteRoutesOffset_); + } + if (((bitField0_ & 0x00001000) == 0x00001000)) { + output.writeUInt32(13, incompleteRoutesLength_); } } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; - if (hasSize()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, getSize()); + .computeInt64Size(1, size_); } - if (hasOffset()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, getOffset()); + .computeInt64Size(2, offset_); } - if (hasName()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(3, getName()); + .computeBytesSize(3, getNameBytes()); } - if (hasLeft()) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, getLeft()); + .computeInt32Size(4, left_); } - if (hasRight()) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, getRight()); + .computeInt32Size(5, right_); } - if (hasTop()) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, getTop()); + .computeInt32Size(6, top_); } - if (hasBottom()) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, getBottom()); + .computeInt32Size(7, bottom_); } - if (hasStringTableOffset()) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(8, getStringTableOffset()); + .computeUInt32Size(8, stringTableOffset_); } - if (hasStringTableLength()) { + if (((bitField0_ & 0x00000100) == 0x00000100)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(9, getStringTableLength()); + .computeUInt32Size(9, stringTableLength_); } - if (hasStopsTableOffset()) { + if (((bitField0_ & 0x00000200) == 0x00000200)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(10, getStopsTableOffset()); + .computeUInt32Size(10, stopsTableOffset_); } - if (hasStopsTableLength()) { + if (((bitField0_ & 0x00000400) == 0x00000400)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(11, getStopsTableLength()); + .computeUInt32Size(11, stopsTableLength_); + } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(12, incompleteRoutesOffset_); + } + if (((bitField0_ & 0x00001000) == 0x00001000)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(13, incompleteRoutesLength_); } memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static net.osmand.binary.OsmandIndex.TransportPart parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.TransportPart parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.TransportPart parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static net.osmand.binary.OsmandIndex.TransportPart parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static net.osmand.binary.OsmandIndex.TransportPart parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.TransportPart parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.TransportPart parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static net.osmand.binary.OsmandIndex.TransportPart parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static net.osmand.binary.OsmandIndex.TransportPart parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static net.osmand.binary.OsmandIndex.TransportPart parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(net.osmand.binary.OsmandIndex.TransportPart prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + + /** + * Protobuf type {@code OsmAnd.OBF.TransportPart} + */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - net.osmand.binary.OsmandIndex.TransportPart, Builder> { - private net.osmand.binary.OsmandIndex.TransportPart result; - + net.osmand.binary.OsmandIndex.TransportPart, Builder> + implements net.osmand.binary.OsmandIndex.TransportPartOrBuilder { // Construct using net.osmand.binary.OsmandIndex.TransportPart.newBuilder() - private Builder() {} - + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } private static Builder create() { - Builder builder = new Builder(); - builder.result = new net.osmand.binary.OsmandIndex.TransportPart(); - return builder; + return new Builder(); } - - protected net.osmand.binary.OsmandIndex.TransportPart internalGetResult() { - return result; - } - + public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new net.osmand.binary.OsmandIndex.TransportPart(); + super.clear(); + size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + left_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + right_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + top_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + bottom_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + stringTableOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); + stringTableLength_ = 0; + bitField0_ = (bitField0_ & ~0x00000100); + stopsTableOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000200); + stopsTableLength_ = 0; + bitField0_ = (bitField0_ & ~0x00000400); + incompleteRoutesOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000800); + incompleteRoutesLength_ = 0; + bitField0_ = (bitField0_ & ~0x00001000); return this; } - + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - + public net.osmand.binary.OsmandIndex.TransportPart getDefaultInstanceForType() { return net.osmand.binary.OsmandIndex.TransportPart.getDefaultInstance(); } - - public boolean isInitialized() { - return result.isInitialized(); - } + public net.osmand.binary.OsmandIndex.TransportPart build() { - if (result != null && !isInitialized()) { + net.osmand.binary.OsmandIndex.TransportPart result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - - private net.osmand.binary.OsmandIndex.TransportPart buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - + public net.osmand.binary.OsmandIndex.TransportPart buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + net.osmand.binary.OsmandIndex.TransportPart result = new net.osmand.binary.OsmandIndex.TransportPart(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - net.osmand.binary.OsmandIndex.TransportPart returnMe = result; - result = null; - return returnMe; + result.size_ = size_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.offset_ = offset_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.left_ = left_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.right_ = right_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.top_ = top_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.bottom_ = bottom_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.stringTableOffset_ = stringTableOffset_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000100; + } + result.stringTableLength_ = stringTableLength_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000200; + } + result.stopsTableOffset_ = stopsTableOffset_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000400; + } + result.stopsTableLength_ = stopsTableLength_; + if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + to_bitField0_ |= 0x00000800; + } + result.incompleteRoutesOffset_ = incompleteRoutesOffset_; + if (((from_bitField0_ & 0x00001000) == 0x00001000)) { + to_bitField0_ |= 0x00001000; + } + result.incompleteRoutesLength_ = incompleteRoutesLength_; + result.bitField0_ = to_bitField0_; + return result; } - + public Builder mergeFrom(net.osmand.binary.OsmandIndex.TransportPart other) { if (other == net.osmand.binary.OsmandIndex.TransportPart.getDefaultInstance()) return this; if (other.hasSize()) { @@ -4874,7 +9561,9 @@ public final class OsmandIndex { setOffset(other.getOffset()); } if (other.hasName()) { - setName(other.getName()); + bitField0_ |= 0x00000004; + name_ = other.name_; + } if (other.hasLeft()) { setLeft(other.getLeft()); @@ -4900,291 +9589,530 @@ public final class OsmandIndex { if (other.hasStopsTableLength()) { setStopsTableLength(other.getStopsTableLength()); } + if (other.hasIncompleteRoutesOffset()) { + setIncompleteRoutesOffset(other.getIncompleteRoutesOffset()); + } + if (other.hasIncompleteRoutesLength()) { + setIncompleteRoutesLength(other.getIncompleteRoutesLength()); + } return this; } - + + public final boolean isInitialized() { + if (!hasSize()) { + + return false; + } + if (!hasOffset()) { + + return false; + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - return this; - default: { - if (!parseUnknownField(input, extensionRegistry, tag)) { - return this; - } - break; - } - case 8: { - setSize(input.readInt64()); - break; - } - case 16: { - setOffset(input.readInt64()); - break; - } - case 26: { - setName(input.readString()); - break; - } - case 32: { - setLeft(input.readInt32()); - break; - } - case 40: { - setRight(input.readInt32()); - break; - } - case 48: { - setTop(input.readInt32()); - break; - } - case 56: { - setBottom(input.readInt32()); - break; - } - case 64: { - setStringTableOffset(input.readUInt32()); - break; - } - case 72: { - setStringTableLength(input.readUInt32()); - break; - } - case 80: { - setStopsTableOffset(input.readUInt32()); - break; - } - case 88: { - setStopsTableLength(input.readUInt32()); - break; - } + net.osmand.binary.OsmandIndex.TransportPart parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (net.osmand.binary.OsmandIndex.TransportPart) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - - + private int bitField0_; + // required int64 size = 1; + private long size_ ; + /** + * required int64 size = 1; + */ public boolean hasSize() { - return result.hasSize(); + return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int64 size = 1; + */ public long getSize() { - return result.getSize(); + return size_; } + /** + * required int64 size = 1; + */ public Builder setSize(long value) { - result.hasSize = true; - result.size_ = value; + bitField0_ |= 0x00000001; + size_ = value; + return this; } + /** + * required int64 size = 1; + */ public Builder clearSize() { - result.hasSize = false; - result.size_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + return this; } - + // required int64 offset = 2; + private long offset_ ; + /** + * required int64 offset = 2; + */ public boolean hasOffset() { - return result.hasOffset(); + return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required int64 offset = 2; + */ public long getOffset() { - return result.getOffset(); + return offset_; } + /** + * required int64 offset = 2; + */ public Builder setOffset(long value) { - result.hasOffset = true; - result.offset_ = value; + bitField0_ |= 0x00000002; + offset_ = value; + return this; } + /** + * required int64 offset = 2; + */ public Builder clearOffset() { - result.hasOffset = false; - result.offset_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + offset_ = 0L; + return this; } - + // optional string name = 3; + private java.lang.Object name_ = ""; + /** + * optional string name = 3; + */ public boolean hasName() { - return result.hasName(); + return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional string name = 3; + */ public java.lang.String getName() { - return result.getName(); + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - public Builder setName(java.lang.String value) { + /** + * optional string name = 3; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string name = 3; + */ + public Builder setName( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - result.hasName = true; - result.name_ = value; + bitField0_ |= 0x00000004; + name_ = value; + return this; } + /** + * optional string name = 3; + */ public Builder clearName() { - result.hasName = false; - result.name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + name_ = getDefaultInstance().getName(); + return this; } - + /** + * optional string name = 3; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + name_ = value; + + return this; + } + // optional int32 left = 4; + private int left_ ; + /** + * optional int32 left = 4; + */ public boolean hasLeft() { - return result.hasLeft(); + return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional int32 left = 4; + */ public int getLeft() { - return result.getLeft(); + return left_; } + /** + * optional int32 left = 4; + */ public Builder setLeft(int value) { - result.hasLeft = true; - result.left_ = value; + bitField0_ |= 0x00000008; + left_ = value; + return this; } + /** + * optional int32 left = 4; + */ public Builder clearLeft() { - result.hasLeft = false; - result.left_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + left_ = 0; + return this; } - + // optional int32 right = 5; + private int right_ ; + /** + * optional int32 right = 5; + */ public boolean hasRight() { - return result.hasRight(); + return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * optional int32 right = 5; + */ public int getRight() { - return result.getRight(); + return right_; } + /** + * optional int32 right = 5; + */ public Builder setRight(int value) { - result.hasRight = true; - result.right_ = value; + bitField0_ |= 0x00000010; + right_ = value; + return this; } + /** + * optional int32 right = 5; + */ public Builder clearRight() { - result.hasRight = false; - result.right_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + right_ = 0; + return this; } - + // optional int32 top = 6; + private int top_ ; + /** + * optional int32 top = 6; + */ public boolean hasTop() { - return result.hasTop(); + return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * optional int32 top = 6; + */ public int getTop() { - return result.getTop(); + return top_; } + /** + * optional int32 top = 6; + */ public Builder setTop(int value) { - result.hasTop = true; - result.top_ = value; + bitField0_ |= 0x00000020; + top_ = value; + return this; } + /** + * optional int32 top = 6; + */ public Builder clearTop() { - result.hasTop = false; - result.top_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + top_ = 0; + return this; } - + // optional int32 bottom = 7; + private int bottom_ ; + /** + * optional int32 bottom = 7; + */ public boolean hasBottom() { - return result.hasBottom(); + return ((bitField0_ & 0x00000040) == 0x00000040); } + /** + * optional int32 bottom = 7; + */ public int getBottom() { - return result.getBottom(); + return bottom_; } + /** + * optional int32 bottom = 7; + */ public Builder setBottom(int value) { - result.hasBottom = true; - result.bottom_ = value; + bitField0_ |= 0x00000040; + bottom_ = value; + return this; } + /** + * optional int32 bottom = 7; + */ public Builder clearBottom() { - result.hasBottom = false; - result.bottom_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + bottom_ = 0; + return this; } - + // optional uint32 stringTableOffset = 8; + private int stringTableOffset_ ; + /** + * optional uint32 stringTableOffset = 8; + */ public boolean hasStringTableOffset() { - return result.hasStringTableOffset(); + return ((bitField0_ & 0x00000080) == 0x00000080); } + /** + * optional uint32 stringTableOffset = 8; + */ public int getStringTableOffset() { - return result.getStringTableOffset(); + return stringTableOffset_; } + /** + * optional uint32 stringTableOffset = 8; + */ public Builder setStringTableOffset(int value) { - result.hasStringTableOffset = true; - result.stringTableOffset_ = value; + bitField0_ |= 0x00000080; + stringTableOffset_ = value; + return this; } + /** + * optional uint32 stringTableOffset = 8; + */ public Builder clearStringTableOffset() { - result.hasStringTableOffset = false; - result.stringTableOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); + stringTableOffset_ = 0; + return this; } - + // optional uint32 stringTableLength = 9; + private int stringTableLength_ ; + /** + * optional uint32 stringTableLength = 9; + */ public boolean hasStringTableLength() { - return result.hasStringTableLength(); + return ((bitField0_ & 0x00000100) == 0x00000100); } + /** + * optional uint32 stringTableLength = 9; + */ public int getStringTableLength() { - return result.getStringTableLength(); + return stringTableLength_; } + /** + * optional uint32 stringTableLength = 9; + */ public Builder setStringTableLength(int value) { - result.hasStringTableLength = true; - result.stringTableLength_ = value; + bitField0_ |= 0x00000100; + stringTableLength_ = value; + return this; } + /** + * optional uint32 stringTableLength = 9; + */ public Builder clearStringTableLength() { - result.hasStringTableLength = false; - result.stringTableLength_ = 0; + bitField0_ = (bitField0_ & ~0x00000100); + stringTableLength_ = 0; + return this; } - + // optional uint32 stopsTableOffset = 10; + private int stopsTableOffset_ ; + /** + * optional uint32 stopsTableOffset = 10; + */ public boolean hasStopsTableOffset() { - return result.hasStopsTableOffset(); + return ((bitField0_ & 0x00000200) == 0x00000200); } + /** + * optional uint32 stopsTableOffset = 10; + */ public int getStopsTableOffset() { - return result.getStopsTableOffset(); + return stopsTableOffset_; } + /** + * optional uint32 stopsTableOffset = 10; + */ public Builder setStopsTableOffset(int value) { - result.hasStopsTableOffset = true; - result.stopsTableOffset_ = value; + bitField0_ |= 0x00000200; + stopsTableOffset_ = value; + return this; } + /** + * optional uint32 stopsTableOffset = 10; + */ public Builder clearStopsTableOffset() { - result.hasStopsTableOffset = false; - result.stopsTableOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000200); + stopsTableOffset_ = 0; + return this; } - + // optional uint32 stopsTableLength = 11; + private int stopsTableLength_ ; + /** + * optional uint32 stopsTableLength = 11; + */ public boolean hasStopsTableLength() { - return result.hasStopsTableLength(); + return ((bitField0_ & 0x00000400) == 0x00000400); } + /** + * optional uint32 stopsTableLength = 11; + */ public int getStopsTableLength() { - return result.getStopsTableLength(); + return stopsTableLength_; } + /** + * optional uint32 stopsTableLength = 11; + */ public Builder setStopsTableLength(int value) { - result.hasStopsTableLength = true; - result.stopsTableLength_ = value; + bitField0_ |= 0x00000400; + stopsTableLength_ = value; + return this; } + /** + * optional uint32 stopsTableLength = 11; + */ public Builder clearStopsTableLength() { - result.hasStopsTableLength = false; - result.stopsTableLength_ = 0; + bitField0_ = (bitField0_ & ~0x00000400); + stopsTableLength_ = 0; + return this; } - - // @@protoc_insertion_point(builder_scope:TransportPart) + + // optional uint32 incompleteRoutesOffset = 12; + private int incompleteRoutesOffset_ ; + /** + * optional uint32 incompleteRoutesOffset = 12; + */ + public boolean hasIncompleteRoutesOffset() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional uint32 incompleteRoutesOffset = 12; + */ + public int getIncompleteRoutesOffset() { + return incompleteRoutesOffset_; + } + /** + * optional uint32 incompleteRoutesOffset = 12; + */ + public Builder setIncompleteRoutesOffset(int value) { + bitField0_ |= 0x00000800; + incompleteRoutesOffset_ = value; + + return this; + } + /** + * optional uint32 incompleteRoutesOffset = 12; + */ + public Builder clearIncompleteRoutesOffset() { + bitField0_ = (bitField0_ & ~0x00000800); + incompleteRoutesOffset_ = 0; + + return this; + } + + // optional uint32 incompleteRoutesLength = 13; + private int incompleteRoutesLength_ ; + /** + * optional uint32 incompleteRoutesLength = 13; + */ + public boolean hasIncompleteRoutesLength() { + return ((bitField0_ & 0x00001000) == 0x00001000); + } + /** + * optional uint32 incompleteRoutesLength = 13; + */ + public int getIncompleteRoutesLength() { + return incompleteRoutesLength_; + } + /** + * optional uint32 incompleteRoutesLength = 13; + */ + public Builder setIncompleteRoutesLength(int value) { + bitField0_ |= 0x00001000; + incompleteRoutesLength_ = value; + + return this; + } + /** + * optional uint32 incompleteRoutesLength = 13; + */ + public Builder clearIncompleteRoutesLength() { + bitField0_ = (bitField0_ & ~0x00001000); + incompleteRoutesLength_ = 0; + + return this; + } + + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.TransportPart) } - + static { defaultInstance = new TransportPart(true); - net.osmand.binary.OsmandIndex.internalForceInit(); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:TransportPart) + + // @@protoc_insertion_point(class_scope:OsmAnd.OBF.TransportPart) } - - + + static { } - - public static void internalForceInit() {} - + // @@protoc_insertion_point(outer_class_scope) } diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 9ca8d2a609..06821b20bd 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -726,7 +726,6 @@ public class TransportRoutePlanner { private final int walkRadiusIn31; private final int walkChangeRadiusIn31; - private final int missingStopRadiusIn31; @@ -734,7 +733,6 @@ public class TransportRoutePlanner { this.cfg = cfg; walkRadiusIn31 = (int) (cfg.walkRadius / MapUtils.getTileDistanceWidth(31)); walkChangeRadiusIn31 = (int) (cfg.walkChangeRadius / MapUtils.getTileDistanceWidth(31)); - missingStopRadiusIn31 = (int) (MISSING_STOP_SEARCH_RADIUS / MapUtils.getTileDistanceWidth(31)); quadTree = new TLongObjectHashMap>(); this.library = library; for (BinaryMapIndexReader r : readers) { @@ -755,7 +753,6 @@ public class TransportRoutePlanner { private List loadNativeTransportStops(int sx, int sy, boolean change, List res) throws IOException { long nanoTime = System.nanoTime(); int d = change ? walkChangeRadiusIn31 : walkRadiusIn31; - int lx = (sx - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); int rx = (sx + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); int ty = (sy - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); @@ -770,7 +767,6 @@ public class TransportRoutePlanner { } for(TransportRouteSegment r : list) { TransportStop st = r.getStop(r.segStart); - if (Math.abs(st.x31 - sx) > walkRadiusIn31 || Math.abs(st.y31 - sy) > walkRadiusIn31) { wrongLoadedWays++; } else { From 0d96394a0e19c13d589f988987944523814041c8 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 20:15:16 +0200 Subject: [PATCH 68/91] Udpate planner --- .../java/net/osmand/router/TransportRoutePlanner.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 06821b20bd..599c664203 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -709,6 +709,9 @@ public class TransportRoutePlanner { public Map> missingStopsCache = new HashMap>(); public TLongObjectHashMap> quadTree; + // Here we don't limit files by bbox, so it could be an issue while searching for multiple unused files + // Incomplete routes usually don't need more files than around Max-BBOX of start/end, + // so here an improvement could be introduced public final Map> routeMap = new LinkedHashMap>(); @@ -834,7 +837,7 @@ public class TransportRoutePlanner { } } } - //there should go stops with complete routes: + // There should go stops with complete routes: loadTransportSegments(loadedTransportStops.valueCollection(), lst); readTime += System.nanoTime() - nanoTime; @@ -1101,7 +1104,7 @@ public class TransportRoutePlanner { private LinkedList> parseRoutePartsToSegments(List routeParts) { LinkedList> segs = new LinkedList>(); // here we assume that missing stops come in pairs - // TODO check generation that are doubles + // we don't add segments with 1 stop cause they are irrelevant further for (TransportRoute part : routeParts) { List newSeg = new ArrayList(); for (TransportStop s : part.getForwardStops()) { @@ -1122,8 +1125,8 @@ public class TransportRoutePlanner { private List findIncompleteRouteParts(TransportRoute baseRoute) throws IOException { List allRoutes = null; - // TODO completely irrelevant always reiteration over all maps (especially not in bbox of the route probabl) for (BinaryMapIndexReader bmir : routeMap.keySet()) { + // here we could limit routeMap indexes by only certain bbox around start / end (check comment on field) IncompleteTransportRoute ptr = bmir.getIncompleteTransportRoutes().get(baseRoute.getId()); if (ptr != null) { TIntArrayList lst = new TIntArrayList(); From a01a4ad63e24e96f37d125b22803513989cf9832 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 21:28:00 +0200 Subject: [PATCH 69/91] Fix broken geometry --- .../java/net/osmand/data/DataTileManager.java | 6 +-- .../osmand/router/TransportRoutePlanner.java | 49 +++++++++++-------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/DataTileManager.java b/OsmAnd-java/src/main/java/net/osmand/data/DataTileManager.java index ca76753bfa..aeed49c9dd 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/DataTileManager.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/DataTileManager.java @@ -44,10 +44,10 @@ public class DataTileManager { return x; } - private void putObjects(int tx, int ty, List r){ - if(objects.containsKey(evTile(tx, ty))){ + private void putObjects(int tx, int ty, List r) { + if (objects.containsKey(evTile(tx, ty))) { r.addAll(objects.get(evTile(tx, ty))); - } + } } @SuppressWarnings({ "rawtypes", "unchecked" }) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 599c664203..84e257323b 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -36,6 +36,7 @@ public class TransportRoutePlanner { private static final boolean MEASURE_TIME = false; private static final int MISSING_STOP_SEARCH_RADIUS = 15000; + private static final int MIN_DIST_STOP_TO_GEOMETRY = 150; public static final long GEOMETRY_WAY_ID = -1; public static final long STOPS_WAY_ID = -2; @@ -381,8 +382,7 @@ public class TransportRoutePlanner { } public List getGeometry() { - List list = new ArrayList<>(); - route.mergeForwardWays(); //TODO merge ways of all Route parts + route.mergeForwardWays(); if (DISPLAY_FULL_SEGMENT_ROUTE) { System.out.println("TOTAL SEGMENTS: " + route.getForwardWays().size()); if (route.getForwardWays().size() > DISPLAY_SEGMENT_IND) { @@ -390,30 +390,40 @@ public class TransportRoutePlanner { } return route.getForwardWays(); } - List fw = route.getForwardWays(); - double minStart = 150; - double minEnd = 150; - LatLon str = getStart().getLocation(); - LatLon en = getEnd().getLocation(); - int endInd = -1; - List res = new ArrayList<>(); - for (int i = 0; i < fw.size() ; i++) { - List nodes = fw.get(i).getNodes(); + List ways = route.getForwardWays(); + + final LatLon startLoc = getStart().getLocation(); + final LatLon endLoc = getEnd().getLocation(); + + List finalr = Collections.emptyList(); + int fendInd = -1; + double fminStartDist = MIN_DIST_STOP_TO_GEOMETRY; + for (int i = 0; i < ways.size() ; i++) { + List nodes = ways.get(i).getNodes(); + List res = new ArrayList<>(); + double minStartDist = MIN_DIST_STOP_TO_GEOMETRY; + double minDistEnd = MIN_DIST_STOP_TO_GEOMETRY; + int endInd = -1; for (int j = 0; j < nodes.size(); j++) { Node n = nodes.get(j); - if (MapUtils.getDistance(str, n.getLatitude(), n.getLongitude()) < minStart) { - minStart = MapUtils.getDistance(str, n.getLatitude(), n.getLongitude()); + if (MapUtils.getDistance(startLoc, n.getLatitude(), n.getLongitude()) < minStartDist) { + minStartDist = MapUtils.getDistance(startLoc, n.getLatitude(), n.getLongitude()); res.clear(); } res.add(n); - if (MapUtils.getDistance(en, n.getLatitude(), n.getLongitude()) < minEnd) { + if (MapUtils.getDistance(endLoc, n.getLatitude(), n.getLongitude()) < minDistEnd) { endInd = res.size(); - minEnd = MapUtils.getDistance(en, n.getLatitude(), n.getLongitude()); + minDistEnd = MapUtils.getDistance(endLoc, n.getLatitude(), n.getLongitude()); } } + if(endInd != -1 && res.size() > 0 && minStartDist < fminStartDist) { + finalr = res; + fendInd = endInd; + fminStartDist = minStartDist; + } } Way way; - if (res.isEmpty() || endInd == -1) { + if (finalr.isEmpty() || fendInd == -1) { way = new Way(STOPS_WAY_ID); for (int i = start; i <= end; i++) { LatLon l = getStop(i).getLocation(); @@ -422,12 +432,11 @@ public class TransportRoutePlanner { } } else { way = new Way(GEOMETRY_WAY_ID); - for(int k = 0; k < res.size() && k < endInd; k++) { - way.addNode(res.get(k)); + for(int k = 0; k < finalr.size() && k < fendInd; k++) { + way.addNode(finalr.get(k)); } } - list.add(way); - return list; + return Collections.singletonList(way); } public double getTravelDist() { From f529dfad5d0989c7695ea18c0949832b83e7002b Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 22:24:08 +0200 Subject: [PATCH 70/91] Optimize drawing geometry --- .../osmand/router/TransportRoutePlanner.java | 80 ++++++++++++------- 1 file changed, 51 insertions(+), 29 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 84e257323b..c401f58319 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -380,6 +380,12 @@ public class TransportRoutePlanner { } return nodes; } + + private static class SearchNodeInd { + int ind = -1; + Way way = null; + double dist = MIN_DIST_STOP_TO_GEOMETRY; + } public List getGeometry() { route.mergeForwardWays(); @@ -394,47 +400,63 @@ public class TransportRoutePlanner { final LatLon startLoc = getStart().getLocation(); final LatLon endLoc = getEnd().getLocation(); - - List finalr = Collections.emptyList(); - int fendInd = -1; - double fminStartDist = MIN_DIST_STOP_TO_GEOMETRY; + SearchNodeInd startInd = new SearchNodeInd(); + SearchNodeInd endInd = new SearchNodeInd(); for (int i = 0; i < ways.size() ; i++) { List nodes = ways.get(i).getNodes(); - List res = new ArrayList<>(); - double minStartDist = MIN_DIST_STOP_TO_GEOMETRY; - double minDistEnd = MIN_DIST_STOP_TO_GEOMETRY; - int endInd = -1; for (int j = 0; j < nodes.size(); j++) { Node n = nodes.get(j); - if (MapUtils.getDistance(startLoc, n.getLatitude(), n.getLongitude()) < minStartDist) { - minStartDist = MapUtils.getDistance(startLoc, n.getLatitude(), n.getLongitude()); - res.clear(); + if (MapUtils.getDistance(startLoc, n.getLatitude(), n.getLongitude()) < startInd.dist) { + startInd.dist = MapUtils.getDistance(startLoc, n.getLatitude(), n.getLongitude()); + startInd.ind = j; + startInd.way = ways.get(i); } - res.add(n); - if (MapUtils.getDistance(endLoc, n.getLatitude(), n.getLongitude()) < minDistEnd) { - endInd = res.size(); - minDistEnd = MapUtils.getDistance(endLoc, n.getLatitude(), n.getLongitude()); + if (MapUtils.getDistance(endLoc, n.getLatitude(), n.getLongitude()) < endInd.dist) { + endInd.dist = MapUtils.getDistance(endLoc, n.getLatitude(), n.getLongitude()); + endInd.ind = j; + endInd.way = ways.get(i); } } - if(endInd != -1 && res.size() > 0 && minStartDist < fminStartDist) { - finalr = res; - fendInd = endInd; - fminStartDist = minStartDist; + } + boolean validOneWay = startInd.way != null && startInd.way == endInd.way && startInd.ind <= endInd.ind; + if (validOneWay) { + Way way = new Way(GEOMETRY_WAY_ID); + for (int k = startInd.ind; k <= endInd.ind; k++) { + way.addNode(startInd.way.getNodes().get(k)); + } + return Collections.singletonList(way); + } + boolean validContinuation = startInd.way != null && endInd.way != null && + startInd.way != endInd.way; + if (validContinuation) { + Node ln = startInd.way.getLastNode(); + Node fn = endInd.way.getFirstNode(); + // HERE we need to check other ways for continuation + if (ln != null && fn != null && MapUtils.getDistance(ln.getLatLon(), fn.getLatLon()) < MISSING_STOP_SEARCH_RADIUS) { + validContinuation = true; + } else { + validContinuation = false; } } - Way way; - if (finalr.isEmpty() || fendInd == -1) { - way = new Way(STOPS_WAY_ID); - for (int i = start; i <= end; i++) { - LatLon l = getStop(i).getLocation(); - Node n = new Node(l.getLatitude(), l.getLongitude(), -1); - way.addNode(n); + if (validContinuation) { + List two = new ArrayList(); + Way way = new Way(GEOMETRY_WAY_ID); + for (int k = startInd.ind; k < startInd.way.getNodes().size(); k++) { + way.addNode(startInd.way.getNodes().get(k)); } - } else { + two.add(way); way = new Way(GEOMETRY_WAY_ID); - for(int k = 0; k < finalr.size() && k < fendInd; k++) { - way.addNode(finalr.get(k)); + for (int k = 0; k <= endInd.ind; k++) { + way.addNode(endInd.way.getNodes().get(k)); } + two.add(way); + return two; + } + Way way = new Way(STOPS_WAY_ID); + for (int i = start; i <= end; i++) { + LatLon l = getStop(i).getLocation(); + Node n = new Node(l.getLatitude(), l.getLongitude(), -1); + way.addNode(n); } return Collections.singletonList(way); } From ee1f8c683b544861d646053e5e75afd0d140a7ba Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 22:35:30 +0200 Subject: [PATCH 71/91] Optimize drawing geometry --- .../src/main/java/net/osmand/data/TransportRoute.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java index 4fd2b7d03a..f35f7aacc2 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java @@ -92,7 +92,8 @@ public class TransportRoute extends MapObject { resortWaysToStopsOrder(forwardWays, forwardStops); } - public static void mergeRouteWays(List forwardWays) { + // intrusive operation cause it changes ways itself! + private static void mergeRouteWays(List forwardWays) { boolean changed = true; // combine as many ways as possible while (changed && forwardWays != null) { @@ -159,7 +160,7 @@ public class TransportRoute extends MapObject { } } - public static Map resortWaysToStopsOrder(List forwardWays, List forwardStops) { + private static Map resortWaysToStopsOrder(List forwardWays, List forwardStops) { final Map orderWays = new HashMap(); if (forwardWays != null && forwardStops.size() > 0) { // resort ways to stops order From 30fe9c86983c46593d4610c9a90623e0cfecec7a Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 22:41:21 +0200 Subject: [PATCH 72/91] Add more info --- .../main/java/net/osmand/router/TransportRoutePlanner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index c401f58319..6448cd67a1 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -609,8 +609,8 @@ public class TransportRoutePlanner { if(aTime != -1) { arriveTime = String.format("and arrive at %s", formatTransporTime(aTime)); } - bld.append(String.format(" %d. %s: walk %.1f m to '%s' and travel %s to '%s' by %s %d stops %s\n", - i + 1, s.route.getRef(), s.walkDist, s.getStart().getName(), + bld.append(String.format(" %d. %s [%d]: walk %.1f m to '%s' and travel %s to '%s' by %s %d stops %s\n", + i + 1, s.route.getRef(), s.route.getId() / 2, s.walkDist, s.getStart().getName(), time, s.getEnd().getName(),s.route.getName(), (s.end - s.start), arriveTime)); } bld.append(String.format(" F. Walk %.1f m to reach your destination", finishWalkDist)); From 7589610a278f86fe3eaeca86f02dcba21e0ed074 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 22:55:40 +0200 Subject: [PATCH 73/91] Fix routing --- .../src/main/java/net/osmand/router/TransportRoutePlanner.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 6448cd67a1..457fbe856b 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -999,6 +999,7 @@ public class TransportRoutePlanner { List> sortedSegments = new ArrayList>(); if(firstSegment != null) { sortedSegments.add(firstSegment); + mergedSegments.remove(firstSegment); while(!mergedSegments.isEmpty()) { List last = sortedSegments.get(sortedSegments.size() - 1); List add = findAndDeleteMinDistance(last.get(last.size() - 1).getLocation(), mergedSegments, true); @@ -1007,6 +1008,7 @@ public class TransportRoutePlanner { } else if(lastSegment != null) { sortedSegments.add(lastSegment); + mergedSegments.remove(lastSegment); while(!mergedSegments.isEmpty()) { List first = sortedSegments.get(0); List add = findAndDeleteMinDistance(first.get(0).getLocation(), mergedSegments, false); @@ -1059,6 +1061,7 @@ public class TransportRoutePlanner { while (it.hasNext()) { List segmentToMerge = it.next(); merged = tryToMerge(firstSegment, segmentToMerge); + if (merged) { it.remove(); break; From 5cb1e2fc7eabf9ff9be63c3e497d7dcf4603dfa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Sat, 16 May 2020 15:10:20 +0000 Subject: [PATCH 74/91] Translated using Weblate (Turkish) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-tr/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index 14b125b1cc..31edc81ca0 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -3579,9 +3579,9 @@ Çekmece Ayarları gizlemek onları orijinal durumlarına sıfırlar. Ögeler - Çekmecedeki ögelerin sayısını özelleştirin, haritayı ve içerik menüsünü yapılandırın. + Çekmece, Haritayı Yapılandır ve İçerik Menüsündeki ögelerin sayısını özelleştirin. \n -\n%1$s uygulamasından tüm denetimlerini gizlemek için kullanılmayan eklentileri kapatabilirsiniz. +\nTüm denetimlerini uygulamadan gizlemek için kullanılmayan eklentileri kapatabilirsiniz. %1$s. Kullanıcı Arayüzü Özelleştirme İçerik menüsü eylemleri %1$s\'den ögeleri yeniden sırala veya gizle. From 9b9e0322aace569601de879012be33bb3a9f70b9 Mon Sep 17 00:00:00 2001 From: ihor_ck Date: Sat, 16 May 2020 16:41:52 +0000 Subject: [PATCH 75/91] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3339 of 3339 strings) --- OsmAnd/res/values-uk/strings.xml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index e04519295e..52fa6072f6 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -1096,8 +1096,8 @@ Мережеве відслідковування (потрібен GPX) Розпочати моніторинг Зупинити моніторинг - Розпочати логування GPX - Зупинити логування GPX + Продовжити запис GPX + Зупинити запис GPX Розпочати новий відрізок Будівлі Дороги не призначені для автівок @@ -2611,7 +2611,7 @@ Задіювання одним натисненням Робіть нотатки! Додайте авдіо, відео або світлино-нотатку в будь-яку точку на мапі, використовуючи віджет або контекстне меню. - OSM-нотатки за датою + Примітки за датою За датою За типом Змінити пошуковий запит. @@ -3713,4 +3713,9 @@ Відновити типовий порядок елементів Повернутися до редагування Ви можете отримати доступ до цих дій, торкнувшись кнопки “%1$s”. + Продовжити + Перемикання між профілями здійснюється торканням до кнопки дій. + Додати профіль + Змінити профіль програми + Профілі, вибрані для цієї дії, не знайдено. \ No newline at end of file From 63a304b80fc2178cca832865ca64a12dab96354a Mon Sep 17 00:00:00 2001 From: jan madsen Date: Sat, 16 May 2020 14:08:01 +0000 Subject: [PATCH 76/91] Translated using Weblate (Danish) Currently translated at 96.2% (3213 of 3339 strings) --- OsmAnd/res/values-da/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 77e4ccfa14..ec5bdea64b 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -3670,4 +3670,5 @@ Repræsenterer område: %1$s x %2$s
Tilføj / rediger favorit Gendan standardrækkefølge for elementer Tilbage til redigering + Tilføj profil \ No newline at end of file From 1e93651a510e80102f89e31b9c09629119597f6c Mon Sep 17 00:00:00 2001 From: Piotr Kubowicz Date: Sat, 16 May 2020 16:06:31 +0000 Subject: [PATCH 77/91] Translated using Weblate (Polish) Currently translated at 99.9% (3338 of 3339 strings) --- OsmAnd/res/values-pl/strings.xml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index b873dd1a6b..7f4fd9466e 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -3589,7 +3589,7 @@ Reprezentuje obszar: %1$s x %2$s
Ukryj teren Pokaż/ukryj teren Nachylenie - Włącz, aby wyświetlić cieniowanie wzniesień lub stoków. Możesz przeczytać więcej o tego rodzaju mapach na naszej stronie + Włącz, aby wyświetlić cieniowanie wzniesień lub stoków. Możesz przeczytać więcej o tego rodzaju mapach na naszej stronie. Legenda Poziom powiększenia Przejrzystość @@ -3673,9 +3673,9 @@ Reprezentuje obszar: %1$s x %2$s
Aragoński Gudźarati Joruba - Dostosuj liczbę elementów w menu bocznym, wyglądzie mapy i menu kontekstowym. + Dostosuj liczbę elementów w menu bocznym, konfiguracji mapy i menu kontekstowym. \n -\nMożesz wyłączyć nieużywane wtyczki, aby ukryć ich elementy w aplikacji %1$s. +\nMożesz wyłączyć nieużywane wtyczki, aby ukryć ich elementy w aplikacji. %1$s. %1$s / %2$s Szukaj typów użytecznych miejsc Łącz typy użytecznych zmian z różnych kategorii. Stuknij \"Zmień\", aby zaznaczyć wszystko, stuknij lewą stronę, aby wybrać kategorię. @@ -3690,9 +3690,11 @@ Reprezentuje obszar: %1$s x %2$s
Ulubione Subskrypcja - OsmAnd Live Zakupy w OsmAnd - Opłaty z twojego konta Google Play są pobierane przy zakupie subskrypcji -\ni po jej wygaśnięciu (miesiąc/trzy miesiące/rok), -\nnie odnowi się, jeśli zostanie wcześniej anulowana w ustawieniach Google Play. + Opłata zostanie pobrana z twojego konta Google Play przy potwierdzeniu zakupu. +\n +\nSubskrypcja automatycznie odnawia się, chyba że anulujesz ją przed dniem odnowienia. Twoje konto zostanie obciążone za okres odnowienia (miesiąc/trzy miesiące/rok) dopiero w dniu odnowienia. +\n +\nMożesz zarządzać subskrypcjami i anulować je w ustawieniach Google Play. • Nowe mapy stoków offline \n \n • Pełna personalizacja Ulubionych i Punktów GPX - niestandardowe kolory, ikony, kształty @@ -3721,4 +3723,9 @@ Reprezentuje obszar: %1$s x %2$s Naciśnięcie przycisku akcji powoduje przełączanie między wybranymi profilami. Dodaj profil Zmiana profilu aplikacji + Możesz uzyskać dostęp do tych czynności, naciskając przycisk „%1$s”. + Przycisk do pokazywania i chowania transportu publicznego na mapie. + Miejsca parkingowe + Przywróć domyślną kolejność elementów + Nie znaleziono profili wybranych dla tej czynności. \ No newline at end of file From 73f1d247e16b7105cf60657e20ef16b783085545 Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Sat, 16 May 2020 16:59:51 +0000 Subject: [PATCH 78/91] Translated using Weblate (Sardinian) Currently translated at 99.4% (3320 of 3339 strings) --- OsmAnd/res/values-sc/strings.xml | 33 ++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 2bf2c09f7f..c139c22493 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -390,8 +390,8 @@ Arrastamentu in lìnia (GPX rechestu) Inghitza s’arrastamentu in lìnia Firma s’arrastamentu in lìnia - Inghitza sa registratzione GPX - Firma sa registratzione GPX + Sighi cun sa registratzione GPX + Pone in pàusa sa registratzione GPX Inghitza unu segmentu nou Edifìtzios Caminos non carràbiles @@ -2609,7 +2609,7 @@ Pro praghere iscrie su còdighe intreu
\'Un\'incarcu\' ativu Piga notas! Annanghe notas sonoras, vìdeos o fotografias a cada puntu in sa mapa, impreende su widget o su menù contestuale. - Notas pro data + Notas sonoras/in vìdeu pro data Pro data Pro casta Muda sa chirca tua. @@ -3582,7 +3582,7 @@ Pro praghere iscrie su còdighe intreu Torra a carculare s\'àndala in casu de deviatzione Mapa de sas umbraduras de sos rilevos chi impreat umbras iscuras pro ammustrare pendèntzias, cùcuros e pranos. Terrinu - Sa pista benit ammustrada cun colores in su terrinu. + Sa pista impreat sos colores pro ammustrare sa pendèntzia de su terrinu. Imposta sos livellos de ismanniamentu mìnimu e màssimu pro ammustrare s\'istratu. Pro bìdere sas umbraduras de sos rilievos in sa mapa b\'at bisòngiu de mapas additzionales. Pro bìdere sas pistas in sa mapa b\'at bisòngiu de mapas additzionales. @@ -3590,7 +3590,7 @@ Pro praghere iscrie su còdighe intreu Trasparèntzia Livellos de ismanniada Legenda - Abìlita·lu pro ammustrare sas mapas de sas umbraduras de sos rilievos o de sas pistas. Podes lèghere àteras informatziones a pitzu de custas castas de mapas in su situ nostru + Abìlita·lu pro ammustrare sas mapas de sas umbraduras de sos rilievos o de sas pistas. Podes lèghere àteras informatziones a pitzu de custas castas de mapas in su situ nostru. Umbraduras de sos rilievos %1$s de %2$s Pistas @@ -3669,9 +3669,11 @@ Pro praghere iscrie su còdighe intreu Colore personalizadu Mapas additzionales Atzione %1$s non suportada - Su pagamentu at a èssere addebitadu a su contu tuo de Google Play cando as a comporare un\'abbonamentu -\ne cando at a iscadire su tempus (unu mese/tres meses/un\'annu), -\nno at a èssere rinnovadu si l\'as a àere annulladu, in antis de cussu momentu, dae sas impostatziones de Google Play tuas. + Su pagamentu at a èssere addebitadu a su contu tuo de Google Play cando sa còmpora at a èssere cunfirmada. +\n +\nS\'abbonamentu si rinnovat a sa sola automaticamente, francu chi siat istadu annulladu in antis de sa die de su rinnovu. Su contu tuo at a bènnere addebitadu pro su perìodu de rinnovu (mese/tres meses/annu) in sa die de rinnovu ebbia. +\n +\nPodes amministrare e annullare sos abbonamentos tuos intrende in sas impostatziones de Google Play tuas. Chirca castas de PDI Cumbina castas de PDI de catogorias diferentes. Incarca su butone pro ischertare totu, incarca s\'ala a manca pro sa seletzione de sas categorias. %1$s / %2$s @@ -3706,4 +3708,19 @@ Pro praghere iscrie su còdighe intreu \n • Faddinas cun RTL acontzadas \n \n + Sighi + Podes atzèdere a custas atziones incarchende su butone \"%1$s\". + Cua su trasportu pùblicu + Ammustra su trasportu pùblicu + Ammustra/cua su trasportu pùblicu + Unu butone pro ammustrare o cuare su trasportu pùblicu in sa mapa. + Crea/Modìfica unu PDI + Logos de parchègiu + Annanghe / Modìfica unu preferidu + Riprìstina s\'òrdine predefinidu de sos elementos + Torra a modificare + Tocende su butone de atzione as a colare dae unu profilu ischertadu a s\'àteru. + Annanghe unu profilu + Càmbia su profilu de s\'aplicatzione + Sos profilos ischertados pro custa atzione non s\'agatant. \ No newline at end of file From 37e1d4820db264267c828c77628050935dfcfe30 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Sat, 16 May 2020 14:05:19 +0000 Subject: [PATCH 79/91] Translated using Weblate (Danish) Currently translated at 99.5% (3786 of 3803 strings) --- OsmAnd/res/values-da/phrases.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index edcb974c92..26e9f632c4 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -1514,7 +1514,7 @@ Reparation af elektriske køretøjer Motorcykel reparation Ja - Ingen selvbetjening + Nej Ja Ikke automatiseret Fuld service @@ -1540,7 +1540,7 @@ Ingen puslebord Puslerum Kulturhus - Bilvask: nej + Nej Parkering tidsgrænse Parkeringsbilletter Cigaretter From 5c107e306fe27f31a20eb50acd1d4e4fc8304607 Mon Sep 17 00:00:00 2001 From: ihor_ck Date: Sat, 16 May 2020 16:39:32 +0000 Subject: [PATCH 80/91] Translated using Weblate (Ukrainian) Currently translated at 99.9% (3802 of 3803 strings) --- OsmAnd/res/values-uk/phrases.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-uk/phrases.xml b/OsmAnd/res/values-uk/phrases.xml index 9ec1f28a2b..d68b3b152b 100644 --- a/OsmAnd/res/values-uk/phrases.xml +++ b/OsmAnd/res/values-uk/phrases.xml @@ -2937,7 +2937,7 @@ Кебаб (шаурма) Стайня відкритого типу Так - Самообслуговування: відсутнє + Ні Слюда Трамвай Вирощується культура: соняшник @@ -2995,7 +2995,7 @@ Крайня необхідність: немає Суші Вирощується культура: маніока - Без автомийки + Ні Відкрите болото Маршрут залізниці Мікрохвильова піч: присутня From 90d2a2e54a8d4f8f041ee73f71977eadd3058768 Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Sat, 16 May 2020 16:55:56 +0000 Subject: [PATCH 81/91] Translated using Weblate (Sardinian) Currently translated at 99.3% (3778 of 3803 strings) --- OsmAnd/res/values-sc/phrases.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-sc/phrases.xml b/OsmAnd/res/values-sc/phrases.xml index 7fbecf399e..25187eaf01 100644 --- a/OsmAnd/res/values-sc/phrases.xml +++ b/OsmAnd/res/values-sc/phrases.xml @@ -1979,13 +1979,13 @@ Acontzadura de veìculos elètricos Acontzadura de mototzicletas Eja - Chene servìtziu a sa sola + Nono Eja Non automatizadu Servìtziu cumpridu Eja Ispàtzulas: nono - Sabunadura màchinas: nono + Nono Bagnu pùblicu Òmines Proibidu a sos òmines From 3967f1a230deffae858905bf797ec460a1cfb18b Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Sat, 16 May 2020 01:19:44 +0000 Subject: [PATCH 82/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3803 of 3803 strings) --- OsmAnd/res/values-pt-rBR/phrases.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-pt-rBR/phrases.xml b/OsmAnd/res/values-pt-rBR/phrases.xml index 5cef6496c9..1a6f184275 100644 --- a/OsmAnd/res/values-pt-rBR/phrases.xml +++ b/OsmAnd/res/values-pt-rBR/phrases.xml @@ -1515,7 +1515,7 @@ Retífica de veículos elétricos Retífica de motos Sim - Sem autoatendimento + Não Sim Não automatizado Serviço completo From c3fd163b248ffa0a1b518fe714d5adbf57a65c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Sat, 16 May 2020 18:43:02 +0000 Subject: [PATCH 83/91] Translated using Weblate (Turkish) Currently translated at 61.7% (2349 of 3803 strings) --- OsmAnd/res/values-tr/phrases.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-tr/phrases.xml b/OsmAnd/res/values-tr/phrases.xml index dcebe0738f..1e68983a48 100644 --- a/OsmAnd/res/values-tr/phrases.xml +++ b/OsmAnd/res/values-tr/phrases.xml @@ -1745,7 +1745,7 @@ Elektrikli araçların tamiri Motosiklet tamiri Evet - Self servis yok + Hayır Evet Otomatik değil Tam servis @@ -1769,7 +1769,7 @@ Bebek bezi değiştirme masası Bebek bezi değiştirme masası yok Bebek bezi değiştirme odası - Araba yıkama: hayır + Hayır Park süresi sınırı Park etme bileti Sigara @@ -2357,4 +2357,7 @@ Tarihi dönem: tunç devri Tarihi dönem: taş devri / tunç devri (belirsiz) Tarihi dönem: nuragic + Hayır + Hayır + Hayır \ No newline at end of file From 15143bdf0174444328e7621ac003b505b78e78d0 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Sat, 16 May 2020 00:06:27 +0000 Subject: [PATCH 84/91] Translated using Weblate (Esperanto) Currently translated at 100.0% (3803 of 3803 strings) --- OsmAnd/res/values-eo/phrases.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-eo/phrases.xml b/OsmAnd/res/values-eo/phrases.xml index 7666aac08a..8888986831 100644 --- a/OsmAnd/res/values-eo/phrases.xml +++ b/OsmAnd/res/values-eo/phrases.xml @@ -1517,13 +1517,13 @@ riparo de elektraj aŭtoj Riparejo de motorcikloj jes - Sen memservo + ne jes Ne aŭtomatigita Plena servo jes Senbrosa: ne - Aŭtomobil-purigejo: ne + ne Benzinejo por aviadiloj Ene Ekstere From 8f29ceef2b46da184f4d51453f69e8c70a68a626 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 10:22:43 +0000 Subject: [PATCH 85/91] Translated using Weblate (Spanish) Currently translated at 92.8% (3100 of 3339 strings) --- OsmAnd/res/values-es/strings.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index 194a88c102..709c94d7b0 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -3593,4 +3593,22 @@ \n • Se corrigieron los errores con RTL \n \n + Suscripción - OsmAnd Live + Compras en OsmAnd + Un botón que muestra u oculta el transporte público en el mapa. + Regresar a editar + Cambiar el perfil de la aplicación + Los perfiles seleccionados para esta acción no se han encontrado. + Mapas extras + OsmAnd + Mapillary + Viaje (Wikivoyage y Wikipedia) + Marcadores de mapa + Favoritos + Perfiles de navegación + Mostrar/ocultar transporte público + Ocultar transporte público + Mostrar transporte público + Crear/Editar POI + Agregar / Editar Favorito + Agregar perfil \ No newline at end of file From ffc0a85c1992dcf5e849df1d50e2989c1606fda7 Mon Sep 17 00:00:00 2001 From: Jorge Sanz Sanfructuoso Date: Sun, 17 May 2020 10:26:45 +0000 Subject: [PATCH 86/91] Translated using Weblate (Spanish) Currently translated at 92.8% (3100 of 3339 strings) --- OsmAnd/res/values-es/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index 709c94d7b0..0df35af034 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -3611,4 +3611,10 @@ Crear/Editar POI Agregar / Editar Favorito Agregar perfil + Aragones + Color personalizado + %1$s / %2$s + Acción rápida + Regla radial + Medir distancia \ No newline at end of file From 684e2d3d366a48e9ae33eca87a68aae29a0bc6c9 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 17 May 2020 13:21:59 +0200 Subject: [PATCH 87/91] Fix routing --- .../java/net/osmand/router/TransportRoutePlanner.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 457fbe856b..8726a5a33f 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -840,14 +840,8 @@ public class TransportRoutePlanner { long stopId = stop.getId(); TransportStop multifileStop = loadedTransportStops.get(stopId); int[] rrs = stop.getReferencesToRoutes(); - // TODO what is this? - if (multifileStop == stop) { - // clear up so it won't be used as it is multi file stop - stop.setReferencesToRoutes(null); - } else { - // add other routes - stop.setReferencesToRoutes(null); - } + // clear up so it won't be used as it is multi file stop + stop.setReferencesToRoutes(null); if (rrs != null && !multifileStop.isDeleted()) { for (int rr : rrs) { TransportRoute route = localFileRoutes.get(rr); From 9a7fcbd7b8be3a677c36f8b278150eb157b504dd Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 17 May 2020 14:40:04 +0200 Subject: [PATCH 88/91] Fix error #7365 --- .../src/main/java/net/osmand/binary/RouteDataObject.java | 3 +-- OsmAnd/src/net/osmand/plus/routing/RouteProvider.java | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java b/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java index 0fb0bdacf6..807561e66d 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java @@ -1012,8 +1012,7 @@ public class RouteDataObject { } public boolean hasNameTagStartsWith(String tagStartsWith) { - int[] nextSegmentNameIds = nameIds; - for (int nm = 0; nm < nameIds.length; nm++) { + for (int nm = 0; nameIds != null && nm < nameIds.length; nm++) { RouteTypeRule rtr = region.quickGetEncodingRule(nameIds[nm]); if (rtr != null && rtr.getTag().startsWith(tagStartsWith)) { return true; diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java b/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java index 353dd7b0e8..52876bd44c 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java @@ -359,7 +359,7 @@ public class RouteProvider { insertInitialSegment(params, locs, directions, true); res = new RouteCalculationResult(locs, directions, params, null, true); } catch (RuntimeException e) { - e.printStackTrace(); + log.error(e.getMessage(), e); } return res; } @@ -815,8 +815,10 @@ public class RouteProvider { return res; } } catch (RuntimeException e) { + log.error("Runtime error: " + e.getMessage(), e); return new RouteCalculationResult(e.getMessage() ); } catch (InterruptedException e) { + log.error("Interrupted: " + e.getMessage(), e); return interrupted(); } catch (OutOfMemoryError e) { // ActivityManager activityManager = (ActivityManager)app.getSystemService(Context.ACTIVITY_SERVICE); From 500cd849034899994a8ba60832a8d6c1facad71e Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 17 May 2020 19:46:55 +0200 Subject: [PATCH 89/91] Update transport route planner #8986 --- .../osmand/router/TransportRoutePlanner.java | 18 ++++++++++++++---- .../router/TransportRoutingConfiguration.java | 6 ++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 8726a5a33f..817496d290 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -42,6 +42,7 @@ public class TransportRoutePlanner { public List buildRoute(TransportRoutingContext ctx, LatLon start, LatLon end) throws IOException, InterruptedException { ctx.startCalcTime = System.currentTimeMillis(); + double totalDistance = MapUtils.getDistance(start, end); List startStops = ctx.getTransportStops(start); List endStops = ctx.getTransportStops(end); @@ -60,7 +61,14 @@ public class TransportRoutePlanner { } double finishTime = ctx.cfg.maxRouteTime; - double maxTravelTimeCmpToWalk = MapUtils.getDistance(start, end) / ctx.cfg.walkSpeed - ctx.cfg.changeTime / 2; + ctx.finishTimeSeconds = ctx.cfg.finishTimeSeconds; + if (totalDistance > ctx.cfg.maxRouteDistance && ctx.cfg.maxRouteIncreaseSpeed > 0) { + int increaseTime = (int) ((totalDistance - ctx.cfg.maxRouteDistance) + * 3.6 / ctx.cfg.maxRouteIncreaseSpeed); + finishTime += increaseTime; + ctx.finishTimeSeconds += increaseTime / 6; + } + double maxTravelTimeCmpToWalk = totalDistance / ctx.cfg.walkSpeed - ctx.cfg.changeTime / 2; List results = new ArrayList(); initProgressBar(ctx, start, end); while (!queue.isEmpty()) { @@ -82,7 +90,7 @@ public class TransportRoutePlanner { if (segment.getDepth() > ctx.cfg.maxNumberOfChanges + 1) { continue; } - if (segment.distFromStart > finishTime + ctx.cfg.finishTimeSeconds || + if (segment.distFromStart > finishTime + ctx.finishTimeSeconds || segment.distFromStart > maxTravelTimeCmpToWalk) { break; } @@ -114,7 +122,7 @@ public class TransportRoutePlanner { } else { travelTime += ctx.cfg.stopTime + segmentDist / routeTravelSpeed; } - if(segment.distFromStart + travelTime > finishTime + ctx.cfg.finishTimeSeconds) { + if(segment.distFromStart + travelTime > finishTime + ctx.finishTimeSeconds) { break; } sgms.clear(); @@ -169,7 +177,7 @@ public class TransportRoutePlanner { if (finishTime > finish.distFromStart) { finishTime = finish.distFromStart; } - if(finish.distFromStart < finishTime + ctx.cfg.finishTimeSeconds && + if(finish.distFromStart < finishTime + ctx.finishTimeSeconds && (finish.distFromStart < maxTravelTimeCmpToWalk || results.size() == 0)) { results.add(finish); } @@ -732,6 +740,7 @@ public class TransportRoutePlanner { } public static class TransportRoutingContext { + public NativeLibrary library; public RouteCalculationProgress calculationProgress; public TLongObjectHashMap visitedSegments = new TLongObjectHashMap(); @@ -746,6 +755,7 @@ public class TransportRoutePlanner { public final Map> routeMap = new LinkedHashMap>(); + public int finishTimeSeconds; // stats public long startCalcTime; diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutingConfiguration.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutingConfiguration.java index 2f0eaf8b3e..c350204b52 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutingConfiguration.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutingConfiguration.java @@ -23,6 +23,10 @@ public class TransportRoutingConfiguration { public int finishTimeSeconds = 1200; public int maxRouteTime = 60 * 60 * 10; // 10 hours + public int maxRouteDistance = 0; // distance for maxRouteTime + public int maxRouteIncreaseSpeed = 30; // speed to increase route time + + public GeneralRouter router; // cache values from router for fast access @@ -85,6 +89,8 @@ public class TransportRoutingConfiguration { ZOOM_TO_LOAD_TILES = router.getIntAttribute("zoomToLoadTiles", ZOOM_TO_LOAD_TILES); maxNumberOfChanges = router.getIntAttribute("maxNumberOfChanges", maxNumberOfChanges); maxRouteTime = router.getIntAttribute("maxRouteTime", maxRouteTime); + maxRouteIncreaseSpeed = router.getIntAttribute("maxRouteIncreaseSpeed", maxRouteIncreaseSpeed); + maxRouteDistance = router.getIntAttribute("maxRouteDistance", maxRouteDistance); finishTimeSeconds = router.getIntAttribute("delayForAlternativesRoutes", finishTimeSeconds); String mn = params.get("max_num_changes"); maxNumberOfChanges = (int) RoutingConfiguration.parseSilentFloat(mn, maxNumberOfChanges); From b06f746d7ad185fb0c342b1f035659fd1233ecbd Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 17 May 2020 21:05:33 +0200 Subject: [PATCH 90/91] Fix multi route planner --- .../osmand/router/TransportRoutePlanner.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 817496d290..416cfa72fa 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -1084,19 +1084,28 @@ public class TransportRoutePlanner { // 1st we check that segments overlap by stop int commonStopFirst = 0; int commonStopSecond = 0; + boolean found = false; for(;commonStopFirst < firstSegment.size(); commonStopFirst++) { - for(; commonStopSecond < segmentToMerge.size(); commonStopSecond++ ) { + for(commonStopSecond = 0; commonStopSecond < segmentToMerge.size() && !found; commonStopSecond++) { long lid1 = firstSegment.get(commonStopFirst).getId(); long lid2 = segmentToMerge.get(commonStopSecond).getId(); if(lid1 > 0 && lid2 == lid1) { + found = true; break; } } + if(found) { + // important to increment break inside loop + break; + } } - if(commonStopFirst < firstSegment.size()) { + if(found && commonStopFirst < firstSegment.size()) { // we've found common stop so we can merge based on stops // merge last part first - if(firstSegment.size() - commonStopFirst < segmentToMerge.size() - commonStopSecond) { + int leftPartFirst = firstSegment.size() - commonStopFirst; + int leftPartSecond = segmentToMerge.size() - commonStopSecond; + if(leftPartFirst < leftPartSecond || (leftPartFirst == leftPartSecond && + firstSegment.get(firstSegment.size() - 1).isMissingStop())) { while(firstSegment.size() > commonStopFirst) { firstSegment.remove(firstSegment.size() - 1); } @@ -1105,7 +1114,8 @@ public class TransportRoutePlanner { } } // merge first part - if(commonStopFirst < commonStopSecond) { + if(commonStopFirst < commonStopSecond || (commonStopFirst == commonStopSecond && + firstSegment.get(0).isMissingStop())) { for(int i = 0; i < commonStopFirst; i++) { firstSegment.remove(0); } From 58cd364c1e911834cd919d88a3bd335d970e6de1 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Mon, 18 May 2020 10:30:54 +0300 Subject: [PATCH 91/91] Add phrase --- OsmAnd/res/values-ru/phrases.xml | 2 ++ OsmAnd/res/values/phrases.xml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 82f48c6cd1..319e7ed52a 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3792,4 +3792,6 @@ Среднее Высокое Давление + Состояние насоса: отсутствует рычаг + \ No newline at end of file diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index a4cdd9fa9d..7c417ac997 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4228,4 +4228,6 @@ Pressurized Suction + Pump status: missing beam + \ No newline at end of file