Merge branch 'master' into create_custom_poi
|
@ -25,10 +25,12 @@ import net.osmand.data.MapObject;
|
||||||
import net.osmand.data.QuadRect;
|
import net.osmand.data.QuadRect;
|
||||||
import net.osmand.render.RenderingRuleSearchRequest;
|
import net.osmand.render.RenderingRuleSearchRequest;
|
||||||
import net.osmand.render.RenderingRulesStorage;
|
import net.osmand.render.RenderingRulesStorage;
|
||||||
|
import net.osmand.router.NativeTransportRoutingResult;
|
||||||
import net.osmand.router.PrecalculatedRouteDirection;
|
import net.osmand.router.PrecalculatedRouteDirection;
|
||||||
import net.osmand.router.RouteCalculationProgress;
|
import net.osmand.router.RouteCalculationProgress;
|
||||||
import net.osmand.router.RouteSegmentResult;
|
import net.osmand.router.RouteSegmentResult;
|
||||||
import net.osmand.router.RoutingConfiguration;
|
import net.osmand.router.RoutingConfiguration;
|
||||||
|
import net.osmand.router.TransportRoutingConfiguration;
|
||||||
import net.osmand.util.Algorithms;
|
import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
@ -128,6 +130,11 @@ public class NativeLibrary {
|
||||||
return closeBinaryMapFile(filePath);
|
return closeBinaryMapFile(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NativeTransportRoutingResult[] runNativePTRouting(int sx31, int sy31, int ex31, int ey31,
|
||||||
|
TransportRoutingConfiguration cfg, RouteCalculationProgress progress) {
|
||||||
|
return nativeTransportRouting(new int[] { sx31, sy31, ex31, ey31 }, cfg, progress);
|
||||||
|
}
|
||||||
|
|
||||||
public RouteSegmentResult[] runNativeRouting(int sx31, int sy31, int ex31, int ey31, RoutingConfiguration config,
|
public RouteSegmentResult[] runNativeRouting(int sx31, int sy31, int ex31, int ey31, RoutingConfiguration config,
|
||||||
RouteRegion[] regions, RouteCalculationProgress progress, PrecalculatedRouteDirection precalculatedRouteDirection,
|
RouteRegion[] regions, RouteCalculationProgress progress, PrecalculatedRouteDirection precalculatedRouteDirection,
|
||||||
boolean basemap, boolean publicTransport, boolean startTransportStop, boolean targetTransportStop) {
|
boolean basemap, boolean publicTransport, boolean startTransportStop, boolean targetTransportStop) {
|
||||||
|
@ -160,6 +167,9 @@ public class NativeLibrary {
|
||||||
PrecalculatedRouteDirection precalculatedRouteDirection, boolean basemap,
|
PrecalculatedRouteDirection precalculatedRouteDirection, boolean basemap,
|
||||||
boolean publicTransport, boolean startTransportStop, boolean targetTransportStop);
|
boolean publicTransport, boolean startTransportStop, boolean targetTransportStop);
|
||||||
|
|
||||||
|
protected static native NativeTransportRoutingResult[] nativeTransportRouting(int[] coordinates, TransportRoutingConfiguration cfg,
|
||||||
|
RouteCalculationProgress progress);
|
||||||
|
|
||||||
protected static native void deleteSearchResult(long searchResultHandle);
|
protected static native void deleteSearchResult(long searchResultHandle);
|
||||||
|
|
||||||
protected static native boolean initBinaryMapFile(String filePath, boolean useLive, boolean routingOnly);
|
protected static native boolean initBinaryMapFile(String filePath, boolean useLive, boolean routingOnly);
|
||||||
|
|
|
@ -465,8 +465,6 @@ public class BinaryMapTransportReaderAdapter {
|
||||||
s.setName(stringTable.get(e.getKey().charAt(0)), stringTable.get(e.getValue().charAt(0)));
|
s.setName(stringTable.get(e.getKey().charAt(0)), stringTable.get(e.getValue().charAt(0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private TransportStop readTransportRouteStop(int[] dx, int[] dy, long did, TIntObjectHashMap<String> stringTable,
|
private TransportStop readTransportRouteStop(int[] dx, int[] dy, long did, TIntObjectHashMap<String> stringTable,
|
||||||
int filePointer) throws IOException {
|
int filePointer) throws IOException {
|
||||||
|
@ -637,6 +635,4 @@ public class BinaryMapTransportReaderAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,23 @@ public class TransportRoute extends MapObject {
|
||||||
public List<TransportStop> getForwardStops() {
|
public List<TransportStop> getForwardStops() {
|
||||||
return forwardStops;
|
return forwardStops;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setForwardStops(List<TransportStop> forwardStops) {
|
||||||
|
this.forwardStops = forwardStops;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDist(Integer dist) {
|
||||||
|
this.dist = dist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setForwardWays(List<Way> forwardWays) {
|
||||||
|
this.forwardWays = forwardWays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSchedule(TransportSchedule schedule) {
|
||||||
|
this.schedule = schedule;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Way> getForwardWays() {
|
public List<Way> getForwardWays() {
|
||||||
if(forwardWays == null) {
|
if(forwardWays == null) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
|
|
@ -8,7 +8,16 @@ public class TransportSchedule {
|
||||||
public TIntArrayList tripIntervals = new TIntArrayList();
|
public TIntArrayList tripIntervals = new TIntArrayList();
|
||||||
public TIntArrayList avgStopIntervals = new TIntArrayList();
|
public TIntArrayList avgStopIntervals = new TIntArrayList();
|
||||||
public TIntArrayList avgWaitIntervals = new TIntArrayList();
|
public TIntArrayList avgWaitIntervals = new TIntArrayList();
|
||||||
|
|
||||||
|
public TransportSchedule() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public TransportSchedule(TIntArrayList tripIntervals, TIntArrayList avgStopIntervals, TIntArrayList avgWaitIntervals) {
|
||||||
|
this.tripIntervals = tripIntervals;
|
||||||
|
this.avgStopIntervals = avgStopIntervals;
|
||||||
|
this.avgWaitIntervals = avgWaitIntervals;
|
||||||
|
}
|
||||||
|
|
||||||
public int[] getTripIntervals() {
|
public int[] getTripIntervals() {
|
||||||
return tripIntervals.toArray();
|
return tripIntervals.toArray();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,14 @@ public class TransportStopExit extends MapObject {
|
||||||
public int y31;
|
public int y31;
|
||||||
public String ref = null;
|
public String ref = null;
|
||||||
|
|
||||||
|
public TransportStopExit() {}
|
||||||
|
|
||||||
|
public TransportStopExit(int x31, int y31, String ref) {
|
||||||
|
this.x31 = x31;
|
||||||
|
this.y31 = y31;
|
||||||
|
this.ref = ref;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLocation(double latitude, double longitude) {
|
public void setLocation(double latitude, double longitude) {
|
||||||
super.setLocation(latitude, longitude);
|
super.setLocation(latitude, longitude);
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
package net.osmand.router;
|
||||||
|
|
||||||
|
public class NativeTransportRoute {
|
||||||
|
//MapObject part:
|
||||||
|
public long id = -1l;
|
||||||
|
public double routeLat = -1;
|
||||||
|
public double routeLon = -1;
|
||||||
|
public String name = "";
|
||||||
|
public String enName = "";
|
||||||
|
//to HashMap <string, string> names
|
||||||
|
public String[] namesLng;
|
||||||
|
public String[] namesNames;
|
||||||
|
public int fileOffset;
|
||||||
|
//-----
|
||||||
|
public NativeTransportStop[] forwardStops;
|
||||||
|
public String ref = "";
|
||||||
|
public String routeOperator = "";
|
||||||
|
public String type = "";
|
||||||
|
public int dist = -1;
|
||||||
|
public String color = "";
|
||||||
|
|
||||||
|
// Convert into TransportSchedule:
|
||||||
|
public int[] intervals;
|
||||||
|
public int[] avgStopIntervals;
|
||||||
|
public int[] avgWaitIntervals;
|
||||||
|
|
||||||
|
// Convert into ways (and nodes):
|
||||||
|
public long[] waysIds;
|
||||||
|
public long[][] waysNodesIds;
|
||||||
|
public double[][] waysNodesLats;
|
||||||
|
public double[][] waysNodesLons;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package net.osmand.router;
|
||||||
|
|
||||||
|
public class NativeTransportRouteResultSegment {
|
||||||
|
public NativeTransportRoute route;
|
||||||
|
public double walkTime;
|
||||||
|
public double travelDistApproximate;
|
||||||
|
public double travelTime;
|
||||||
|
public int start;
|
||||||
|
public int end;
|
||||||
|
public double walkDist ;
|
||||||
|
public int depTime;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package net.osmand.router;
|
||||||
|
|
||||||
|
public class NativeTransportRoutingResult {
|
||||||
|
|
||||||
|
public NativeTransportRouteResultSegment[] segments;
|
||||||
|
public double finishWalkDist;
|
||||||
|
public double routeTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package net.osmand.router;
|
||||||
|
|
||||||
|
public class NativeTransportStop {
|
||||||
|
//MapObject part:
|
||||||
|
public long id;
|
||||||
|
public double stopLat;
|
||||||
|
public double stopLon;
|
||||||
|
public String name;
|
||||||
|
public String enName;
|
||||||
|
public String[] namesLng;
|
||||||
|
public String[] namesNames;
|
||||||
|
public int fileOffset;
|
||||||
|
//Leave next 3 field as arrays:
|
||||||
|
public int[] referencesToRoutes;
|
||||||
|
public long[] deletedRoutesIds;
|
||||||
|
public long[] routesIds;
|
||||||
|
public int distance;
|
||||||
|
public int x31;
|
||||||
|
public int y31;
|
||||||
|
|
||||||
|
public NativeTransportRoute[] routes;
|
||||||
|
// Convert into List<TransportStopExit> exits:
|
||||||
|
public int[] pTStopExit_x31s;
|
||||||
|
public int[] pTStopExit_y31s;
|
||||||
|
public String[] pTStopExit_refs;
|
||||||
|
// Convert into LinkedHashMap<String, int[]>
|
||||||
|
public String[] referenceToRoutesKeys;
|
||||||
|
public int[][] referenceToRoutesVals;
|
||||||
|
}
|
|
@ -15,6 +15,8 @@ import gnu.trove.iterator.TIntIterator;
|
||||||
import gnu.trove.list.array.TIntArrayList;
|
import gnu.trove.list.array.TIntArrayList;
|
||||||
import gnu.trove.map.hash.TIntObjectHashMap;
|
import gnu.trove.map.hash.TIntObjectHashMap;
|
||||||
import gnu.trove.map.hash.TLongObjectHashMap;
|
import gnu.trove.map.hash.TLongObjectHashMap;
|
||||||
|
|
||||||
|
import net.osmand.NativeLibrary;
|
||||||
import net.osmand.binary.BinaryMapIndexReader;
|
import net.osmand.binary.BinaryMapIndexReader;
|
||||||
import net.osmand.binary.BinaryMapIndexReader.SearchRequest;
|
import net.osmand.binary.BinaryMapIndexReader.SearchRequest;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
|
@ -22,6 +24,7 @@ import net.osmand.data.QuadRect;
|
||||||
import net.osmand.data.TransportRoute;
|
import net.osmand.data.TransportRoute;
|
||||||
import net.osmand.data.TransportSchedule;
|
import net.osmand.data.TransportSchedule;
|
||||||
import net.osmand.data.TransportStop;
|
import net.osmand.data.TransportStop;
|
||||||
|
import net.osmand.data.TransportStopExit;
|
||||||
import net.osmand.osm.edit.Node;
|
import net.osmand.osm.edit.Node;
|
||||||
import net.osmand.osm.edit.Way;
|
import net.osmand.osm.edit.Way;
|
||||||
import net.osmand.util.MapUtils;
|
import net.osmand.util.MapUtils;
|
||||||
|
@ -36,7 +39,7 @@ public class TransportRoutePlanner {
|
||||||
ctx.startCalcTime = System.currentTimeMillis();
|
ctx.startCalcTime = System.currentTimeMillis();
|
||||||
List<TransportRouteSegment> startStops = ctx.getTransportStops(start);
|
List<TransportRouteSegment> startStops = ctx.getTransportStops(start);
|
||||||
List<TransportRouteSegment> endStops = ctx.getTransportStops(end);
|
List<TransportRouteSegment> endStops = ctx.getTransportStops(end);
|
||||||
|
|
||||||
TLongObjectHashMap<TransportRouteSegment> endSegments = new TLongObjectHashMap<TransportRouteSegment>();
|
TLongObjectHashMap<TransportRouteSegment> endSegments = new TLongObjectHashMap<TransportRouteSegment>();
|
||||||
for(TransportRouteSegment s : endStops) {
|
for(TransportRouteSegment s : endStops) {
|
||||||
endSegments.put(s.getId(), s);
|
endSegments.put(s.getId(), s);
|
||||||
|
@ -50,6 +53,7 @@ public class TransportRoutePlanner {
|
||||||
r.distFromStart = r.walkDist / ctx.cfg.walkSpeed;
|
r.distFromStart = r.walkDist / ctx.cfg.walkSpeed;
|
||||||
queue.add(r);
|
queue.add(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
double finishTime = ctx.cfg.maxRouteTime;
|
double finishTime = ctx.cfg.maxRouteTime;
|
||||||
double maxTravelTimeCmpToWalk = MapUtils.getDistance(start, end) / ctx.cfg.walkSpeed - ctx.cfg.changeTime / 2;
|
double maxTravelTimeCmpToWalk = MapUtils.getDistance(start, end) / ctx.cfg.walkSpeed - ctx.cfg.changeTime / 2;
|
||||||
List<TransportRouteSegment> results = new ArrayList<TransportRouteSegment>();
|
List<TransportRouteSegment> results = new ArrayList<TransportRouteSegment>();
|
||||||
|
@ -179,7 +183,6 @@ public class TransportRoutePlanner {
|
||||||
updateCalculationProgress(ctx, queue);
|
updateCalculationProgress(ctx, queue);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return prepareResults(ctx, results);
|
return prepareResults(ctx, results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,11 +450,27 @@ public class TransportRoutePlanner {
|
||||||
public TransportRouteResult(TransportRoutingContext ctx) {
|
public TransportRouteResult(TransportRoutingContext ctx) {
|
||||||
cfg = ctx.cfg;
|
cfg = ctx.cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TransportRouteResult(TransportRoutingConfiguration cfg) {
|
||||||
|
this.cfg = cfg;
|
||||||
|
}
|
||||||
|
|
||||||
public List<TransportRouteResultSegment> getSegments() {
|
public List<TransportRouteResultSegment> getSegments() {
|
||||||
return segments;
|
return segments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setFinishWalkDist(double finishWalkDist) {
|
||||||
|
this.finishWalkDist = finishWalkDist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRouteTime(double routeTime) {
|
||||||
|
this.routeTime = routeTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addSegment(TransportRouteResultSegment seg) {
|
||||||
|
segments.add(seg);
|
||||||
|
}
|
||||||
|
|
||||||
public double getWalkDist() {
|
public double getWalkDist() {
|
||||||
double d = finishWalkDist;
|
double d = finishWalkDist;
|
||||||
for (TransportRouteResultSegment s : segments) {
|
for (TransportRouteResultSegment s : segments) {
|
||||||
|
@ -678,7 +697,7 @@ public class TransportRoutePlanner {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TransportRoutingContext {
|
public static class TransportRoutingContext {
|
||||||
|
public NativeLibrary library;
|
||||||
public RouteCalculationProgress calculationProgress;
|
public RouteCalculationProgress calculationProgress;
|
||||||
public TLongObjectHashMap<TransportRouteSegment> visitedSegments = new TLongObjectHashMap<TransportRouteSegment>();
|
public TLongObjectHashMap<TransportRouteSegment> visitedSegments = new TLongObjectHashMap<TransportRouteSegment>();
|
||||||
public TransportRoutingConfiguration cfg;
|
public TransportRoutingConfiguration cfg;
|
||||||
|
@ -705,11 +724,12 @@ public class TransportRoutePlanner {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public TransportRoutingContext(TransportRoutingConfiguration cfg, BinaryMapIndexReader... readers) {
|
public TransportRoutingContext(TransportRoutingConfiguration cfg, NativeLibrary library, BinaryMapIndexReader... readers) {
|
||||||
this.cfg = cfg;
|
this.cfg = cfg;
|
||||||
walkRadiusIn31 = (int) (cfg.walkRadius / MapUtils.getTileDistanceWidth(31));
|
walkRadiusIn31 = (int) (cfg.walkRadius / MapUtils.getTileDistanceWidth(31));
|
||||||
walkChangeRadiusIn31 = (int) (cfg.walkChangeRadius / MapUtils.getTileDistanceWidth(31));
|
walkChangeRadiusIn31 = (int) (cfg.walkChangeRadius / MapUtils.getTileDistanceWidth(31));
|
||||||
quadTree = new TLongObjectHashMap<List<TransportRouteSegment>>();
|
quadTree = new TLongObjectHashMap<List<TransportRouteSegment>>();
|
||||||
|
this.library = library;
|
||||||
for (BinaryMapIndexReader r : readers) {
|
for (BinaryMapIndexReader r : readers) {
|
||||||
routeMap.put(r, new TIntObjectHashMap<TransportRoute>());
|
routeMap.put(r, new TIntObjectHashMap<TransportRoute>());
|
||||||
}
|
}
|
||||||
|
@ -943,9 +963,140 @@ public class TransportRoutePlanner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//cache for converted TransportRoutes:
|
||||||
|
private static TLongObjectHashMap<TransportRoute> convertedRoutesCache;
|
||||||
|
private static TLongObjectHashMap<TransportStop> convertedStopsCache;
|
||||||
|
|
||||||
|
public static List<TransportRouteResult> convertToTransportRoutingResult(NativeTransportRoutingResult[] res,
|
||||||
|
TransportRoutingConfiguration cfg) {
|
||||||
|
if (res.length == 0) {
|
||||||
|
return new ArrayList<TransportRouteResult>();
|
||||||
|
}
|
||||||
|
List<TransportRouteResult> convertedRes = new ArrayList<TransportRouteResult>();
|
||||||
|
for (NativeTransportRoutingResult ntrr : res) {
|
||||||
|
TransportRouteResult trr = new TransportRouteResult(cfg);
|
||||||
|
trr.setFinishWalkDist(ntrr.finishWalkDist);
|
||||||
|
trr.setRouteTime(ntrr.routeTime);
|
||||||
|
|
||||||
|
for (NativeTransportRouteResultSegment ntrs : ntrr.segments) {
|
||||||
|
TransportRouteResultSegment trs = new TransportRouteResultSegment();
|
||||||
|
trs.route = convertTransportRoute(ntrs.route);
|
||||||
|
trs.walkTime = ntrs.walkTime;
|
||||||
|
trs.travelDistApproximate = ntrs.travelDistApproximate;
|
||||||
|
trs.travelTime = ntrs.travelTime;
|
||||||
|
trs.start = ntrs.start;
|
||||||
|
trs.end = ntrs.end;
|
||||||
|
trs.walkDist = ntrs.walkDist;
|
||||||
|
trs.depTime = ntrs.depTime;
|
||||||
|
|
||||||
|
trr.addSegment(trs);
|
||||||
|
}
|
||||||
|
convertedRes.add(trr);
|
||||||
|
}
|
||||||
|
convertedStopsCache.clear();
|
||||||
|
convertedRoutesCache.clear();
|
||||||
|
return convertedRes;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static TransportRoute convertTransportRoute(NativeTransportRoute nr) {
|
||||||
|
TransportRoute r = new TransportRoute();
|
||||||
|
r.setId(nr.id);
|
||||||
|
r.setLocation(nr.routeLat, nr.routeLon);
|
||||||
|
r.setName(nr.name);
|
||||||
|
r.setEnName(nr.enName);
|
||||||
|
if (nr.namesLng.length > 0 && nr.namesLng.length == nr.namesNames.length) {
|
||||||
|
for (int i = 0; i < nr.namesLng.length; i++) {
|
||||||
|
r.setName(nr.namesLng[i], nr.namesNames[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
r.setFileOffset(nr.fileOffset);
|
||||||
|
r.setForwardStops(convertTransportStops(nr.forwardStops));
|
||||||
|
r.setRef(nr.ref);
|
||||||
|
r.setOperator(nr.routeOperator);
|
||||||
|
r.setType(nr.type);
|
||||||
|
r.setDist(nr.dist);
|
||||||
|
r.setColor(nr.color);
|
||||||
|
|
||||||
|
if (nr.intervals != null && nr.intervals.length > 0 && nr.avgStopIntervals !=null && nr.avgStopIntervals.length > 0 && nr.avgWaitIntervals != null && nr.avgWaitIntervals.length > 0) {
|
||||||
|
r.setSchedule(new TransportSchedule(new TIntArrayList(nr.intervals), new TIntArrayList(nr.avgStopIntervals), new TIntArrayList(nr.avgWaitIntervals)));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < nr.waysIds.length; i++) {
|
||||||
|
List<Node> wnodes = new ArrayList<>();
|
||||||
|
for (int j = 0; j < nr.waysNodesLats[i].length; j++) {
|
||||||
|
wnodes.add(new Node(nr.waysNodesLats[i][j], nr.waysNodesLons[i][j], -1));
|
||||||
|
}
|
||||||
|
r.addWay(new Way(nr.waysIds[i], wnodes));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (convertedRoutesCache == null) {
|
||||||
|
convertedRoutesCache = new TLongObjectHashMap<>();
|
||||||
|
}
|
||||||
|
if (convertedRoutesCache.get(r.getId()) == null) {
|
||||||
|
convertedRoutesCache.put(r.getId(), r);
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<TransportStop> convertTransportStops(NativeTransportStop[] nstops) {
|
||||||
|
List<TransportStop> stops = new ArrayList<>();
|
||||||
|
for (NativeTransportStop ns : nstops) {
|
||||||
|
if (convertedStopsCache != null && convertedStopsCache.get(ns.id) != null) {
|
||||||
|
stops.add(convertedStopsCache.get(ns.id));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
TransportStop s = new TransportStop();
|
||||||
|
s.setId(ns.id);
|
||||||
|
s.setLocation(ns.stopLat, ns.stopLon);
|
||||||
|
s.setName(ns.name);
|
||||||
|
s.setEnName(ns.enName);
|
||||||
|
if (ns.namesLng.length > 0 && ns.namesLng.length == ns.namesNames.length) {
|
||||||
|
for (int i = 0; i < ns.namesLng.length; i++) {
|
||||||
|
s.setName(ns.namesLng[i], ns.namesNames[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
s.setFileOffset(ns.fileOffset);
|
||||||
|
s.setReferencesToRoutes(ns.referencesToRoutes);
|
||||||
|
s.setDeletedRoutesIds(ns.deletedRoutesIds);
|
||||||
|
s.setRoutesIds(ns.routesIds);
|
||||||
|
s.distance = ns.distance;
|
||||||
|
s.x31 = ns.x31;
|
||||||
|
s.y31 = ns.y31;
|
||||||
|
// List<TransportRoute> routes1 = new ArrayList<>();
|
||||||
|
//cache routes to avoid circular conversion and just search them by id
|
||||||
|
// for (int i = 0; i < ns.routes.length; i++) {
|
||||||
|
// if (s.getRoutesIds().length == ns.routes.length && convertedRoutesCache != null
|
||||||
|
// && convertedRoutesCache.get(ns.routesIds[i]) != null) {
|
||||||
|
// s.addRoute(convertedRoutesCache.get(ns.routesIds[i]));
|
||||||
|
// } else {
|
||||||
|
// s.addRoute(convertTransportRoute(ns.routes[i]));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (ns.pTStopExit_refs != null && ns.pTStopExit_refs.length > 0) {
|
||||||
|
for (int i = 0; i < ns.pTStopExit_refs.length; i++) {
|
||||||
|
s.addExit(new TransportStopExit(ns.pTStopExit_x31s[i],
|
||||||
|
ns.pTStopExit_y31s[i], ns.pTStopExit_refs[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ns.referenceToRoutesKeys != null && ns.referenceToRoutesKeys.length > 0) {
|
||||||
|
for (int i = 0; i < ns.referenceToRoutesKeys.length; i++) {
|
||||||
|
s.putReferencesToRoutes(ns.referenceToRoutesKeys[i], ns.referenceToRoutesVals[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (convertedStopsCache == null) {
|
||||||
|
convertedStopsCache = new TLongObjectHashMap<>();
|
||||||
|
}
|
||||||
|
if (convertedStopsCache.get(s.getId()) == null) {
|
||||||
|
convertedStopsCache.put(s.getId(), s);
|
||||||
|
}
|
||||||
|
stops.add(s);
|
||||||
|
}
|
||||||
|
return stops;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,4 +242,6 @@
|
||||||
<string name="enter_device_name_description">Nommez votre nouveau périphérique en max 200 symboles.</string>
|
<string name="enter_device_name_description">Nommez votre nouveau périphérique en max 200 symboles.</string>
|
||||||
<string name="enter_another_device_name">Choisissez un nom que vous n\'avez pas encore utilisé</string>
|
<string name="enter_another_device_name">Choisissez un nom que vous n\'avez pas encore utilisé</string>
|
||||||
<string name="monitoring_is_disabled">La surveillance est désactivée</string>
|
<string name="monitoring_is_disabled">La surveillance est désactivée</string>
|
||||||
|
<string name="osmand_connect_desc">Choisissez la version d\'OsmAnd qu\'OsmAnd Tracker utilise pour afficher les positions.</string>
|
||||||
|
<string name="disconnect_from_telegram_desc">Pour révoquer l\'accès au partage de localisation. Ouvrez Telegram, allez dans Paramètres → Vie privée et sécurité → Sessions, et terminez la session OsmAnd Tracker.</string>
|
||||||
</resources>
|
</resources>
|
|
@ -99,7 +99,7 @@
|
||||||
<string name="mile_per_hour">m/tasint</string>
|
<string name="mile_per_hour">m/tasint</string>
|
||||||
<string name="km_h">h</string>
|
<string name="km_h">h</string>
|
||||||
<string name="m_s">m/s</string>
|
<string name="m_s">m/s</string>
|
||||||
<string name="nm_h">h</string>
|
<string name="nm_h">nmi/h</string>
|
||||||
<string name="min_km">tasint</string>
|
<string name="min_km">tasint</string>
|
||||||
<string name="min_mile">tasint</string>
|
<string name="min_mile">tasint</string>
|
||||||
<string name="m">m</string>
|
<string name="m">m</string>
|
||||||
|
@ -118,7 +118,7 @@
|
||||||
<string name="enter_password">Sekcem awal n uffir</string>
|
<string name="enter_password">Sekcem awal n uffir</string>
|
||||||
<string name="authentication_code">Tangalt n usesteb s snat n tarrayin</string>
|
<string name="authentication_code">Tangalt n usesteb s snat n tarrayin</string>
|
||||||
<string name="enter_code">Kcem</string>
|
<string name="enter_code">Kcem</string>
|
||||||
<string name="shared_string_password">Awal n uɛeddi</string>
|
<string name="shared_string_password">Awal uffir</string>
|
||||||
<string name="phone_number_title">Uṭṭun n tiliɣri</string>
|
<string name="phone_number_title">Uṭṭun n tiliɣri</string>
|
||||||
<string name="start_location_sharing">Bḍu adɣar</string>
|
<string name="start_location_sharing">Bḍu adɣar</string>
|
||||||
<string name="set_time">Akud</string>
|
<string name="set_time">Akud</string>
|
||||||
|
@ -207,4 +207,64 @@
|
||||||
<string name="successfully_sent_and_updated">Yettwazen akken iwata</string>
|
<string name="successfully_sent_and_updated">Yettwazen akken iwata</string>
|
||||||
<string name="last_updated_location">Adig aneggaru yettwaleqmen:</string>
|
<string name="last_updated_location">Adig aneggaru yettwaleqmen:</string>
|
||||||
<string name="share_location_as_description">Ma tebɣiḍ ad teqqneḍ ddeqs n yibenkan ɣer yiwet n umiḍan Telegram, ilaq ad tesqedceḍ ibenk-nniḍen i beṭṭu n wadig-ik.</string>
|
<string name="share_location_as_description">Ma tebɣiḍ ad teqqneḍ ddeqs n yibenkan ɣer yiwet n umiḍan Telegram, ilaq ad tesqedceḍ ibenk-nniḍen i beṭṭu n wadig-ik.</string>
|
||||||
|
<string name="welcome_descr"><b>Aneḍfaṛ OsmAnd </b> ad k-yeǧǧ ad tebḍuḍ adig-ik daɣen ad twaliḍ wid-nniḍen deg OsmAnd.<br/><br/>Asnas iseqdac API n Telegram, ihi tesriḍ amiḍan Telegram.</string>
|
||||||
|
<string name="si_mi_meters">Amayel / Amitr</string>
|
||||||
|
<string name="si_km_m">Ikilumitren/imitren</string>
|
||||||
|
<string name="si_mi_yard">Miles/yards</string>
|
||||||
|
<string name="si_mi_feet">Amayel/aḍar</string>
|
||||||
|
<string name="si_nm_h">Amayel n waman deg usrag (tikerras)</string>
|
||||||
|
<string name="si_min_m">Tisdatin deg umayl</string>
|
||||||
|
<string name="si_min_km">Tisdatin deg ukilumitr</string>
|
||||||
|
<string name="nm">nmi</string>
|
||||||
|
<string name="foot">ft</string>
|
||||||
|
<string name="shared_string_authorization_descr">Ttxil-k sekcem uṭṭun-ik n tiliɣri Telegram s umasal agraɣlan</string>
|
||||||
|
<string name="active_chats">Asqerdec urmid</string>
|
||||||
|
<string name="show_users_on_map">Sken iseqdacen ɣef tkarḍa</string>
|
||||||
|
<string name="install_osmand">Sbedd OsmAnd</string>
|
||||||
|
<string name="install_osmand_dialog_message">Tersriḍ deg tazwara ad tesbeddeḍ lqem ilelli neɣ n lexlaṣ n OsmAnd</string>
|
||||||
|
<string name="osmand_logo">Alugu OsmAnd</string>
|
||||||
|
<string name="process_service">Ameẓlu uneḍfaṛ OsmAnd</string>
|
||||||
|
<string name="sharing_location">Bḍu adig</string>
|
||||||
|
<string name="osmand_service_descr">Aneḍfaṛ OsmAnd yesselkam deg ugilal deg ugdil isekwṛen.</string>
|
||||||
|
<string name="location_service_no_gps_available">Fren yiwen seg yisaǧǧawen n adig akken ad tebḍuḍ adig-ik.</string>
|
||||||
|
<string name="gps_not_available">Ttixil-k rmed \"adig\" deg yiɣewwaṛen n unagraw</string>
|
||||||
|
<string name="no_location_permission">Asnas ixuṣ tisirag i unekcum ɣer yisefka n wadig.</string>
|
||||||
|
<string name="gps_network_not_enabled">Rmed \"adig\"\?</string>
|
||||||
|
<string name="password_descr">Awal uffir Telegram</string>
|
||||||
|
<string name="authentication_code_descr">Telegram yuzen-ak-d tangalt akken OsmAnd ad yeqqen ɣer umiḍan.</string>
|
||||||
|
<string name="phone_number_descr">Uṭṭun n tiliɣri s umasal agraɣlan</string>
|
||||||
|
<string name="app_name">Aneḍfaṛ GPS srid n OsmAnd</string>
|
||||||
|
<string name="my_location_search_hint">Nadid: Agraw neɣ anermis</string>
|
||||||
|
<string name="location_sharing_description">Fren inermisen akked yigrawen ukud tebɣiḍ ad tebḍuḍ adig-ik.</string>
|
||||||
|
<string name="set_time_description">Sbadu akud anid inermisen akked yigrawen yettwafernen ad walin adig-ik deg wakud ilaw.</string>
|
||||||
|
<string name="visible_time_for_all">Yettban-d i meṛṛa</string>
|
||||||
|
<string name="hours_and_minutes_format">%1$d sr %2$d sd</string>
|
||||||
|
<string name="set_visible_time_for_all">Sbadu akud n uskan i meṛṛa</string>
|
||||||
|
<string name="enter_authentication_code">Sekcem tangalt n usesteb</string>
|
||||||
|
<string name="enter_phone_number">Sekcem uṭṭun n tiliɣri</string>
|
||||||
|
<string name="do_not_have_telegram">Ur sɛiɣ ara amiḍan Telegram</string>
|
||||||
|
<string name="already_registered_in_telegram">Tesriḍ ad tjerrdeḍ s umiḍan ɣer Telegram akked wuṭṭun n tiliɣri</string>
|
||||||
|
<string name="get_telegram_after_creating_account">Tzemreḍ sakin ad tesqedceḍ asnas-a.</string>
|
||||||
|
<string name="get_telegram_description_continue">Ttxil-k sbedd Telegram daɣen rnu amiḍan.</string>
|
||||||
|
<string name="get_telegram_account_first">Tesriḍ amiḍan Telegram akken ad tesqedceḍ beṭṭu n wadig.</string>
|
||||||
|
<string name="get_telegram_title">Ajerred ɣer Telegram</string>
|
||||||
|
<string name="open_osmand">Ldi OsmAnd</string>
|
||||||
|
<string name="turn_off_location_sharing">Sens beṭṭu n wadig</string>
|
||||||
|
<string name="stop_sharing_all">Beṭṭu yermed (sens)</string>
|
||||||
|
<string name="send_my_location">Azen adig-iw</string>
|
||||||
|
<string name="send_my_location_desc">Sbadu azilal adday i beṭṭu n wadig.</string>
|
||||||
|
<string name="stale_location_desc">Akud aneggaru i yettwasengez unermis.</string>
|
||||||
|
<string name="location_history">Azray n usideg</string>
|
||||||
|
<string name="location_history_desc">Ffer inermisen ur nettawasengez ara deg wakud yettunefken.</string>
|
||||||
|
<string name="osmand_connect">OsmAnd qqen</string>
|
||||||
|
<string name="osmand_connect_desc">Fren lqem OsmAnd i yesseqdac uneḍfaṛ OsmAnd akken ad d-yesken idigen.</string>
|
||||||
|
<string name="connected_account">Amiḍan yeqqen</string>
|
||||||
|
<string name="logout_help_desc">Amek ara tsenseḍ aneḍfaṛ OsmAnd n Telegram</string>
|
||||||
|
<string name="disconnect_from_telegram">Amek ara tsenseḍ aneḍfaṛ OsmAnd n Telegram</string>
|
||||||
|
<string name="disconnect_from_telegram_desc">Akken ad teḥwiḍ anekcum ɣer beṭṭu. Ldi Telegram, ddu ɣer Iɣewwaṛen → Tabaḍnit d tɣellist → Tiɣimiyin, sakin fak tiɣimit n uneḍfaṛ OsmAnd.</string>
|
||||||
|
<string name="logout_no_internet_msg">Qqen ɣer Internet ad teffɣeḍ akken iwata seg Telegram.</string>
|
||||||
|
<string name="turn_off_all">Sens meṛṛa</string>
|
||||||
|
<string name="disable_all_sharing">Sens akk beṭṭu</string>
|
||||||
|
<string name="disable_all_sharing_desc">Sens beṭṭu n wadig i meṛṛa asqerdec yettwafernen (%1$d).</string>
|
||||||
|
<string name="choose_osmand">Fren lqem OsmAnd ara tesqedceḍ</string>
|
||||||
</resources>
|
</resources>
|
BIN
OsmAnd/res/drawable-hdpi/bg_contextmenu_shadow_left_light.9.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.4 KiB |
BIN
OsmAnd/res/drawable-mdpi/bg_contextmenu_shadow_left_light.9.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.3 KiB |