Skip to content

Commit

Permalink
Merge branch 'master' into rzr-click
Browse files Browse the repository at this point in the history
  • Loading branch information
RZR-UA committed Dec 10, 2024
2 parents f570865 + ac3f846 commit 35ce02c
Show file tree
Hide file tree
Showing 69 changed files with 1,847 additions and 1,424 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import gnu.trove.list.array.TIntArrayList;
import gnu.trove.map.hash.TLongObjectHashMap;

import net.osmand.PlatformUtil;
import net.osmand.data.LatLon;
import net.osmand.data.QuadRect;
import net.osmand.data.TransportRoute;
Expand All @@ -22,13 +23,16 @@
import net.osmand.osm.edit.Way;
import net.osmand.util.MapUtils;

import org.apache.commons.logging.Log;

public class TransportRoutePlanner {

private static final boolean MEASURE_TIME = false;

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;
private final static Log LOG = PlatformUtil.getLog(TransportRoutePlanner.class);

public List<TransportRouteResult> buildRoute(TransportRoutingContext ctx, LatLon start, LatLon end) throws IOException, InterruptedException {
ctx.startCalcTime = System.currentTimeMillis();
Expand All @@ -41,6 +45,7 @@ public List<TransportRouteResult> buildRoute(TransportRoutingContext ctx, LatLon
endSegments.put(s.getId(), s);
}
if(startStops.size() == 0) {
LOG.info("Public transport. Start stop is empty");
return Collections.emptyList();
}
PriorityQueue<TransportRouteSegment> queue = new PriorityQueue<TransportRouteSegment>(startStops.size(), new SegmentsComparator(ctx));
Expand Down Expand Up @@ -581,6 +586,7 @@ public static List<TransportRouteResult> convertToTransportRoutingResult(NativeT
TLongObjectHashMap<TransportStop> convertedStopsCache = new TLongObjectHashMap<>();

if (res.length == 0) {
LOG.info("Public transport. No route found");
return new ArrayList<TransportRouteResult>();
}
List<TransportRouteResult> convertedRes = new ArrayList<TransportRouteResult>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ object RouteActivityHelper {
runAsync {
trackItems.forEach { trackItem ->
trackItem.getFile()?.let { file ->
val gpxFile = PlatformUtil.getOsmAndContext().getSelectedFileByPath(file.absolutePath())
if (gpxFile != null && gpxFile.error == null) {
var gpxFile = PlatformUtil.getOsmAndContext().getSelectedFileByPath(file.absolutePath())
if (gpxFile == null) {
gpxFile = GpxUtilities.loadGpxFile(file)
}
if (gpxFile.error == null) {
saveRouteActivityAsync(gpxFile, routeActivity)
}
}
Expand Down
1 change: 1 addition & 0 deletions OsmAnd-telegram/res/values-hr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,5 @@
<string name="enter_code">Upiši kȏd</string>
<string name="shared_string_error">Greška</string>
<string name="send_live_location_error">Greška prilikom slanja trenutne lokacije: %1$s</string>
<string name="ltr_or_rtl_combine_via_dash">%1$s – %2$s</string>
</resources>
5 changes: 2 additions & 3 deletions OsmAnd/res/layout/navigation_widget_small.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
android:layout_height="@dimen/simple_widget_small_height"
android:orientation="vertical"
android:paddingStart="9dp"
android:paddingTop="6dp"
android:paddingEnd="16dp"
android:paddingBottom="3dp">
android:paddingVertical="6dp"
android:paddingEnd="16dp">

<LinearLayout
android:id="@+id/container"
Expand Down
4 changes: 4 additions & 0 deletions OsmAnd/res/values-b+sr+Latn/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5686,4 +5686,8 @@
<string name="auto_zoom_3d_angle">Auto zum 3D ugao</string>
<string name="vehicle_metrics_recording_description">Izaberi parametre koji će biti snimljeni u GPX fajlu.</string>
<string name="shared_string_engine">Motor</string>
<string name="location_interpolation_percent">Procenat interpolacije pozicije</string>
<string name="shared_string_interpolation">Interpolacija</string>
<string name="location_interpolation_percent_desc">Postavi procenat interpolacije lokacije tokom navigacije. Ovaj parametar smanjuje kašnjenje položaja tvoje lokacije na mapi tokom animacije.</string>
<string name="selected_delayed_profile">Izabrani profil \"%s\"</string>
</resources>
1 change: 1 addition & 0 deletions OsmAnd/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5677,4 +5677,5 @@
<string name="location_interpolation_percent">Procento interpolace polohy</string>
<string name="location_interpolation_percent_desc">Nastavení procenta interpolace polohy během navigace po trase. Tento parametr snižuje zpoždění polohy na mapě během animace.</string>
<string name="shared_string_interpolation">Interpolace</string>
<string name="selected_delayed_profile">Zvolený profil „%s“</string>
</resources>
1 change: 1 addition & 0 deletions OsmAnd/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5689,4 +5689,5 @@
<string name="shared_string_interpolation">Interpolation</string>
<string name="location_interpolation_percent_desc">Indstil procentdelen af lokationsinterpolation under rutenavigation. Denne parameter reducerer forsinkelsen af din position på kortet under animation.</string>
<string name="location_interpolation_percent">Interpolation af placering i procent</string>
<string name="selected_delayed_profile">Valgte profil \"%s\"</string>
</resources>
Loading

0 comments on commit 35ce02c

Please sign in to comment.