From e5ca877802513c40514638a0b4f6cbc87760b223 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Thu, 23 Jan 2020 10:19:06 +0200 Subject: [PATCH 01/45] fix defining driving region #7668 --- .../src/main/java/net/osmand/map/OsmandRegions.java | 8 +++++--- .../osmand/plus/base/MapViewTrackingUtilities.java | 2 +- .../src/net/osmand/plus/routing/RoutingHelper.java | 13 +++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java b/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java index 629514bdb9..2738ea17f8 100644 --- a/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java +++ b/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java @@ -746,9 +746,11 @@ public class OsmandRegions { boolean isRegion = true; for (int i = 0; i < o.getTypes().length; i++) { TagValuePair tp = o.getMapIndex().decodeType(o.getTypes()[i]); - if ("boundary".equals(tp.value)) { - isRegion = false; - break; + if (o.getTypes().length > 1) { + if ("boundary".equals(tp.value)) { + isRegion = false; + break; + } } } WorldRegion downloadRegion = getRegionData(getFullName(o)); diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 9b2ac30258..c52727b28e 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -155,7 +155,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc return movingToMyLocation; } - private void detectDrivingRegion(final LatLon latLon) { + public void detectDrivingRegion(final LatLon latLon) { new DetectDrivingRegionTask(app).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, latLon); } diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 186bd88d11..e52639b2bc 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -57,6 +57,7 @@ public class RoutingHelper { private List intermediatePoints; private Location lastProjection; private Location lastFixedLocation; + private LatLon lastStartingLocation = null; private static final int RECALCULATE_THRESHOLD_COUNT_CAUSING_FULL_RECALCULATE = 3; private static final int RECALCULATE_THRESHOLD_CAUSING_FULL_RECALCULATE_INTERVAL = 2*60*1000; @@ -174,6 +175,7 @@ public class RoutingHelper { public synchronized void setFinalAndCurrentLocation(LatLon finalLocation, List intermediatePoints, Location currentLocation){ RouteCalculationResult previousRoute = route; + setLastStartingLocation(currentLocation); clearCurrentRoute(finalLocation, intermediatePoints); // to update route setCurrentLocation(currentLocation, false, previousRoute, true); @@ -260,6 +262,17 @@ public class RoutingHelper { return finalLocation; } + public void setLastStartingLocation(Location nextStartLocation) { + LatLon start = new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude()); + if (lastStartingLocation == null) { + lastStartingLocation = new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude()); + app.getMapViewTrackingUtilities().detectDrivingRegion(lastStartingLocation); + } else if (MapUtils.getDistance(start, lastStartingLocation) > 100000) { + lastStartingLocation = start; + app.getMapViewTrackingUtilities().detectDrivingRegion(lastStartingLocation); + } + } + public List getIntermediatePoints() { return intermediatePoints; } From d0aaddf28c88e4647cd7d88585ebef5e2df7e21c Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Thu, 23 Jan 2020 10:40:24 +0200 Subject: [PATCH 02/45] fix defining driving region 2 #7668 --- OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index c52727b28e..4e3a79e032 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -168,6 +168,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc if (settings.DRIVING_REGION_AUTOMATIC.get() && !drivingRegionUpdated && !app.isApplicationInitializing()) { drivingRegionUpdated = true; detectDrivingRegion(new LatLon(location.getLatitude(), location.getLongitude())); + app.getRoutingHelper().setLastStartingLocation(location); } } if (mapView != null) { From 42a7a5d88dc183444fba4fe09f76a87f9c598d69 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Thu, 23 Jan 2020 18:31:04 +0200 Subject: [PATCH 03/45] fix defining driving region 3 #7668 --- .../java/net/osmand/map/OsmandRegions.java | 13 +------------ OsmAnd/src/net/osmand/plus/OsmandSettings.java | 5 ++--- .../plus/base/MapViewTrackingUtilities.java | 3 +-- .../net/osmand/plus/routing/RoutingHelper.java | 18 +++++++++--------- 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java b/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java index 2738ea17f8..7fb87d477c 100644 --- a/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java +++ b/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java @@ -743,19 +743,8 @@ public class OsmandRegions { while (it.hasNext()) { BinaryMapDataObject o = it.next(); if (o.getTypes() != null) { - boolean isRegion = true; - for (int i = 0; i < o.getTypes().length; i++) { - TagValuePair tp = o.getMapIndex().decodeType(o.getTypes()[i]); - if (o.getTypes().length > 1) { - if ("boundary".equals(tp.value)) { - isRegion = false; - break; - } - } - } WorldRegion downloadRegion = getRegionData(getFullName(o)); - if (!isRegion - || downloadRegion == null + if ( downloadRegion == null || !downloadRegion.isRegionMapDownload() || !contain(o, point31x, point31y)) { it.remove(); diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 32bd59b209..0bcc44c9a8 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1319,9 +1319,8 @@ public class OsmandSettings { return DrivingRegion.JAPAN; } else if (df.getCountry().equalsIgnoreCase("au")) { return DrivingRegion.AUSTRALIA; -// potentially wrong in Europe -// } else if(df.getCountry().equalsIgnoreCase(Locale.UK.getCountry())) { -// return DrivingRegion.UK_AND_OTHERS; + } else if(df.getCountry().equalsIgnoreCase(Locale.UK.getCountry())) { + return DrivingRegion.UK_AND_OTHERS; } return DrivingRegion.EUROPE_ASIA; } diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 4e3a79e032..8df561b05d 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -167,8 +167,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc locationProvider = location.getProvider(); if (settings.DRIVING_REGION_AUTOMATIC.get() && !drivingRegionUpdated && !app.isApplicationInitializing()) { drivingRegionUpdated = true; - detectDrivingRegion(new LatLon(location.getLatitude(), location.getLongitude())); - app.getRoutingHelper().setLastStartingLocation(location); + app.getRoutingHelper().cacheStartLocation(location); } } if (mapView != null) { diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index e52639b2bc..0adf9194cf 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -57,7 +57,7 @@ public class RoutingHelper { private List intermediatePoints; private Location lastProjection; private Location lastFixedLocation; - private LatLon lastStartingLocation = null; + private LatLon lastStartLocation = null; private static final int RECALCULATE_THRESHOLD_COUNT_CAUSING_FULL_RECALCULATE = 3; private static final int RECALCULATE_THRESHOLD_CAUSING_FULL_RECALCULATE_INTERVAL = 2*60*1000; @@ -175,7 +175,7 @@ public class RoutingHelper { public synchronized void setFinalAndCurrentLocation(LatLon finalLocation, List intermediatePoints, Location currentLocation){ RouteCalculationResult previousRoute = route; - setLastStartingLocation(currentLocation); + cacheStartLocation(currentLocation); clearCurrentRoute(finalLocation, intermediatePoints); // to update route setCurrentLocation(currentLocation, false, previousRoute, true); @@ -262,14 +262,14 @@ public class RoutingHelper { return finalLocation; } - public void setLastStartingLocation(Location nextStartLocation) { + public void cacheStartLocation(Location nextStartLocation) { LatLon start = new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude()); - if (lastStartingLocation == null) { - lastStartingLocation = new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude()); - app.getMapViewTrackingUtilities().detectDrivingRegion(lastStartingLocation); - } else if (MapUtils.getDistance(start, lastStartingLocation) > 100000) { - lastStartingLocation = start; - app.getMapViewTrackingUtilities().detectDrivingRegion(lastStartingLocation); + if (lastStartLocation == null) { + lastStartLocation = new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude()); + app.getMapViewTrackingUtilities().detectDrivingRegion(lastStartLocation); + } else if (MapUtils.getDistance(start, lastStartLocation) > 100000) { + lastStartLocation = start; + app.getMapViewTrackingUtilities().detectDrivingRegion(lastStartLocation); } } From 576c4330b46efe2b1c04d70cc847c6ecad0d298d Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 24 Jan 2020 15:51:27 +0200 Subject: [PATCH 04/45] refactoring and fixes --- .../java/net/osmand/map/OsmandRegions.java | 38 ++++++++----------- .../src/net/osmand/plus/OsmandSettings.java | 23 +++++++++++ .../net/osmand/plus/TargetPointsHelper.java | 1 + .../plus/base/MapViewTrackingUtilities.java | 20 ++++------ .../plus/download/DownloadResources.java | 2 +- .../download/ui/SearchDialogFragment.java | 7 ++-- .../osmand/plus/routing/RoutingHelper.java | 20 +++++----- .../plus/views/DownloadedRegionsLayer.java | 13 +++---- .../plus/wikipedia/WikiArticleHelper.java | 2 +- 9 files changed, 68 insertions(+), 58 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java b/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java index 7fb87d477c..07ed57126c 100644 --- a/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java +++ b/OsmAnd-java/src/main/java/net/osmand/map/OsmandRegions.java @@ -691,31 +691,21 @@ public class OsmandRegions { } } - public List getWoldRegionsAt(LatLon latLon) throws IOException { - List result = new ArrayList<>(); - List mapDataObjects = getBinaryMapDataObjectsAt(latLon); - for (BinaryMapDataObject obj : mapDataObjects) { - String fullName = getFullName(obj); - if (fullName != null) { - WorldRegion reg = getRegionData(fullName); - if (reg != null) { - result.add(reg); - } - } - } - return result; + public List getWorldRegionsAt(LatLon latLon) throws IOException { + Map mapDataObjects = getBinaryMapDataObjectsWithRegionsAt(latLon); + return new ArrayList<>(mapDataObjects.keySet()); } - public BinaryMapDataObject getSmallestBinaryMapDataObjectAt(LatLon latLon) throws IOException { - List mapDataObjects = getBinaryMapDataObjectsAt(latLon); - return getSmallestBinaryMapDataObjectAt(mapDataObjects); + public Map.Entry getSmallestBinaryMapDataObjectAt(LatLon latLon) throws IOException { + Map mapDataObjectsWithRegions = getBinaryMapDataObjectsWithRegionsAt(latLon); + return getSmallestBinaryMapDataObjectAt(mapDataObjectsWithRegions); } - public BinaryMapDataObject getSmallestBinaryMapDataObjectAt(List mapDataObjects) { - BinaryMapDataObject res = null; + public Map.Entry getSmallestBinaryMapDataObjectAt(Map mapDataObjectsWithRegions) { + Map.Entry res = null; double smallestArea = -1; - for (BinaryMapDataObject o : mapDataObjects) { - double area = OsmandRegions.getArea(o); + for (Map.Entry o : mapDataObjectsWithRegions.entrySet()) { + double area = OsmandRegions.getArea(o.getValue()); if (smallestArea == -1) { smallestArea = area; res = o; @@ -727,10 +717,10 @@ public class OsmandRegions { return res; } - private List getBinaryMapDataObjectsAt(LatLon latLon) throws IOException { + private Map getBinaryMapDataObjectsWithRegionsAt(LatLon latLon) throws IOException { int point31x = MapUtils.get31TileNumberX(latLon.getLongitude()); int point31y = MapUtils.get31TileNumberY(latLon.getLatitude()); - + Map foundObjects = new LinkedHashMap<>(); List mapDataObjects; try { mapDataObjects = queryBboxNoInit(point31x, point31x, point31y, point31y, true); @@ -748,11 +738,13 @@ public class OsmandRegions { || !downloadRegion.isRegionMapDownload() || !contain(o, point31x, point31y)) { it.remove(); + } else { + foundObjects.put(downloadRegion, o); } } } } - return mapDataObjects; + return foundObjects; } diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 0bcc44c9a8..d3d92d0e51 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1342,6 +1342,29 @@ public class OsmandSettings { public final OsmandPreference ANGULAR_UNITS = new EnumIntPreference( "angular_measurement", AngularConstants.DEGREES, AngularConstants.values()).makeProfile(); + public static final String LAST_START_LAT = "last_searched_lat"; //$NON-NLS-1$ + public static final String LAST_START_LON = "last_searched_lon"; //$NON-NLS-1$ + + public LatLon getLastStartPoint() { + if (settingsAPI.contains(globalPreferences, LAST_START_LAT) && settingsAPI.contains(globalPreferences, LAST_START_LON)) { + return new LatLon(settingsAPI.getFloat(globalPreferences, LAST_START_LAT, 0), + settingsAPI.getFloat(globalPreferences, LAST_START_LON, 0)); + } + return null; + } + + public boolean setLastStartPoint(LatLon l) { + if (l == null) { + return settingsAPI.edit(globalPreferences).remove(LAST_START_LAT).remove(LAST_START_LON).commit(); + } else { + return setLastStartPoint(l.getLatitude(), l.getLongitude()); + } + } + + public boolean setLastStartPoint(double lat, double lon) { + return settingsAPI.edit(globalPreferences).putFloat(LAST_START_LAT, (float) lat). + putFloat(LAST_START_LON, (float) lon).commit(); + } public final OsmandPreference SPEED_SYSTEM = new EnumIntPreference( "default_speed_system", SpeedConstants.KILOMETERS_PER_HOUR, SpeedConstants.values()) { diff --git a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java index 494b77e176..046456a172 100644 --- a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java +++ b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java @@ -445,6 +445,7 @@ public class TargetPointsHelper { Location lastKnownLocation = ctx.getLocationProvider().getLastKnownLocation(); LatLon latLon = lastKnownLocation != null ? new LatLon(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude()) : null; + routingHelper.checkAndUpdateStartLocation(latLon); setMyLocationPoint(latLon, false, null); } } diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 8df561b05d..d9985350e9 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -7,7 +7,6 @@ import android.view.WindowManager; import net.osmand.Location; import net.osmand.StateChangedListener; -import net.osmand.binary.BinaryMapDataObject; import net.osmand.data.LatLon; import net.osmand.data.RotatedTileBox; import net.osmand.map.IMapLocationListener; @@ -28,6 +27,7 @@ import net.osmand.plus.views.AnimateDraggingMapThread; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.util.MapUtils; + import java.io.IOException; import java.text.SimpleDateFormat; @@ -167,7 +167,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc locationProvider = location.getProvider(); if (settings.DRIVING_REGION_AUTOMATIC.get() && !drivingRegionUpdated && !app.isApplicationInitializing()) { drivingRegionUpdated = true; - app.getRoutingHelper().cacheStartLocation(location); + app.getRoutingHelper().checkAndUpdateStartLocation(location); } } if (mapView != null) { @@ -444,7 +444,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc isUserZoomed = true; } - private static class DetectDrivingRegionTask extends AsyncTask { + private static class DetectDrivingRegionTask extends AsyncTask { private OsmandApplication app; @@ -453,10 +453,10 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc } @Override - protected BinaryMapDataObject doInBackground(LatLon... latLons) { + protected WorldRegion doInBackground(LatLon... latLons) { try { if (latLons != null && latLons.length > 0) { - return app.getRegions().getSmallestBinaryMapDataObjectAt(latLons[0]); + return app.getRegions().getSmallestBinaryMapDataObjectAt(latLons[0]).getKey(); } } catch (IOException e) { // ignore @@ -465,13 +465,9 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc } @Override - protected void onPostExecute(BinaryMapDataObject o) { - if (o != null) { - String fullName = app.getRegions().getFullName(o); - WorldRegion worldRegion = app.getRegions().getRegionData(fullName); - if (worldRegion != null) { - app.setupDrivingRegion(worldRegion); - } + protected void onPostExecute(WorldRegion worldRegion) { + if (worldRegion != null) { + app.setupDrivingRegion(worldRegion); } } } diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java index fdb14163c5..c30c2730d2 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java @@ -468,7 +468,7 @@ public class DownloadResources extends DownloadResourceGroup { List res = new ArrayList<>(); OsmandRegions regions = app.getRegions(); DownloadIndexesThread downloadThread = app.getDownloadThread(); - List downloadRegions = regions.getWoldRegionsAt(latLon); + List downloadRegions = regions.getWorldRegionsAt(latLon); for (WorldRegion downloadRegion : downloadRegions) { if (includeDownloaded || !isIndexItemDownloaded(downloadThread, type, downloadRegion, res)) { addIndexItem(downloadThread, type, downloadRegion, res); diff --git a/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java index 034b2fa8f6..a123c20564 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java @@ -417,14 +417,13 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven protected IndexItem doInBackground(Void... params) { Amenity amenity = cityItem.getAmenity(); BinaryMapDataObject o = null; + WorldRegion downloadRegion = null; try { - o = osmandRegions.getSmallestBinaryMapDataObjectAt(amenity.getLocation()); + downloadRegion = osmandRegions.getSmallestBinaryMapDataObjectAt(amenity.getLocation()).getKey(); } catch (IOException e) { // ignore } - if (o != null) { - String selectedFullName = osmandRegions.getFullName(o); - WorldRegion downloadRegion = osmandRegions.getRegionData(selectedFullName); + if (downloadRegion != null) { List indexItems = ctx.getDownloadThread().getIndexes().getIndexItems(downloadRegion); for (IndexItem item : indexItems) { if (item.getType() == DownloadActivityType.NORMAL_FILE) { diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 0adf9194cf..401d8c7584 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -39,6 +39,7 @@ public class RoutingHelper { private static final org.apache.commons.logging.Log log = PlatformUtil.getLog(RoutingHelper.class); private static final float POSITION_TOLERANCE = 60; + private static final int CACHE_RADIUS = 100000; private List> listeners = new LinkedList<>(); private List> updateListeners = new LinkedList<>(); @@ -57,7 +58,6 @@ public class RoutingHelper { private List intermediatePoints; private Location lastProjection; private Location lastFixedLocation; - private LatLon lastStartLocation = null; private static final int RECALCULATE_THRESHOLD_COUNT_CAUSING_FULL_RECALCULATE = 3; private static final int RECALCULATE_THRESHOLD_CAUSING_FULL_RECALCULATE_INTERVAL = 2*60*1000; @@ -174,8 +174,8 @@ public class RoutingHelper { } public synchronized void setFinalAndCurrentLocation(LatLon finalLocation, List intermediatePoints, Location currentLocation){ + checkAndUpdateStartLocation(currentLocation); RouteCalculationResult previousRoute = route; - cacheStartLocation(currentLocation); clearCurrentRoute(finalLocation, intermediatePoints); // to update route setCurrentLocation(currentLocation, false, previousRoute, true); @@ -261,15 +261,15 @@ public class RoutingHelper { public LatLon getFinalLocation() { return finalLocation; } + public void checkAndUpdateStartLocation(Location nextStartLocation) { + checkAndUpdateStartLocation(new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude())); + } - public void cacheStartLocation(Location nextStartLocation) { - LatLon start = new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude()); - if (lastStartLocation == null) { - lastStartLocation = new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude()); - app.getMapViewTrackingUtilities().detectDrivingRegion(lastStartLocation); - } else if (MapUtils.getDistance(start, lastStartLocation) > 100000) { - lastStartLocation = start; - app.getMapViewTrackingUtilities().detectDrivingRegion(lastStartLocation); + public void checkAndUpdateStartLocation(LatLon newStartLocation) { + LatLon lastStartLocation = app.getSettings().getLastStartPoint(); + if (lastStartLocation == null || MapUtils.getDistance(newStartLocation, lastStartLocation) > CACHE_RADIUS) { + app.getMapViewTrackingUtilities().detectDrivingRegion(newStartLocation); + app.getSettings().setLastStartPoint(newStartLocation); } } diff --git a/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java b/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java index 0d5342a7da..b87c36a30e 100644 --- a/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java @@ -45,8 +45,10 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.TreeSet; @@ -250,7 +252,7 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe && zoom >= ZOOM_MIN_TO_SHOW_DOWNLOAD_DIALOG && zoom <= ZOOM_MAX_TO_SHOW_DOWNLOAD_DIALOG && currentObjects != null) { WorldRegion regionData; - List selectedObjects = new ArrayList<>(); + Map selectedObjects = new LinkedHashMap<>(); for (int i = 0; i < currentObjects.size(); i++) { final BinaryMapDataObject o = currentObjects.get(i); String fullName = osmandRegions.getFullName(o); @@ -262,7 +264,7 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe hideDownloadMapToolbar(); return; } else { - selectedObjects.add(o); + selectedObjects.put(regionData, o); } } } @@ -270,11 +272,8 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe IndexItem indexItem = null; String name = null; - BinaryMapDataObject smallestRegion = app.getRegions().getSmallestBinaryMapDataObjectAt(selectedObjects); - if (smallestRegion != null) { - String fullName = osmandRegions.getFullName(smallestRegion); - regionData = osmandRegions.getRegionData(fullName); - + regionData = app.getRegions().getSmallestBinaryMapDataObjectAt(selectedObjects).getKey(); + if (regionData != null) { DownloadIndexesThread downloadThread = app.getDownloadThread(); List indexItems = downloadThread.getIndexes().getIndexItems(regionData); if (indexItems.size() == 0) { diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java index d85decda64..ef96f89671 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java @@ -107,7 +107,7 @@ public class WikiArticleHelper { List regions = null; if (articleLatLon != null) { try { - regions = application.getRegions().getWoldRegionsAt(articleLatLon); + regions = application.getRegions().getWorldRegionsAt(articleLatLon); } catch (IOException e) { Log.e(TAG, e.getMessage(), e); } From 315e1c38a77fad5e50ce0960e0ea332630993cb6 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 24 Jan 2020 16:34:01 +0200 Subject: [PATCH 05/45] typo --- .../src/net/osmand/plus/download/ui/SearchDialogFragment.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java index a123c20564..0d9834a351 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java @@ -1,7 +1,6 @@ package net.osmand.plus.download.ui; import android.content.res.TypedArray; -import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.os.Bundle; @@ -32,7 +31,6 @@ import net.osmand.Collator; import net.osmand.CollatorStringMatcher; import net.osmand.OsmAndCollator; import net.osmand.ResultMatcher; -import net.osmand.binary.BinaryMapDataObject; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.SearchRequest; import net.osmand.data.Amenity; @@ -416,7 +414,6 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven @Override protected IndexItem doInBackground(Void... params) { Amenity amenity = cityItem.getAmenity(); - BinaryMapDataObject o = null; WorldRegion downloadRegion = null; try { downloadRegion = osmandRegions.getSmallestBinaryMapDataObjectAt(amenity.getLocation()).getKey(); From e737223c5c18b1aa3a3fa97c280428ed1ba9909e Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 27 Jan 2020 12:23:36 +0200 Subject: [PATCH 06/45] Change displayed OsmAnd Tracker name, for short version --- OsmAnd-telegram/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd-telegram/AndroidManifest.xml b/OsmAnd-telegram/AndroidManifest.xml index 8f20ec3b5e..09d7472e5a 100644 --- a/OsmAnd-telegram/AndroidManifest.xml +++ b/OsmAnd-telegram/AndroidManifest.xml @@ -15,7 +15,7 @@ android:name="net.osmand.telegram.TelegramApplication" android:allowBackup="true" android:icon="@mipmap/ic_launcher" - android:label="@string/app_name" + android:label="@string/app_name_short" android:launchMode="singleTask" android:screenOrientation="unspecified" android:supportsRtl="true" From 28a9ffb058243525a360e1307ff57d580df9b507 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Mon, 27 Jan 2020 18:18:42 +0300 Subject: [PATCH 07/45] Speedup buffer sending. Fix buffer hanging on app restart. --- .../net/osmand/telegram/TelegramService.kt | 4 ++- .../telegram/helpers/ShareLocationHelper.kt | 31 ++++++++++++++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/TelegramService.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramService.kt index 1046133665..4ff84ca542 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/TelegramService.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/TelegramService.kt @@ -109,10 +109,11 @@ class TelegramService : Service(), LocationListener, TelegramIncomingMessagesLis sendLocationInterval = intent.getLongExtra(SEND_LOCATION_INTERVAL, 0) setupServiceErrorInterval() - app.telegramService = this app.telegramHelper.addIncomingMessagesListener(this) app.telegramHelper.addOutgoingMessagesListener(this) + app.telegramService = this + if (isUsedByMyLocation(usedBy)) { initLocationUpdates() startShareInfoUpdates() @@ -122,6 +123,7 @@ class TelegramService : Service(), LocationListener, TelegramIncomingMessagesLis app.telegramHelper.startLiveMessagesUpdates(app.settings.sendMyLocInterval) startTracksUpdates() } + app.shareLocationHelper.checkAndSendBufferMessages() val locationNotification = app.notificationHelper.locationNotification val notification = app.notificationHelper.buildNotification(locationNotification) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShareLocationHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShareLocationHelper.kt index 83ffda291b..b23deb2a4b 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShareLocationHelper.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShareLocationHelper.kt @@ -1,5 +1,7 @@ package net.osmand.telegram.helpers +import android.os.Handler +import android.os.Message import net.osmand.Location import net.osmand.PlatformUtil import net.osmand.telegram.* @@ -16,7 +18,9 @@ import org.json.JSONObject private const val USER_SET_LIVE_PERIOD_DELAY_MS = 5000 // 5 sec private const val MIN_MESSAGE_SENDING_INTERVAL_MS = 1000 // 1 sec -private const val MIN_MESSAGES_BUFFER_CHECK_INTERVAL_MS = 800 // 0.8 sec +private const val MIN_MESSAGES_BUFFER_CHECK_INTERVAL_MS = 300 // 0.3 sec + +private const val SEND_MESSAGES_BUFFER_MS_MSG_ID = 5000 class ShareLocationHelper(private val app: TelegramApplication) { @@ -52,6 +56,9 @@ class ShareLocationHelper(private val app: TelegramApplication) { private var lastTimeInMillis: Long = 0L + private var sendBufferMessagesHandler = Handler() + private var sendBufferMessagesRunnable = Runnable { app.shareLocationHelper.checkAndSendBufferMessages(false) } + fun updateLocation(location: Location?) { val lastPoint = lastLocation var record = true @@ -120,7 +127,7 @@ class ShareLocationHelper(private val app: TelegramApplication) { } } - fun checkAndSendBufferMessages() { + fun checkAndSendBufferMessages(checkNetworkTypeAllowed: Boolean = true) { log.debug("checkAndSendBufferMessages") var pendingMessagesLimitReached = false app.settings.getChatsShareInfo().forEach { (chatId, shareInfo) -> @@ -129,18 +136,30 @@ class ShareLocationHelper(private val app: TelegramApplication) { pendingMessagesLimitReached = true } } - if (pendingMessagesLimitReached) { + if (pendingMessagesLimitReached && checkNetworkTypeAllowed) { checkNetworkType() } } + fun checkAndSendBufferMessagesDelayed() { + if (!sendBufferMessagesHandler.hasMessages(SEND_MESSAGES_BUFFER_MS_MSG_ID)) { + val msg = Message.obtain(sendBufferMessagesHandler, sendBufferMessagesRunnable) + msg.what = SEND_MESSAGES_BUFFER_MS_MSG_ID + sendBufferMessagesHandler.sendMessageDelayed(msg, MIN_MESSAGES_BUFFER_CHECK_INTERVAL_MS.toLong() + 1L) + } + } + fun checkAndSendBufferMessagesToChat(chatId: Long, forced: Boolean = false): Int { val shareChatsInfo = app.settings.getChatsShareInfo() val shareInfo = shareChatsInfo[chatId] if (shareInfo != null) { + val bufferedMessagesCount = app.locationMessages.getBufferedMessagesCountForChat(chatId) + if (bufferedMessagesCount > 0) { + checkAndSendBufferMessagesDelayed() + } val currentTime = System.currentTimeMillis() if (currentTime - shareInfo.lastBufferCheckTime < MIN_MESSAGES_BUFFER_CHECK_INTERVAL_MS && !forced) { - return app.locationMessages.getBufferedMessagesCountForChat(chatId) + return bufferedMessagesCount } shareInfo.lastBufferCheckTime = currentTime @@ -182,7 +201,9 @@ class ShareLocationHelper(private val app: TelegramApplication) { refreshNotification() - checkAndSendBufferMessages() + if (app.telegramService != null) { + checkAndSendBufferMessages() + } } else { app.forceUpdateMyLocation() } From 467e73ed8d9cb3071e21743c80860716de792259 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Mon, 27 Jan 2020 17:20:14 +0200 Subject: [PATCH 08/45] Fix absent edit profile name keyboard and profile icon selection for new created profiles --- .../src/net/osmand/plus/settings/ProfileAppearanceFragment.java | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java b/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java index 33329179e6..c2e83bb400 100644 --- a/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java @@ -113,6 +113,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment { profile.routeService = baseModeForNewProfile.getRouteService(); profile.locationIcon = baseModeForNewProfile.getLocationIcon(); profile.navigationIcon = baseModeForNewProfile.getNavigationIcon(); + onAppModeChanged(ApplicationMode.valueOfStringKey(baseModeForNewProfile.getStringKey(), null)); } else { profile.stringKey = getSelectedAppMode().getStringKey(); profile.parent = getSelectedAppMode().getParent(); From 720354c6ceee3dc0fd381259fd57f3802a3d9971 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Mon, 27 Jan 2020 17:41:27 +0200 Subject: [PATCH 09/45] add function to calculate correct central point of polygons --- .../java/net/osmand/osm/edit/OsmMapUtils.java | 190 +++++++++++++++++- 1 file changed, 189 insertions(+), 1 deletion(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java b/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java index 9a91683785..3460774594 100644 --- a/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java +++ b/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java @@ -1,10 +1,12 @@ package net.osmand.osm.edit; +import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.List; +import java.util.PriorityQueue; import net.osmand.data.LatLon; import net.osmand.osm.edit.Relation.RelationMember; @@ -46,6 +48,19 @@ public class OsmMapUtils { } return null; } + + public static LatLon getComplexPolyCenter(Collection nodes) { + double precision = 1e-4; //where to put constant? + + final List> rings = new ArrayList<>(); + List outerRing = new ArrayList<>(); + for (Node n : nodes) { + outerRing.add(new LatLon(n.getLatitude(), n.getLongitude())); + } + rings.add(outerRing); + return getPolylabelPoint(rings, precision); + //return getPolylabelPoint(new Polygon(points), precision); + } public static LatLon getWeightCenter(Collection nodes) { if (nodes.isEmpty()) { @@ -86,7 +101,8 @@ public class OsmMapUtils { return null; } boolean area = w.getFirstNodeId() == w.getLastNodeId(); - LatLon ll = area ? getMathWeightCenterForNodes(nodes) : getWeightCenterForNodes(nodes); +// LatLon ll = area ? getMathWeightCenterForNodes(nodes) : getWeightCenterForNodes(nodes); + LatLon ll = area ? getComplexPolyCenter(nodes) : getWeightCenterForNodes(nodes); if(ll == null) { return null; } @@ -107,6 +123,7 @@ public class OsmMapUtils { } return new LatLon(flat, flon); + } @@ -436,6 +453,177 @@ public class OsmMapUtils { return Math.abs(area) / 2; } + + /** + * Calculate "visual" center point of polygons (based on Mapbox' polylabel algorithm) + * @param rings - list of lists of nodes + * @param precision - precision of calculation, should be small, like 1e-4 or less. + * @return coordinates of calculated center + */ + + private static LatLon getPolylabelPoint(List> rings, double precision) { + // find the bounding box of the outer ring + double minX = Double.MAX_VALUE; + double minY = Double.MAX_VALUE; + double maxX = -Double.MAX_VALUE; + double maxY = -Double.MAX_VALUE; + List outerRingCoordinates = rings.get(0); + for (LatLon p: outerRingCoordinates) { + double lat = p.getLatitude(); + double lon = p.getLongitude(); + minX = StrictMath.min(minX, lon); + minY = StrictMath.min(minY, lat); + maxX = StrictMath.max(maxX, lon); + maxY = StrictMath.max(maxY, lat); + } + double width = maxX - minX; + double height = maxY - minY; + double cellSize = Math.min(width, height); + double h = cellSize / 2; + + if (cellSize == 0) return new LatLon(minX, minY); + + // a priority queue of cells in order of their "potential" (max distance to polygon) + PriorityQueue cellQueue = new PriorityQueue<>(new CellComparator()); + + // cover polygon with initial cells + for (double x = minX; x < maxX; x += cellSize) { + for (double y = minY; y < maxY; y += cellSize) { + cellQueue.add(new Cell(x + h, y + h, h, rings)); + } + } + + // take centroid as the first best guess + Cell bestCell = getCentroidCell(rings); + + // special case for rectangular polygons + Cell bboxCell = new Cell(minX + width / 2, minY + height / 2, 0, rings); + if (bboxCell.d > bestCell.d) bestCell = bboxCell; + + while (!cellQueue.isEmpty()) { + // pick the most promising cell from the queue + Cell cell = cellQueue.poll(); + + // update the best cell if we found a better one + if (cell.d > bestCell.d) { + bestCell = cell; + } + + // do not drill down further if there's no chance of a better solution +// System.out.println(String.format("check for precision: cell.max - bestCell.d = %f Precision: %f", cell.max, precision)); + if (cell.max - bestCell.d <= precision) continue; + + // split the cell into four cells + h = cell.h / 2; + cellQueue.add(new Cell(cell.x - h, cell.y - h, h, rings)); + cellQueue.add(new Cell(cell.x + h, cell.y - h, h, rings)); + cellQueue.add(new Cell(cell.x - h, cell.y + h, h, rings)); + cellQueue.add(new Cell(cell.x + h, cell.y + h, h, rings)); + } +// System.out.println(String.format("Best lat/lon: %f, %f", bestCell.y, bestCell.x)); + return new LatLon(bestCell.y, bestCell.x); + } + + // get polygon centroid + private static Cell getCentroidCell(List> rings) { + double area = 0; + double x = 0; + double y = 0; + + List points = rings.get(0); + for (int i = 0, len = points.size(), j = len - 1; i < len; j = i++) { + LatLon a = points.get(i); + LatLon b = points.get(j); + double aLon = a.getLongitude(); + double aLat = a.getLatitude(); + double bLon = b.getLongitude(); + double bLat = b.getLatitude(); + + double f = aLon * bLat - bLon * aLat; + x += (aLon + bLon) * f; + y += (aLat + bLat) * f; + area += f * 3; + } + + if (area == 0) { + LatLon p = points.get(0); + return new Cell(p.getLatitude(), p.getLongitude(), 0, rings); + } + + return new Cell(x / area, y / area, 0, rings); + } + + private static class CellComparator implements Comparator { + @Override + public int compare(Cell o1, Cell o2) { + return Double.compare(o2.max, o1.max); + } + } + + private static class Cell { + private final double x; // cell center x (lon) + private final double y; // cell center y (lat) + private final double h; // half the cell size + private final double d; // distance from cell center to polygon + private final double max; // max distance to polygon within a cell + + private Cell(double x, double y, double h, List> rings) { + this.x = x; + this.y = y; + this.h = h; + this.d = pointToPolygonDist(x, y, rings); + this.max = this.d + this.h * Math.sqrt(2); + } + + // signed distance from point to polygon outline (negative if point is outside) + private double pointToPolygonDist(double x, double y, List> rings) { + boolean inside = false; + double minDistSq = Double.MAX_VALUE; + + for (List ring: rings) { + for (int i = 0, len = ring.size(), j = len - 1; i < len; j = i++) { + LatLon a = ring.get(i); + LatLon b = ring.get(j); + double aLon = a.getLongitude(); + double aLat = a.getLatitude(); + double bLon = b.getLongitude(); + double bLat = b.getLatitude(); + + if ((aLat > y != bLat > y) && (x < (bLon - aLon) * (y - aLat) / (bLat - aLat) + aLon)) { + inside = !inside; + } + + minDistSq = Math.min(minDistSq, getSegmentDistanceSqared(x, y, a, b)); + } + } + return (inside ? 1 : -1) * Math.sqrt(minDistSq); + } + + // get squared distance from a point to a segment of polygon + private double getSegmentDistanceSqared(double px, double py, LatLon a, LatLon b) { + double x = a.getLongitude(); + double y = a.getLatitude(); + double dx = b.getLongitude() - x; + double dy = b.getLatitude() - y; + + if (dx != 0 || dy != 0) { + double t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy); + + if (t > 1) { + x = b.getLongitude(); + y = b.getLatitude(); + } else if (t > 0) { + x += dx * t; + y += dy * t; + } + } + + dx = px - x; + dy = py - y; + + return dx * dx + dy * dy; + } + } } From 93ba9d64fcea777a3b68c632fb12d2ea48ae9cb7 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 27 Jan 2020 15:42:32 +0100 Subject: [PATCH 10/45] Add label coordinates --- .../java/net/osmand/binary/OsmandOdb.java | 719 +++++++++++------- 1 file changed, 437 insertions(+), 282 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java b/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java index ab68c8af11..848f4b01c1 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java @@ -11289,10 +11289,10 @@ public final class OsmandOdb { * *
    * coordinates can take much space 4*4*count of data blocks=
-   *   required sint32 left = 1; // delta encoded
-   *   required sint32 right = 2; // delta encoded
-   *   required sint32 top = 3; // delta encoded
-   *   required sint32 bottom = 4; // delta encoded
+   *	required sint32 left = 1; // delta encoded
+   *	required sint32 right = 2; // delta encoded
+   *	required sint32 top = 3; // delta encoded
+   *	required sint32 bottom = 4; // delta encoded
    * 
*/ public static final class MapDataBlock extends @@ -11642,10 +11642,10 @@ public final class OsmandOdb { * *
      * coordinates can take much space 4*4*count of data blocks=
-     *   required sint32 left = 1; // delta encoded
-     *   required sint32 right = 2; // delta encoded
-     *   required sint32 top = 3; // delta encoded
-     *   required sint32 bottom = 4; // delta encoded
+     *	required sint32 left = 1; // delta encoded
+     *	required sint32 right = 2; // delta encoded
+     *	required sint32 top = 3; // delta encoded
+     *	required sint32 bottom = 4; // delta encoded
      * 
*/ public static final class Builder extends @@ -12387,6 +12387,24 @@ public final class OsmandOdb { */ com.google.protobuf.ByteString getTypes(); + // optional bytes labelcoordinates = 8; + /** + * optional bytes labelcoordinates = 8; + * + *
+     * pair x,y (sint32) of delta encoded to center of <coordinates> 31th zoom
+     * 
+ */ + boolean hasLabelcoordinates(); + /** + * optional bytes labelcoordinates = 8; + * + *
+     * pair x,y (sint32) of delta encoded to center of <coordinates> 31th zoom
+     * 
+ */ + com.google.protobuf.ByteString getLabelcoordinates(); + // optional bytes stringNames = 10; /** * optional bytes stringNames = 10; @@ -12512,18 +12530,23 @@ public final class OsmandOdb { types_ = input.readBytes(); break; } - case 82: { + case 66: { bitField0_ |= 0x00000010; + labelcoordinates_ = input.readBytes(); + break; + } + case 82: { + bitField0_ |= 0x00000020; stringNames_ = input.readBytes(); break; } case 96: { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; id_ = input.readSInt64(); break; } case 122: { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; rasterBytes_ = input.readBytes(); break; } @@ -12685,6 +12708,30 @@ public final class OsmandOdb { return types_; } + // optional bytes labelcoordinates = 8; + public static final int LABELCOORDINATES_FIELD_NUMBER = 8; + private com.google.protobuf.ByteString labelcoordinates_; + /** + * optional bytes labelcoordinates = 8; + * + *
+     * pair x,y (sint32) of delta encoded to center of <coordinates> 31th zoom
+     * 
+ */ + public boolean hasLabelcoordinates() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional bytes labelcoordinates = 8; + * + *
+     * pair x,y (sint32) of delta encoded to center of <coordinates> 31th zoom
+     * 
+ */ + public com.google.protobuf.ByteString getLabelcoordinates() { + return labelcoordinates_; + } + // optional bytes stringNames = 10; public static final int STRINGNAMES_FIELD_NUMBER = 10; private com.google.protobuf.ByteString stringNames_; @@ -12696,7 +12743,7 @@ public final class OsmandOdb { * */ public boolean hasStringNames() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000020) == 0x00000020); } /** * optional bytes stringNames = 10; @@ -12720,7 +12767,7 @@ public final class OsmandOdb { * */ public boolean hasId() { - return ((bitField0_ & 0x00000020) == 0x00000020); + return ((bitField0_ & 0x00000040) == 0x00000040); } /** * required sint64 id = 12; @@ -12740,7 +12787,7 @@ public final class OsmandOdb { * optional bytes rasterBytes = 15; */ public boolean hasRasterBytes() { - return ((bitField0_ & 0x00000040) == 0x00000040); + return ((bitField0_ & 0x00000080) == 0x00000080); } /** * optional bytes rasterBytes = 15; @@ -12755,6 +12802,7 @@ public final class OsmandOdb { polygonInnerCoordinates_ = java.util.Collections.emptyList(); additionalTypes_ = com.google.protobuf.ByteString.EMPTY; types_ = com.google.protobuf.ByteString.EMPTY; + labelcoordinates_ = com.google.protobuf.ByteString.EMPTY; stringNames_ = com.google.protobuf.ByteString.EMPTY; id_ = 0L; rasterBytes_ = com.google.protobuf.ByteString.EMPTY; @@ -12795,12 +12843,15 @@ public final class OsmandOdb { output.writeBytes(7, types_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(10, stringNames_); + output.writeBytes(8, labelcoordinates_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeSInt64(12, id_); + output.writeBytes(10, stringNames_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeSInt64(12, id_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { output.writeBytes(15, rasterBytes_); } getUnknownFields().writeTo(output); @@ -12839,13 +12890,17 @@ public final class OsmandOdb { } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(10, stringNames_); + .computeBytesSize(8, labelcoordinates_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeSInt64Size(12, id_); + .computeBytesSize(10, stringNames_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt64Size(12, id_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(15, rasterBytes_); } @@ -12975,12 +13030,14 @@ public final class OsmandOdb { bitField0_ = (bitField0_ & ~0x00000008); types_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000010); - stringNames_ = com.google.protobuf.ByteString.EMPTY; + labelcoordinates_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000020); - id_ = 0L; + stringNames_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000040); - rasterBytes_ = com.google.protobuf.ByteString.EMPTY; + id_ = 0L; bitField0_ = (bitField0_ & ~0x00000080); + rasterBytes_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); return this; } @@ -13033,14 +13090,18 @@ public final class OsmandOdb { if (((from_bitField0_ & 0x00000020) == 0x00000020)) { to_bitField0_ |= 0x00000010; } - result.stringNames_ = stringNames_; + result.labelcoordinates_ = labelcoordinates_; if (((from_bitField0_ & 0x00000040) == 0x00000040)) { to_bitField0_ |= 0x00000020; } - result.id_ = id_; + result.stringNames_ = stringNames_; if (((from_bitField0_ & 0x00000080) == 0x00000080)) { to_bitField0_ |= 0x00000040; } + result.id_ = id_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000080; + } result.rasterBytes_ = rasterBytes_; result.bitField0_ = to_bitField0_; onBuilt(); @@ -13080,6 +13141,9 @@ public final class OsmandOdb { if (other.hasTypes()) { setTypes(other.getTypes()); } + if (other.hasLabelcoordinates()) { + setLabelcoordinates(other.getLabelcoordinates()); + } if (other.hasStringNames()) { setStringNames(other.getStringNames()); } @@ -13396,6 +13460,58 @@ public final class OsmandOdb { return this; } + // optional bytes labelcoordinates = 8; + private com.google.protobuf.ByteString labelcoordinates_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes labelcoordinates = 8; + * + *
+       * pair x,y (sint32) of delta encoded to center of <coordinates> 31th zoom
+       * 
+ */ + public boolean hasLabelcoordinates() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional bytes labelcoordinates = 8; + * + *
+       * pair x,y (sint32) of delta encoded to center of <coordinates> 31th zoom
+       * 
+ */ + public com.google.protobuf.ByteString getLabelcoordinates() { + return labelcoordinates_; + } + /** + * optional bytes labelcoordinates = 8; + * + *
+       * pair x,y (sint32) of delta encoded to center of <coordinates> 31th zoom
+       * 
+ */ + public Builder setLabelcoordinates(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + labelcoordinates_ = value; + onChanged(); + return this; + } + /** + * optional bytes labelcoordinates = 8; + * + *
+       * pair x,y (sint32) of delta encoded to center of <coordinates> 31th zoom
+       * 
+ */ + public Builder clearLabelcoordinates() { + bitField0_ = (bitField0_ & ~0x00000020); + labelcoordinates_ = getDefaultInstance().getLabelcoordinates(); + onChanged(); + return this; + } + // optional bytes stringNames = 10; private com.google.protobuf.ByteString stringNames_ = com.google.protobuf.ByteString.EMPTY; /** @@ -13406,7 +13522,7 @@ public final class OsmandOdb { * */ public boolean hasStringNames() { - return ((bitField0_ & 0x00000020) == 0x00000020); + return ((bitField0_ & 0x00000040) == 0x00000040); } /** * optional bytes stringNames = 10; @@ -13429,7 +13545,7 @@ public final class OsmandOdb { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; stringNames_ = value; onChanged(); return this; @@ -13442,7 +13558,7 @@ public final class OsmandOdb { * */ public Builder clearStringNames() { - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); stringNames_ = getDefaultInstance().getStringNames(); onChanged(); return this; @@ -13458,7 +13574,7 @@ public final class OsmandOdb { * */ public boolean hasId() { - return ((bitField0_ & 0x00000040) == 0x00000040); + return ((bitField0_ & 0x00000080) == 0x00000080); } /** * required sint64 id = 12; @@ -13478,7 +13594,7 @@ public final class OsmandOdb { * */ public Builder setId(long value) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; id_ = value; onChanged(); return this; @@ -13491,7 +13607,7 @@ public final class OsmandOdb { * */ public Builder clearId() { - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000080); id_ = 0L; onChanged(); return this; @@ -13503,7 +13619,7 @@ public final class OsmandOdb { * optional bytes rasterBytes = 15; */ public boolean hasRasterBytes() { - return ((bitField0_ & 0x00000080) == 0x00000080); + return ((bitField0_ & 0x00000100) == 0x00000100); } /** * optional bytes rasterBytes = 15; @@ -13518,7 +13634,7 @@ public final class OsmandOdb { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; rasterBytes_ = value; onChanged(); return this; @@ -13527,7 +13643,7 @@ public final class OsmandOdb { * optional bytes rasterBytes = 15; */ public Builder clearRasterBytes() { - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); rasterBytes_ = getDefaultInstance().getRasterBytes(); onChanged(); return this; @@ -35734,7 +35850,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-     * ids of routes that contain this stop
+     * ids of [routes] that contain this stop
+     * - length and values correspond to [routes] array
+     * - old version (< 08/2019) files don't have them
+     * - default algorithm makes them sorted 
      * 
*/ java.util.List getRoutesIdsList(); @@ -35742,7 +35861,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-     * ids of routes that contain this stop
+     * ids of [routes] that contain this stop
+     * - length and values correspond to [routes] array
+     * - old version (< 08/2019) files don't have them
+     * - default algorithm makes them sorted 
      * 
*/ int getRoutesIdsCount(); @@ -35750,7 +35872,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-     * ids of routes that contain this stop
+     * ids of [routes] that contain this stop
+     * - length and values correspond to [routes] array
+     * - old version (< 08/2019) files don't have them
+     * - default algorithm makes them sorted 
      * 
*/ long getRoutesIds(int index); @@ -36222,7 +36347,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-     * ids of routes that contain this stop
+     * ids of [routes] that contain this stop
+     * - length and values correspond to [routes] array
+     * - old version (< 08/2019) files don't have them
+     * - default algorithm makes them sorted 
      * 
*/ public java.util.List @@ -36233,7 +36361,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-     * ids of routes that contain this stop
+     * ids of [routes] that contain this stop
+     * - length and values correspond to [routes] array
+     * - old version (< 08/2019) files don't have them
+     * - default algorithm makes them sorted 
      * 
*/ public int getRoutesIdsCount() { @@ -36243,7 +36374,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-     * ids of routes that contain this stop
+     * ids of [routes] that contain this stop
+     * - length and values correspond to [routes] array
+     * - old version (< 08/2019) files don't have them
+     * - default algorithm makes them sorted 
      * 
*/ public long getRoutesIds(int index) { @@ -37497,7 +37631,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-       * ids of routes that contain this stop
+       * ids of [routes] that contain this stop
+       * - length and values correspond to [routes] array
+       * - old version (< 08/2019) files don't have them
+       * - default algorithm makes them sorted 
        * 
*/ public java.util.List @@ -37508,7 +37645,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-       * ids of routes that contain this stop
+       * ids of [routes] that contain this stop
+       * - length and values correspond to [routes] array
+       * - old version (< 08/2019) files don't have them
+       * - default algorithm makes them sorted 
        * 
*/ public int getRoutesIdsCount() { @@ -37518,7 +37658,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-       * ids of routes that contain this stop
+       * ids of [routes] that contain this stop
+       * - length and values correspond to [routes] array
+       * - old version (< 08/2019) files don't have them
+       * - default algorithm makes them sorted 
        * 
*/ public long getRoutesIds(int index) { @@ -37528,7 +37671,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-       * ids of routes that contain this stop
+       * ids of [routes] that contain this stop
+       * - length and values correspond to [routes] array
+       * - old version (< 08/2019) files don't have them
+       * - default algorithm makes them sorted 
        * 
*/ public Builder setRoutesIds( @@ -37542,7 +37688,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-       * ids of routes that contain this stop
+       * ids of [routes] that contain this stop
+       * - length and values correspond to [routes] array
+       * - old version (< 08/2019) files don't have them
+       * - default algorithm makes them sorted 
        * 
*/ public Builder addRoutesIds(long value) { @@ -37555,7 +37704,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-       * ids of routes that contain this stop
+       * ids of [routes] that contain this stop
+       * - length and values correspond to [routes] array
+       * - old version (< 08/2019) files don't have them
+       * - default algorithm makes them sorted 
        * 
*/ public Builder addAllRoutesIds( @@ -37569,7 +37721,10 @@ public final class OsmandOdb { * repeated uint64 routesIds = 22; * *
-       * ids of routes that contain this stop
+       * ids of [routes] that contain this stop
+       * - length and values correspond to [routes] array
+       * - old version (< 08/2019) files don't have them
+       * - default algorithm makes them sorted 
        * 
*/ public Builder clearRoutesIds() { @@ -46879,7 +47034,7 @@ public final class OsmandOdb { *
      * id calculated
      * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
      * 
*/ java.util.List @@ -46890,7 +47045,7 @@ public final class OsmandOdb { *
      * id calculated
      * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
      * 
*/ net.osmand.binary.OsmandOdb.OsmAndPoiSubtype getSubtypes(int index); @@ -46900,7 +47055,7 @@ public final class OsmandOdb { *
      * id calculated
      * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
      * 
*/ int getSubtypesCount(); @@ -46910,7 +47065,7 @@ public final class OsmandOdb { *
      * id calculated
      * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
      * 
*/ java.util.List @@ -46921,7 +47076,7 @@ public final class OsmandOdb { *
      * id calculated
      * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
      * 
*/ net.osmand.binary.OsmandOdb.OsmAndPoiSubtypeOrBuilder getSubtypesOrBuilder( @@ -47037,7 +47192,7 @@ public final class OsmandOdb { *
      * id calculated
      * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
      * 
*/ public java.util.List getSubtypesList() { @@ -47049,7 +47204,7 @@ public final class OsmandOdb { *
      * id calculated
      * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
      * 
*/ public java.util.List @@ -47062,7 +47217,7 @@ public final class OsmandOdb { *
      * id calculated
      * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
      * 
*/ public int getSubtypesCount() { @@ -47074,7 +47229,7 @@ public final class OsmandOdb { *
      * id calculated
      * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
      * 
*/ public net.osmand.binary.OsmandOdb.OsmAndPoiSubtype getSubtypes(int index) { @@ -47086,7 +47241,7 @@ public final class OsmandOdb { *
      * id calculated
      * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+     * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
      * 
*/ public net.osmand.binary.OsmandOdb.OsmAndPoiSubtypeOrBuilder getSubtypesOrBuilder( @@ -47383,7 +47538,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public java.util.List getSubtypesList() { @@ -47399,7 +47554,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public int getSubtypesCount() { @@ -47415,7 +47570,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public net.osmand.binary.OsmandOdb.OsmAndPoiSubtype getSubtypes(int index) { @@ -47431,7 +47586,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public Builder setSubtypes( @@ -47454,7 +47609,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public Builder setSubtypes( @@ -47474,7 +47629,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public Builder addSubtypes(net.osmand.binary.OsmandOdb.OsmAndPoiSubtype value) { @@ -47496,7 +47651,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public Builder addSubtypes( @@ -47519,7 +47674,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public Builder addSubtypes( @@ -47539,7 +47694,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public Builder addSubtypes( @@ -47559,7 +47714,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public Builder addAllSubtypes( @@ -47579,7 +47734,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public Builder clearSubtypes() { @@ -47598,7 +47753,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public Builder removeSubtypes(int index) { @@ -47617,7 +47772,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public net.osmand.binary.OsmandOdb.OsmAndPoiSubtype.Builder getSubtypesBuilder( @@ -47630,7 +47785,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public net.osmand.binary.OsmandOdb.OsmAndPoiSubtypeOrBuilder getSubtypesOrBuilder( @@ -47646,7 +47801,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public java.util.List @@ -47663,7 +47818,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public net.osmand.binary.OsmandOdb.OsmAndPoiSubtype.Builder addSubtypesBuilder() { @@ -47676,7 +47831,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public net.osmand.binary.OsmandOdb.OsmAndPoiSubtype.Builder addSubtypesBuilder( @@ -47690,7 +47845,7 @@ public final class OsmandOdb { *
        * id calculated
        * 1. if subtypes_order <= 31 : ( (subtypeValue << 5) | subtypes_order) << 1
-       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1    
+       * 2. if subtypes_order > 31  : ( (subtypeValue << 16) | subtypes_order) << 1 + 1	 
        * 
*/ public java.util.List @@ -59017,10 +59172,10 @@ public final class OsmandOdb { * *
        * coordinates can take much space 4*4*count of data blocks=
-       *   required sint32 left = 1; // delta encoded
-       *   required sint32 right = 2; // delta encoded
-       *   required sint32 top = 3; // delta encoded
-       *   required sint32 bottom = 4; // delta encoded
+       *	required sint32 left = 1; // delta encoded
+       *	required sint32 right = 2; // delta encoded
+       *	required sint32 top = 3; // delta encoded
+       *	required sint32 bottom = 4; // delta encoded
        * 
*/ boolean hasIdTable(); @@ -59029,10 +59184,10 @@ public final class OsmandOdb { * *
        * coordinates can take much space 4*4*count of data blocks=
-       *   required sint32 left = 1; // delta encoded
-       *   required sint32 right = 2; // delta encoded
-       *   required sint32 top = 3; // delta encoded
-       *   required sint32 bottom = 4; // delta encoded
+       *	required sint32 left = 1; // delta encoded
+       *	required sint32 right = 2; // delta encoded
+       *	required sint32 top = 3; // delta encoded
+       *	required sint32 bottom = 4; // delta encoded
        * 
*/ net.osmand.binary.OsmandOdb.IdTable getIdTable(); @@ -59041,10 +59196,10 @@ public final class OsmandOdb { * *
        * coordinates can take much space 4*4*count of data blocks=
-       *   required sint32 left = 1; // delta encoded
-       *   required sint32 right = 2; // delta encoded
-       *   required sint32 top = 3; // delta encoded
-       *   required sint32 bottom = 4; // delta encoded
+       *	required sint32 left = 1; // delta encoded
+       *	required sint32 right = 2; // delta encoded
+       *	required sint32 top = 3; // delta encoded
+       *	required sint32 bottom = 4; // delta encoded
        * 
*/ net.osmand.binary.OsmandOdb.IdTableOrBuilder getIdTableOrBuilder(); @@ -59260,10 +59415,10 @@ public final class OsmandOdb { * *
        * coordinates can take much space 4*4*count of data blocks=
-       *   required sint32 left = 1; // delta encoded
-       *   required sint32 right = 2; // delta encoded
-       *   required sint32 top = 3; // delta encoded
-       *   required sint32 bottom = 4; // delta encoded
+       *	required sint32 left = 1; // delta encoded
+       *	required sint32 right = 2; // delta encoded
+       *	required sint32 top = 3; // delta encoded
+       *	required sint32 bottom = 4; // delta encoded
        * 
*/ public boolean hasIdTable() { @@ -59274,10 +59429,10 @@ public final class OsmandOdb { * *
        * coordinates can take much space 4*4*count of data blocks=
-       *   required sint32 left = 1; // delta encoded
-       *   required sint32 right = 2; // delta encoded
-       *   required sint32 top = 3; // delta encoded
-       *   required sint32 bottom = 4; // delta encoded
+       *	required sint32 left = 1; // delta encoded
+       *	required sint32 right = 2; // delta encoded
+       *	required sint32 top = 3; // delta encoded
+       *	required sint32 bottom = 4; // delta encoded
        * 
*/ public net.osmand.binary.OsmandOdb.IdTable getIdTable() { @@ -59288,10 +59443,10 @@ public final class OsmandOdb { * *
        * coordinates can take much space 4*4*count of data blocks=
-       *   required sint32 left = 1; // delta encoded
-       *   required sint32 right = 2; // delta encoded
-       *   required sint32 top = 3; // delta encoded
-       *   required sint32 bottom = 4; // delta encoded
+       *	required sint32 left = 1; // delta encoded
+       *	required sint32 right = 2; // delta encoded
+       *	required sint32 top = 3; // delta encoded
+       *	required sint32 bottom = 4; // delta encoded
        * 
*/ public net.osmand.binary.OsmandOdb.IdTableOrBuilder getIdTableOrBuilder() { @@ -59787,10 +59942,10 @@ public final class OsmandOdb { * *
          * coordinates can take much space 4*4*count of data blocks=
-         *   required sint32 left = 1; // delta encoded
-         *   required sint32 right = 2; // delta encoded
-         *   required sint32 top = 3; // delta encoded
-         *   required sint32 bottom = 4; // delta encoded
+         *	required sint32 left = 1; // delta encoded
+         *	required sint32 right = 2; // delta encoded
+         *	required sint32 top = 3; // delta encoded
+         *	required sint32 bottom = 4; // delta encoded
          * 
*/ public boolean hasIdTable() { @@ -59801,10 +59956,10 @@ public final class OsmandOdb { * *
          * coordinates can take much space 4*4*count of data blocks=
-         *   required sint32 left = 1; // delta encoded
-         *   required sint32 right = 2; // delta encoded
-         *   required sint32 top = 3; // delta encoded
-         *   required sint32 bottom = 4; // delta encoded
+         *	required sint32 left = 1; // delta encoded
+         *	required sint32 right = 2; // delta encoded
+         *	required sint32 top = 3; // delta encoded
+         *	required sint32 bottom = 4; // delta encoded
          * 
*/ public net.osmand.binary.OsmandOdb.IdTable getIdTable() { @@ -59819,10 +59974,10 @@ public final class OsmandOdb { * *
          * coordinates can take much space 4*4*count of data blocks=
-         *   required sint32 left = 1; // delta encoded
-         *   required sint32 right = 2; // delta encoded
-         *   required sint32 top = 3; // delta encoded
-         *   required sint32 bottom = 4; // delta encoded
+         *	required sint32 left = 1; // delta encoded
+         *	required sint32 right = 2; // delta encoded
+         *	required sint32 top = 3; // delta encoded
+         *	required sint32 bottom = 4; // delta encoded
          * 
*/ public Builder setIdTable(net.osmand.binary.OsmandOdb.IdTable value) { @@ -59843,10 +59998,10 @@ public final class OsmandOdb { * *
          * coordinates can take much space 4*4*count of data blocks=
-         *   required sint32 left = 1; // delta encoded
-         *   required sint32 right = 2; // delta encoded
-         *   required sint32 top = 3; // delta encoded
-         *   required sint32 bottom = 4; // delta encoded
+         *	required sint32 left = 1; // delta encoded
+         *	required sint32 right = 2; // delta encoded
+         *	required sint32 top = 3; // delta encoded
+         *	required sint32 bottom = 4; // delta encoded
          * 
*/ public Builder setIdTable( @@ -59865,10 +60020,10 @@ public final class OsmandOdb { * *
          * coordinates can take much space 4*4*count of data blocks=
-         *   required sint32 left = 1; // delta encoded
-         *   required sint32 right = 2; // delta encoded
-         *   required sint32 top = 3; // delta encoded
-         *   required sint32 bottom = 4; // delta encoded
+         *	required sint32 left = 1; // delta encoded
+         *	required sint32 right = 2; // delta encoded
+         *	required sint32 top = 3; // delta encoded
+         *	required sint32 bottom = 4; // delta encoded
          * 
*/ public Builder mergeIdTable(net.osmand.binary.OsmandOdb.IdTable value) { @@ -59892,10 +60047,10 @@ public final class OsmandOdb { * *
          * coordinates can take much space 4*4*count of data blocks=
-         *   required sint32 left = 1; // delta encoded
-         *   required sint32 right = 2; // delta encoded
-         *   required sint32 top = 3; // delta encoded
-         *   required sint32 bottom = 4; // delta encoded
+         *	required sint32 left = 1; // delta encoded
+         *	required sint32 right = 2; // delta encoded
+         *	required sint32 top = 3; // delta encoded
+         *	required sint32 bottom = 4; // delta encoded
          * 
*/ public Builder clearIdTable() { @@ -59913,10 +60068,10 @@ public final class OsmandOdb { * *
          * coordinates can take much space 4*4*count of data blocks=
-         *   required sint32 left = 1; // delta encoded
-         *   required sint32 right = 2; // delta encoded
-         *   required sint32 top = 3; // delta encoded
-         *   required sint32 bottom = 4; // delta encoded
+         *	required sint32 left = 1; // delta encoded
+         *	required sint32 right = 2; // delta encoded
+         *	required sint32 top = 3; // delta encoded
+         *	required sint32 bottom = 4; // delta encoded
          * 
*/ public net.osmand.binary.OsmandOdb.IdTable.Builder getIdTableBuilder() { @@ -59929,10 +60084,10 @@ public final class OsmandOdb { * *
          * coordinates can take much space 4*4*count of data blocks=
-         *   required sint32 left = 1; // delta encoded
-         *   required sint32 right = 2; // delta encoded
-         *   required sint32 top = 3; // delta encoded
-         *   required sint32 bottom = 4; // delta encoded
+         *	required sint32 left = 1; // delta encoded
+         *	required sint32 right = 2; // delta encoded
+         *	required sint32 top = 3; // delta encoded
+         *	required sint32 bottom = 4; // delta encoded
          * 
*/ public net.osmand.binary.OsmandOdb.IdTableOrBuilder getIdTableOrBuilder() { @@ -59947,10 +60102,10 @@ public final class OsmandOdb { * *
          * coordinates can take much space 4*4*count of data blocks=
-         *   required sint32 left = 1; // delta encoded
-         *   required sint32 right = 2; // delta encoded
-         *   required sint32 top = 3; // delta encoded
-         *   required sint32 bottom = 4; // delta encoded
+         *	required sint32 left = 1; // delta encoded
+         *	required sint32 right = 2; // delta encoded
+         *	required sint32 top = 3; // delta encoded
+         *	required sint32 bottom = 4; // delta encoded
          * 
*/ private com.google.protobuf.SingleFieldBuilder< @@ -62753,157 +62908,157 @@ public final class OsmandOdb { "OBF.OsmAndMapIndex.MapDataBox\"v\n\014MapData", "Block\022\016\n\006baseId\030\n \001(\004\022(\n\013dataObjects\030\014 \003" + "(\0132\023.OsmAnd.OBF.MapData\022,\n\013stringTable\030\017" + - " \001(\0132\027.OsmAnd.OBF.StringTable\"\266\001\n\007MapDat" + + " \001(\0132\027.OsmAnd.OBF.StringTable\"\320\001\n\007MapDat" + "a\022\023\n\013coordinates\030\001 \001(\014\022\027\n\017areaCoordinate" + "s\030\002 \001(\014\022\037\n\027polygonInnerCoordinates\030\004 \003(\014" + "\022\027\n\017additionalTypes\030\006 \001(\014\022\r\n\005types\030\007 \002(\014" + - "\022\023\n\013stringNames\030\n \001(\014\022\n\n\002id\030\014 \002(\022\022\023\n\013ras" + - "terBytes\030\017 \001(\014\"\364\003\n\022OsmAndAddressIndex\022\014\n" + - "\004name\030\001 \002(\t\022\017\n\007name_en\030\002 \001(\t\022-\n\nboundari" + - "es\030\003 \001(\0132\031.OsmAnd.OBF.OsmAndTileBox\0223\n\022a", - "ttributeTagsTable\030\004 \001(\0132\027.OsmAnd.OBF.Str" + - "ingTable\022:\n\006cities\030\006 \003(\0132*.OsmAnd.OBF.Os" + - "mAndAddressIndex.CitiesIndex\0229\n\tnameInde" + - "x\030\007 \001(\0132&.OsmAnd.OBF.OsmAndAddressNameIn" + - "dexData\032\343\001\n\013CitiesIndex\022C\n\004type\030\002 \002(\01625." + - "OsmAnd.OBF.OsmAndAddressIndex.CitiesInde" + - "x.CitiesType\022%\n\006cities\030\005 \003(\0132\025.OsmAnd.OB" + - "F.CityIndex\022*\n\006blocks\030\007 \003(\0132\032.OsmAnd.OBF" + - ".CityBlockIndex\"<\n\nCitiesType\022\021\n\rCitiesO" + - "rTowns\020\001\022\r\n\tPostcodes\020\002\022\014\n\010Villages\020\003\"\342\001", - "\n\032OsmAndAddressNameIndexData\022-\n\005table\030\004 " + - "\002(\0132\036.OsmAnd.OBF.IndexedStringTable\022I\n\004a" + - "tom\030\007 \003(\0132;.OsmAnd.OBF.OsmAndAddressName" + - "IndexData.AddressNameIndexData\032J\n\024Addres" + - "sNameIndexData\0222\n\004atom\030\004 \003(\0132$.OsmAnd.OB" + - "F.AddressNameIndexDataAtom\"\204\001\n\030AddressNa" + - "meIndexDataAtom\022\014\n\004name\030\001 \001(\t\022\016\n\006nameEn\030" + - "\002 \001(\t\022\014\n\004type\030\003 \002(\r\022\024\n\014shiftToIndex\030\005 \003(" + - "\005\022\030\n\020shiftToCityIndex\030\006 \003(\005\022\014\n\004xy16\030\007 \003(" + - "\r\"\260\001\n\tCityIndex\022\021\n\tcity_type\030\001 \001(\r\022\014\n\004na", - "me\030\002 \002(\t\022\017\n\007name_en\030\003 \001(\t\022\n\n\002id\030\004 \001(\004\022\t\n" + - "\001x\030\005 \002(\r\022\t\n\001y\030\006 \002(\r\022\027\n\017attributeTagIds\030\007" + - " \003(\r\022\027\n\017attributeValues\030\010 \003(\t\022\035\n\025shiftTo" + - "CityBlockIndex\030\n \001(\007\"\202\001\n\016CityBlockIndex\022" + - "\030\n\020shiftToCityIndex\030\004 \001(\007\022,\n\tbuildings\030\n" + - " \003(\0132\031.OsmAnd.OBF.BuildingIndex\022(\n\007stree" + - "ts\030\014 \003(\0132\027.OsmAnd.OBF.StreetIndex\"\345\001\n\013St" + - "reetIndex\022\014\n\004name\030\001 \002(\t\022\017\n\007name_en\030\002 \001(\t" + - "\022\t\n\001x\030\003 \002(\021\022\t\n\001y\030\004 \002(\021\0225\n\rintersections\030" + - "\005 \003(\0132\036.OsmAnd.OBF.StreetIntersection\022\n\n", - "\002id\030\006 \001(\004\022\027\n\017attributeTagIds\030\007 \003(\r\022\027\n\017at" + - "tributeValues\030\010 \003(\t\022,\n\tbuildings\030\014 \003(\0132\031" + - ".OsmAnd.OBF.BuildingIndex\"\221\001\n\022StreetInte" + - "rsection\022\014\n\004name\030\002 \002(\t\022\017\n\007name_en\030\003 \001(\t\022" + - "\024\n\014intersectedX\030\004 \002(\021\022\024\n\014intersectedY\030\005 " + - "\002(\021\022\027\n\017attributeTagIds\030\007 \003(\r\022\027\n\017attribut" + - "eValues\030\010 \003(\t\"\230\002\n\rBuildingIndex\022\014\n\004name\030" + - "\001 \002(\t\022\017\n\007name_en\030\002 \001(\t\022\r\n\005name2\030\003 \001(\t\022\020\n" + - "\010name_en2\030\004 \001(\t\022\025\n\rinterpolation\030\005 \001(\021\022\t" + - "\n\001x\030\007 \002(\021\022\t\n\001y\030\010 \002(\021\022\n\n\002x2\030\t \001(\021\022\n\n\002y2\030\n", - " \001(\021\022\n\n\002id\030\r \001(\004\022\020\n\010postcode\030\016 \001(\t\022\027\n\017at" + - "tributeTagIds\030\017 \003(\r\022\027\n\017attributeValues\030\020" + - " \003(\t\022\030\n\020attributeTagIds2\030\021 \003(\r\022\030\n\020attrib" + - "uteValues2\030\022 \003(\t\"=\n\017TransportRoutes\022*\n\006r" + - "outes\030\006 \003(\0132\032.OsmAnd.OBF.TransportRoute\"" + - "\300\002\n\016TransportRoute\022\n\n\002id\030\001 \002(\004\022\014\n\004type\030\003" + - " \001(\r\022\020\n\010operator\030\004 \001(\r\022\013\n\003ref\030\005 \001(\t\022\014\n\004n" + - "ame\030\006 \001(\r\022\017\n\007name_en\030\007 \001(\r\022\020\n\010distance\030\010" + - " \001(\r\022\r\n\005color\030\t \001(\r\0223\n\013directStops\030\017 \003(\013" + - "2\036.OsmAnd.OBF.TransportRouteStop\0224\n\014reve", - "rseStops\030\020 \003(\0132\036.OsmAnd.OBF.TransportRou" + - "teStop\022\020\n\010geometry\030\021 \001(\014\0228\n\014scheduleTrip" + - "\030\022 \003(\0132\".OsmAnd.OBF.TransportRouteSchedu" + - "le\"\244\001\n\026TransportRouteSchedule\022\030\n\020avgStop" + - "Intervals\030\001 \001(\014\022\030\n\020avgWaitIntervals\030\002 \001(" + - "\014\022\025\n\rtripIntervals\030\003 \001(\014\022?\n\nexceptions\030\010" + - " \003(\0132+.OsmAnd.OBF.TransportRouteSchedule" + - "Exception\"\313\001\n\037TransportRouteScheduleExce" + - "ption\022\023\n\013tripIndexes\030\001 \003(\r\022\023\n\013stopIndexe" + - "s\030\002 \003(\r\022\021\n\tavailable\030\003 \001(\010\022\024\n\014delayArriv", - "al\030\005 \003(\r\022\031\n\021deltaWaitInterval\030\006 \003(\005\022\034\n\024d" + - "ayOfWeekRestriction\030\007 \003(\r\022\034\n\024dayOfYearRe" + - "striction\030\010 \003(\r\"W\n\022TransportRouteStop\022\n\n" + - "\002id\030\001 \002(\022\022\n\n\002dx\030\002 \002(\021\022\n\n\002dy\030\003 \002(\021\022\014\n\004nam" + - "e\030\006 \002(\r\022\017\n\007name_en\030\007 \001(\r\"\332\001\n\rTransportSt" + - "op\022\n\n\002dx\030\001 \002(\021\022\n\n\002dy\030\002 \002(\021\022\n\n\002id\030\005 \002(\022\022\014" + - "\n\004name\030\006 \002(\r\022\017\n\007name_en\030\007 \001(\r\022\033\n\023additio" + - "nalNamePairs\030\010 \001(\014\022,\n\005exits\030\t \003(\0132\035.OsmA" + - "nd.OBF.TransportStopExit\022\016\n\006routes\030\020 \003(\r" + - "\022\030\n\020deletedRoutesIds\030\024 \003(\004\022\021\n\troutesIds\030", - "\026 \003(\004\"8\n\021TransportStopExit\022\n\n\002dx\030\001 \002(\021\022\n" + - "\n\002dy\030\002 \002(\021\022\013\n\003ref\030\003 \002(\r\"\272\001\n\022TransportSto" + - "psTree\022\014\n\004left\030\001 \002(\021\022\r\n\005right\030\002 \002(\021\022\013\n\003t" + - "op\030\003 \002(\021\022\016\n\006bottom\030\004 \002(\021\0220\n\010subtrees\030\007 \003" + - "(\0132\036.OsmAnd.OBF.TransportStopsTree\022(\n\005le" + - "afs\030\010 \003(\0132\031.OsmAnd.OBF.TransportStop\022\016\n\006" + - "baseId\030\020 \001(\004\"\256\001\n\024OsmAndTransportIndex\022\014\n" + - "\004name\030\001 \001(\t\022+\n\006routes\030\003 \001(\0132\033.OsmAnd.OBF" + - ".TransportRoutes\022-\n\005stops\030\006 \001(\0132\036.OsmAnd" + - ".OBF.TransportStopsTree\022,\n\013stringTable\030\t", - " \002(\0132\027.OsmAnd.OBF.StringTable\"\312\002\n\016OsmAnd" + - "PoiIndex\022\014\n\004name\030\001 \002(\t\022-\n\nboundaries\030\002 \002" + - "(\0132\031.OsmAnd.OBF.OsmAndTileBox\0228\n\017categor" + - "iesTable\030\003 \003(\0132\037.OsmAnd.OBF.OsmAndCatego" + - "ryTable\0221\n\tnameIndex\030\004 \001(\0132\036.OsmAnd.OBF." + - "OsmAndPoiNameIndex\0226\n\rsubtypesTable\030\005 \001(" + - "\0132\037.OsmAnd.OBF.OsmAndSubtypesTable\022\'\n\005bo" + - "xes\030\006 \003(\0132\030.OsmAnd.OBF.OsmAndPoiBox\022-\n\007p" + - "oiData\030\t \003(\0132\034.OsmAnd.OBF.OsmAndPoiBoxDa" + - "ta\"\331\001\n\022OsmAndPoiNameIndex\022-\n\005table\030\003 \002(\013", - "2\036.OsmAnd.OBF.IndexedStringTable\022C\n\004data" + - "\030\005 \003(\01325.OsmAnd.OBF.OsmAndPoiNameIndex.O" + - "smAndPoiNameIndexData\032O\n\026OsmAndPoiNameIn" + - "dexData\0225\n\005atoms\030\003 \003(\0132&.OsmAnd.OBF.OsmA" + - "ndPoiNameIndexDataAtom\"Q\n\032OsmAndPoiNameI" + - "ndexDataAtom\022\014\n\004zoom\030\002 \001(\r\022\t\n\001x\030\003 \001(\r\022\t\n" + - "\001y\030\004 \001(\r\022\017\n\007shiftTo\030\016 \001(\007\">\n\023OsmAndCateg" + - "oryTable\022\020\n\010category\030\001 \002(\t\022\025\n\rsubcategor" + - "ies\030\003 \003(\t\"E\n\023OsmAndSubtypesTable\022.\n\010subt" + - "ypes\030\004 \003(\0132\034.OsmAnd.OBF.OsmAndPoiSubtype", - "\"\205\001\n\020OsmAndPoiSubtype\022\014\n\004name\030\001 \002(\t\022\017\n\007t" + - "agname\030\002 \001(\t\022\016\n\006isText\030\003 \002(\010\022\021\n\tfrequenc" + - "y\030\005 \001(\r\022\031\n\021subtypeValuesSize\030\006 \001(\r\022\024\n\014su" + - "btypeValue\030\010 \003(\t\"\255\001\n\014OsmAndPoiBox\022\014\n\004zoo" + - "m\030\001 \002(\r\022\014\n\004left\030\002 \002(\021\022\013\n\003top\030\003 \002(\021\0223\n\nca" + - "tegories\030\004 \001(\0132\037.OsmAnd.OBF.OsmAndPoiCat" + - "egories\022*\n\010subBoxes\030\n \003(\0132\030.OsmAnd.OBF.O" + - "smAndPoiBox\022\023\n\013shiftToData\030\016 \001(\007\"@\n\023OsmA" + - "ndPoiCategories\022\022\n\ncategories\030\003 \003(\r\022\025\n\rs" + - "ubcategories\030\005 \003(\r\"i\n\020OsmAndPoiBoxData\022\014", - "\n\004zoom\030\001 \001(\r\022\t\n\001x\030\002 \001(\r\022\t\n\001y\030\003 \001(\r\0221\n\007po" + - "iData\030\005 \003(\0132 .OsmAnd.OBF.OsmAndPoiBoxDat" + - "aAtom\"\360\001\n\024OsmAndPoiBoxDataAtom\022\n\n\002dx\030\002 \002" + - "(\021\022\n\n\002dy\030\003 \002(\021\022\022\n\ncategories\030\004 \003(\r\022\025\n\rsu" + - "bcategories\030\005 \003(\r\022\014\n\004name\030\006 \001(\t\022\016\n\006nameE" + - "n\030\007 \001(\t\022\n\n\002id\030\010 \001(\004\022\024\n\014openingHours\030\n \001(" + - "\t\022\014\n\004site\030\013 \001(\t\022\r\n\005phone\030\014 \001(\t\022\014\n\004note\030\r" + - " \001(\t\022\026\n\016textCategories\030\016 \003(\r\022\022\n\ntextValu" + - "es\030\017 \003(\t\"\032\n\007IdTable\022\017\n\007routeId\030\001 \003(\022\"F\n\017" + - "RestrictionData\022\014\n\004type\030\001 \002(\005\022\014\n\004from\030\002 ", - "\002(\005\022\n\n\002to\030\003 \002(\005\022\013\n\003via\030\004 \001(\005\"x\n\tRouteDat" + - "a\022\016\n\006points\030\001 \002(\014\022\022\n\npointTypes\030\004 \001(\014\022\022\n" + - "\npointNames\030\005 \001(\014\022\r\n\005types\030\007 \002(\014\022\017\n\007rout" + - "eId\030\014 \002(\005\022\023\n\013stringNames\030\016 \001(\014\"\304\005\n\022OsmAn" + - "dRoutingIndex\022\014\n\004name\030\001 \002(\t\022?\n\005rules\030\002 \003" + - "(\01320.OsmAnd.OBF.OsmAndRoutingIndex.Route" + - "EncodingRule\022>\n\trootBoxes\030\003 \003(\0132+.OsmAnd" + - ".OBF.OsmAndRoutingIndex.RouteDataBox\022A\n\014" + - "basemapBoxes\030\004 \003(\0132+.OsmAnd.OBF.OsmAndRo" + - "utingIndex.RouteDataBox\022=\n\006blocks\030\005 \003(\0132", - "-.OsmAnd.OBF.OsmAndRoutingIndex.RouteDat" + - "aBlock\032;\n\021RouteEncodingRule\022\013\n\003tag\030\003 \002(\t" + - "\022\r\n\005value\030\005 \002(\t\022\n\n\002id\030\007 \001(\r\032\231\001\n\014RouteDat" + - "aBox\022\014\n\004left\030\001 \002(\021\022\r\n\005right\030\002 \002(\021\022\013\n\003top" + - "\030\003 \002(\021\022\016\n\006bottom\030\004 \002(\021\022\023\n\013shiftToData\030\005 " + - "\001(\007\022:\n\005boxes\030\007 \003(\0132+.OsmAnd.OBF.OsmAndRo" + - "utingIndex.RouteDataBox\032\303\001\n\016RouteDataBlo" + - "ck\022$\n\007idTable\030\005 \001(\0132\023.OsmAnd.OBF.IdTable" + - "\022*\n\013dataObjects\030\006 \003(\0132\025.OsmAnd.OBF.Route" + - "Data\0221\n\014restrictions\030\007 \003(\0132\033.OsmAnd.OBF.", - "RestrictionData\022,\n\013stringTable\030\010 \001(\0132\027.O" + - "smAnd.OBF.StringTableB\036\n\021net.osmand.bina" + - "ryB\tOsmandOdb" + "\022\030\n\020labelcoordinates\030\010 \001(\014\022\023\n\013stringName" + + "s\030\n \001(\014\022\n\n\002id\030\014 \002(\022\022\023\n\013rasterBytes\030\017 \001(\014" + + "\"\364\003\n\022OsmAndAddressIndex\022\014\n\004name\030\001 \002(\t\022\017\n" + + "\007name_en\030\002 \001(\t\022-\n\nboundaries\030\003 \001(\0132\031.Osm", + "And.OBF.OsmAndTileBox\0223\n\022attributeTagsTa" + + "ble\030\004 \001(\0132\027.OsmAnd.OBF.StringTable\022:\n\006ci" + + "ties\030\006 \003(\0132*.OsmAnd.OBF.OsmAndAddressInd" + + "ex.CitiesIndex\0229\n\tnameIndex\030\007 \001(\0132&.OsmA" + + "nd.OBF.OsmAndAddressNameIndexData\032\343\001\n\013Ci" + + "tiesIndex\022C\n\004type\030\002 \002(\01625.OsmAnd.OBF.Osm" + + "AndAddressIndex.CitiesIndex.CitiesType\022%" + + "\n\006cities\030\005 \003(\0132\025.OsmAnd.OBF.CityIndex\022*\n" + + "\006blocks\030\007 \003(\0132\032.OsmAnd.OBF.CityBlockInde" + + "x\"<\n\nCitiesType\022\021\n\rCitiesOrTowns\020\001\022\r\n\tPo", + "stcodes\020\002\022\014\n\010Villages\020\003\"\342\001\n\032OsmAndAddres" + + "sNameIndexData\022-\n\005table\030\004 \002(\0132\036.OsmAnd.O" + + "BF.IndexedStringTable\022I\n\004atom\030\007 \003(\0132;.Os" + + "mAnd.OBF.OsmAndAddressNameIndexData.Addr" + + "essNameIndexData\032J\n\024AddressNameIndexData" + + "\0222\n\004atom\030\004 \003(\0132$.OsmAnd.OBF.AddressNameI" + + "ndexDataAtom\"\204\001\n\030AddressNameIndexDataAto" + + "m\022\014\n\004name\030\001 \001(\t\022\016\n\006nameEn\030\002 \001(\t\022\014\n\004type\030" + + "\003 \002(\r\022\024\n\014shiftToIndex\030\005 \003(\005\022\030\n\020shiftToCi" + + "tyIndex\030\006 \003(\005\022\014\n\004xy16\030\007 \003(\r\"\260\001\n\tCityInde", + "x\022\021\n\tcity_type\030\001 \001(\r\022\014\n\004name\030\002 \002(\t\022\017\n\007na" + + "me_en\030\003 \001(\t\022\n\n\002id\030\004 \001(\004\022\t\n\001x\030\005 \002(\r\022\t\n\001y\030" + + "\006 \002(\r\022\027\n\017attributeTagIds\030\007 \003(\r\022\027\n\017attrib" + + "uteValues\030\010 \003(\t\022\035\n\025shiftToCityBlockIndex" + + "\030\n \001(\007\"\202\001\n\016CityBlockIndex\022\030\n\020shiftToCity" + + "Index\030\004 \001(\007\022,\n\tbuildings\030\n \003(\0132\031.OsmAnd." + + "OBF.BuildingIndex\022(\n\007streets\030\014 \003(\0132\027.Osm" + + "And.OBF.StreetIndex\"\345\001\n\013StreetIndex\022\014\n\004n" + + "ame\030\001 \002(\t\022\017\n\007name_en\030\002 \001(\t\022\t\n\001x\030\003 \002(\021\022\t\n" + + "\001y\030\004 \002(\021\0225\n\rintersections\030\005 \003(\0132\036.OsmAnd", + ".OBF.StreetIntersection\022\n\n\002id\030\006 \001(\004\022\027\n\017a" + + "ttributeTagIds\030\007 \003(\r\022\027\n\017attributeValues\030" + + "\010 \003(\t\022,\n\tbuildings\030\014 \003(\0132\031.OsmAnd.OBF.Bu" + + "ildingIndex\"\221\001\n\022StreetIntersection\022\014\n\004na" + + "me\030\002 \002(\t\022\017\n\007name_en\030\003 \001(\t\022\024\n\014intersected" + + "X\030\004 \002(\021\022\024\n\014intersectedY\030\005 \002(\021\022\027\n\017attribu" + + "teTagIds\030\007 \003(\r\022\027\n\017attributeValues\030\010 \003(\t\"" + + "\230\002\n\rBuildingIndex\022\014\n\004name\030\001 \002(\t\022\017\n\007name_" + + "en\030\002 \001(\t\022\r\n\005name2\030\003 \001(\t\022\020\n\010name_en2\030\004 \001(" + + "\t\022\025\n\rinterpolation\030\005 \001(\021\022\t\n\001x\030\007 \002(\021\022\t\n\001y", + "\030\010 \002(\021\022\n\n\002x2\030\t \001(\021\022\n\n\002y2\030\n \001(\021\022\n\n\002id\030\r \001" + + "(\004\022\020\n\010postcode\030\016 \001(\t\022\027\n\017attributeTagIds\030" + + "\017 \003(\r\022\027\n\017attributeValues\030\020 \003(\t\022\030\n\020attrib" + + "uteTagIds2\030\021 \003(\r\022\030\n\020attributeValues2\030\022 \003" + + "(\t\"=\n\017TransportRoutes\022*\n\006routes\030\006 \003(\0132\032." + + "OsmAnd.OBF.TransportRoute\"\300\002\n\016TransportR" + + "oute\022\n\n\002id\030\001 \002(\004\022\014\n\004type\030\003 \001(\r\022\020\n\010operat" + + "or\030\004 \001(\r\022\013\n\003ref\030\005 \001(\t\022\014\n\004name\030\006 \001(\r\022\017\n\007n" + + "ame_en\030\007 \001(\r\022\020\n\010distance\030\010 \001(\r\022\r\n\005color\030" + + "\t \001(\r\0223\n\013directStops\030\017 \003(\0132\036.OsmAnd.OBF.", + "TransportRouteStop\0224\n\014reverseStops\030\020 \003(\013" + + "2\036.OsmAnd.OBF.TransportRouteStop\022\020\n\010geom" + + "etry\030\021 \001(\014\0228\n\014scheduleTrip\030\022 \003(\0132\".OsmAn" + + "d.OBF.TransportRouteSchedule\"\244\001\n\026Transpo" + + "rtRouteSchedule\022\030\n\020avgStopIntervals\030\001 \001(" + + "\014\022\030\n\020avgWaitIntervals\030\002 \001(\014\022\025\n\rtripInter" + + "vals\030\003 \001(\014\022?\n\nexceptions\030\010 \003(\0132+.OsmAnd." + + "OBF.TransportRouteScheduleException\"\313\001\n\037" + + "TransportRouteScheduleException\022\023\n\013tripI" + + "ndexes\030\001 \003(\r\022\023\n\013stopIndexes\030\002 \003(\r\022\021\n\tava", + "ilable\030\003 \001(\010\022\024\n\014delayArrival\030\005 \003(\r\022\031\n\021de" + + "ltaWaitInterval\030\006 \003(\005\022\034\n\024dayOfWeekRestri" + + "ction\030\007 \003(\r\022\034\n\024dayOfYearRestriction\030\010 \003(" + + "\r\"W\n\022TransportRouteStop\022\n\n\002id\030\001 \002(\022\022\n\n\002d" + + "x\030\002 \002(\021\022\n\n\002dy\030\003 \002(\021\022\014\n\004name\030\006 \002(\r\022\017\n\007nam" + + "e_en\030\007 \001(\r\"\332\001\n\rTransportStop\022\n\n\002dx\030\001 \002(\021" + + "\022\n\n\002dy\030\002 \002(\021\022\n\n\002id\030\005 \002(\022\022\014\n\004name\030\006 \002(\r\022\017" + + "\n\007name_en\030\007 \001(\r\022\033\n\023additionalNamePairs\030\010" + + " \001(\014\022,\n\005exits\030\t \003(\0132\035.OsmAnd.OBF.Transpo" + + "rtStopExit\022\016\n\006routes\030\020 \003(\r\022\030\n\020deletedRou", + "tesIds\030\024 \003(\004\022\021\n\troutesIds\030\026 \003(\004\"8\n\021Trans" + + "portStopExit\022\n\n\002dx\030\001 \002(\021\022\n\n\002dy\030\002 \002(\021\022\013\n\003" + + "ref\030\003 \002(\r\"\272\001\n\022TransportStopsTree\022\014\n\004left" + + "\030\001 \002(\021\022\r\n\005right\030\002 \002(\021\022\013\n\003top\030\003 \002(\021\022\016\n\006bo" + + "ttom\030\004 \002(\021\0220\n\010subtrees\030\007 \003(\0132\036.OsmAnd.OB" + + "F.TransportStopsTree\022(\n\005leafs\030\010 \003(\0132\031.Os" + + "mAnd.OBF.TransportStop\022\016\n\006baseId\030\020 \001(\004\"\256" + + "\001\n\024OsmAndTransportIndex\022\014\n\004name\030\001 \001(\t\022+\n" + + "\006routes\030\003 \001(\0132\033.OsmAnd.OBF.TransportRout" + + "es\022-\n\005stops\030\006 \001(\0132\036.OsmAnd.OBF.Transport", + "StopsTree\022,\n\013stringTable\030\t \002(\0132\027.OsmAnd." + + "OBF.StringTable\"\312\002\n\016OsmAndPoiIndex\022\014\n\004na" + + "me\030\001 \002(\t\022-\n\nboundaries\030\002 \002(\0132\031.OsmAnd.OB" + + "F.OsmAndTileBox\0228\n\017categoriesTable\030\003 \003(\013" + + "2\037.OsmAnd.OBF.OsmAndCategoryTable\0221\n\tnam" + + "eIndex\030\004 \001(\0132\036.OsmAnd.OBF.OsmAndPoiNameI" + + "ndex\0226\n\rsubtypesTable\030\005 \001(\0132\037.OsmAnd.OBF" + + ".OsmAndSubtypesTable\022\'\n\005boxes\030\006 \003(\0132\030.Os" + + "mAnd.OBF.OsmAndPoiBox\022-\n\007poiData\030\t \003(\0132\034" + + ".OsmAnd.OBF.OsmAndPoiBoxData\"\331\001\n\022OsmAndP", + "oiNameIndex\022-\n\005table\030\003 \002(\0132\036.OsmAnd.OBF." + + "IndexedStringTable\022C\n\004data\030\005 \003(\01325.OsmAn" + + "d.OBF.OsmAndPoiNameIndex.OsmAndPoiNameIn" + + "dexData\032O\n\026OsmAndPoiNameIndexData\0225\n\005ato" + + "ms\030\003 \003(\0132&.OsmAnd.OBF.OsmAndPoiNameIndex" + + "DataAtom\"Q\n\032OsmAndPoiNameIndexDataAtom\022\014" + + "\n\004zoom\030\002 \001(\r\022\t\n\001x\030\003 \001(\r\022\t\n\001y\030\004 \001(\r\022\017\n\007sh" + + "iftTo\030\016 \001(\007\">\n\023OsmAndCategoryTable\022\020\n\010ca" + + "tegory\030\001 \002(\t\022\025\n\rsubcategories\030\003 \003(\t\"E\n\023O" + + "smAndSubtypesTable\022.\n\010subtypes\030\004 \003(\0132\034.O", + "smAnd.OBF.OsmAndPoiSubtype\"\205\001\n\020OsmAndPoi" + + "Subtype\022\014\n\004name\030\001 \002(\t\022\017\n\007tagname\030\002 \001(\t\022\016" + + "\n\006isText\030\003 \002(\010\022\021\n\tfrequency\030\005 \001(\r\022\031\n\021sub" + + "typeValuesSize\030\006 \001(\r\022\024\n\014subtypeValue\030\010 \003" + + "(\t\"\255\001\n\014OsmAndPoiBox\022\014\n\004zoom\030\001 \002(\r\022\014\n\004lef" + + "t\030\002 \002(\021\022\013\n\003top\030\003 \002(\021\0223\n\ncategories\030\004 \001(\013" + + "2\037.OsmAnd.OBF.OsmAndPoiCategories\022*\n\010sub" + + "Boxes\030\n \003(\0132\030.OsmAnd.OBF.OsmAndPoiBox\022\023\n" + + "\013shiftToData\030\016 \001(\007\"@\n\023OsmAndPoiCategorie" + + "s\022\022\n\ncategories\030\003 \003(\r\022\025\n\rsubcategories\030\005", + " \003(\r\"i\n\020OsmAndPoiBoxData\022\014\n\004zoom\030\001 \001(\r\022\t" + + "\n\001x\030\002 \001(\r\022\t\n\001y\030\003 \001(\r\0221\n\007poiData\030\005 \003(\0132 ." + + "OsmAnd.OBF.OsmAndPoiBoxDataAtom\"\360\001\n\024OsmA" + + "ndPoiBoxDataAtom\022\n\n\002dx\030\002 \002(\021\022\n\n\002dy\030\003 \002(\021" + + "\022\022\n\ncategories\030\004 \003(\r\022\025\n\rsubcategories\030\005 " + + "\003(\r\022\014\n\004name\030\006 \001(\t\022\016\n\006nameEn\030\007 \001(\t\022\n\n\002id\030" + + "\010 \001(\004\022\024\n\014openingHours\030\n \001(\t\022\014\n\004site\030\013 \001(" + + "\t\022\r\n\005phone\030\014 \001(\t\022\014\n\004note\030\r \001(\t\022\026\n\016textCa" + + "tegories\030\016 \003(\r\022\022\n\ntextValues\030\017 \003(\t\"\032\n\007Id" + + "Table\022\017\n\007routeId\030\001 \003(\022\"F\n\017RestrictionDat", + "a\022\014\n\004type\030\001 \002(\005\022\014\n\004from\030\002 \002(\005\022\n\n\002to\030\003 \002(" + + "\005\022\013\n\003via\030\004 \001(\005\"x\n\tRouteData\022\016\n\006points\030\001 " + + "\002(\014\022\022\n\npointTypes\030\004 \001(\014\022\022\n\npointNames\030\005 " + + "\001(\014\022\r\n\005types\030\007 \002(\014\022\017\n\007routeId\030\014 \002(\005\022\023\n\013s" + + "tringNames\030\016 \001(\014\"\304\005\n\022OsmAndRoutingIndex\022" + + "\014\n\004name\030\001 \002(\t\022?\n\005rules\030\002 \003(\01320.OsmAnd.OB" + + "F.OsmAndRoutingIndex.RouteEncodingRule\022>" + + "\n\trootBoxes\030\003 \003(\0132+.OsmAnd.OBF.OsmAndRou" + + "tingIndex.RouteDataBox\022A\n\014basemapBoxes\030\004" + + " \003(\0132+.OsmAnd.OBF.OsmAndRoutingIndex.Rou", + "teDataBox\022=\n\006blocks\030\005 \003(\0132-.OsmAnd.OBF.O" + + "smAndRoutingIndex.RouteDataBlock\032;\n\021Rout" + + "eEncodingRule\022\013\n\003tag\030\003 \002(\t\022\r\n\005value\030\005 \002(" + + "\t\022\n\n\002id\030\007 \001(\r\032\231\001\n\014RouteDataBox\022\014\n\004left\030\001" + + " \002(\021\022\r\n\005right\030\002 \002(\021\022\013\n\003top\030\003 \002(\021\022\016\n\006bott" + + "om\030\004 \002(\021\022\023\n\013shiftToData\030\005 \001(\007\022:\n\005boxes\030\007" + + " \003(\0132+.OsmAnd.OBF.OsmAndRoutingIndex.Rou" + + "teDataBox\032\303\001\n\016RouteDataBlock\022$\n\007idTable\030" + + "\005 \001(\0132\023.OsmAnd.OBF.IdTable\022*\n\013dataObject" + + "s\030\006 \003(\0132\025.OsmAnd.OBF.RouteData\0221\n\014restri", + "ctions\030\007 \003(\0132\033.OsmAnd.OBF.RestrictionDat" + + "a\022,\n\013stringTable\030\010 \001(\0132\027.OsmAnd.OBF.Stri" + + "ngTableB\036\n\021net.osmand.binaryB\tOsmandOdb" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -62969,7 +63124,7 @@ public final class OsmandOdb { internal_static_OsmAnd_OBF_MapData_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_OsmAnd_OBF_MapData_descriptor, - new java.lang.String[] { "Coordinates", "AreaCoordinates", "PolygonInnerCoordinates", "AdditionalTypes", "Types", "StringNames", "Id", "RasterBytes", }); + new java.lang.String[] { "Coordinates", "AreaCoordinates", "PolygonInnerCoordinates", "AdditionalTypes", "Types", "Labelcoordinates", "StringNames", "Id", "RasterBytes", }); internal_static_OsmAnd_OBF_OsmAndAddressIndex_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_OsmAnd_OBF_OsmAndAddressIndex_fieldAccessorTable = new From ad3b93c2abad448f28f5401bf7f3727908ce95cc Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 27 Jan 2020 17:29:04 +0100 Subject: [PATCH 11/45] Fix #8298 for new Android N devices --- .../osmand/plus/OsmAndLocationProvider.java | 76 +++++++++++++++---- 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java index 2a039f3bbf..d3ab9bff5a 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java @@ -1,5 +1,7 @@ package net.osmand.plus; +import android.location.GnssNavigationMessage; +import android.location.GnssStatus; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import java.util.ArrayList; @@ -17,7 +19,6 @@ import net.osmand.binary.GeocodingUtilities.GeocodingResult; import net.osmand.binary.RouteDataObject; import net.osmand.data.LatLon; import net.osmand.data.QuadPoint; -import net.osmand.plus.OsmandSettings.OsmandPreference; import net.osmand.plus.TargetPointsHelper.TargetPoint; import net.osmand.plus.routing.RoutingHelper; import net.osmand.router.RouteSegmentResult; @@ -127,7 +128,7 @@ public class OsmAndLocationProvider implements SensorEventListener { private List locationListeners = new ArrayList(); private List compassListeners = new ArrayList(); - private Listener gpsStatusListener; + private Object gpsStatusListener; private float[] mRotationM = new float[9]; @@ -249,7 +250,7 @@ public class OsmAndLocationProvider implements SensorEventListener { } } if (isLocationPermissionAvailable(app)) { - service.addGpsStatusListener(getGpsStatusListener(service)); + registerGpsStatusListener(service); try { service.requestLocationUpdates(LocationManager.GPS_PROVIDER, GPS_TIMEOUT_REQUEST, GPS_DIST_REQUEST, gpsListener); } catch (IllegalArgumentException e) { @@ -291,17 +292,56 @@ public class OsmAndLocationProvider implements SensorEventListener { } } - private Listener getGpsStatusListener(final LocationManager service) { - gpsStatusListener = new Listener() { - private GpsStatus gpsStatus; - @Override - public void onGpsStatusChanged(int event) { - gpsStatus = service.getGpsStatus(gpsStatus); - updateGPSInfo(gpsStatus); - updateLocation(location); - } - }; - return gpsStatusListener; + private void registerGpsStatusListener(final LocationManager service) { + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + gpsStatusListener = new GnssStatus.Callback() { + + @Override + public void onStarted() { + } + + @Override + public void onStopped() { + } + + @Override + public void onFirstFix(int ttffMillis) { + } + + @Override + public void onSatelliteStatusChanged(GnssStatus status) { + int satCount = 0; + boolean fixed = false; + int u = 0; + if(status != null) { + satCount = status.getSatelliteCount(); + for (int i = 0; i < satCount; i++) { + if (status.usedInFix(i)) { + u++; + fixed = true; + } + } + } + gpsInfo.fixed = fixed; + gpsInfo.foundSatellites = satCount; + gpsInfo.usedSatellites = u; + updateLocation(location); + } + }; + service.registerGnssStatusCallback((GnssStatus.Callback) gpsStatusListener); + service.registerGnssNavigationMessageCallback((GnssNavigationMessage.Callback) gpsStatusListener); + } else { + gpsStatusListener = new Listener() { + private GpsStatus gpsStatus; + @Override + public void onGpsStatusChanged(int event) { + gpsStatus = service.getGpsStatus(gpsStatus); + updateGPSInfo(gpsStatus); + updateLocation(location); + } + }; + service.addGpsStatusListener((Listener) gpsStatusListener); + } } private void updateGPSInfo(GpsStatus s) { @@ -642,7 +682,13 @@ public class OsmAndLocationProvider implements SensorEventListener { private void stopLocationRequests() { LocationManager service = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); - service.removeGpsStatusListener(gpsStatusListener); + if(gpsStatusListener != null) { + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + service.unregisterGnssStatusCallback((GnssStatus.Callback) gpsStatusListener); + } else { + service.removeGpsStatusListener((Listener) gpsStatusListener); + } + } service.removeUpdates(gpsListener); while(!networkListeners.isEmpty()) { service.removeUpdates(networkListeners.poll()); From 384760addaeb63bf7d9da4f2ea5be5c4440f7f42 Mon Sep 17 00:00:00 2001 From: Franco Date: Mon, 27 Jan 2020 16:40:08 +0000 Subject: [PATCH 12/45] Translated using Weblate (Spanish (Argentina)) Currently translated at 97.1% (3063 of 3156 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 70057891d3..9b48719030 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -3466,4 +3466,6 @@ Lon %2$s El icono del mapa sólo se muestra en el mapa. Comprueba y comparte los registros detallados de la aplicación No se puede analizar la geointención «%s». + Se necesita permiso para usar esta opción. + Se trata de un filtro de corte de baja velocidad para no grabar puntos por debajo de una cierta velocidad. Esto puede hacer que las trazas grabadas se vean más suaves cuando se muestran en el mapa. \ No newline at end of file From e5392fc9d5a61e57e6dc16f4496b2b5279136db0 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Mon, 27 Jan 2020 06:39:53 +0000 Subject: [PATCH 13/45] Translated using Weblate (French) Currently translated at 99.5% (3139 of 3156 strings) --- OsmAnd/res/values-fr/strings.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 284a5e0e5e..886ead2782 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -1434,7 +1434,7 @@ Ces informations sont visibles sur le Tableau de bord comme sur la carte. Un rap Damage des pistes %1$s libre Mémoire de l\'appareil - Notes OSM + Notes audio / vidéo Carte en ligne Routes uniquement Pistes de ski @@ -3441,4 +3441,7 @@ représentant la zone : %1$s x %2$s Filtre interrompant l\'enregistrement en dessous d\'une certaines vitesse. Rend les traces enregistrées plus régulières lorsqu\'elles sont affichées sur la carte. Durée de la mémoire tampon Indiquez l\'adresse web avec la syntaxe suivante pour les paramètres : lat = {0}, lon = {1}, horodatage = {2}, hdop = {3}, altitude = {4}, vitesse = {5}, direction = {6}. + Recommandation : il est difficile de prédire ce qui sera enregistré et ce qui ne le sera pas, il peut être préférable de désactiver ce filtre. + Ce filtre limite l\'enregistrement de points en double lorsque les déplacements sont très lents donnant une apparence plus régulière aux traces. + Recommandation : un paramètre de 5 mètres est adapté si vous n\'avez pas besoin de détails et ne souhaitez pas enregistrer des points au repos. \ No newline at end of file From 7852cb384d7bbb30d1d336b6b08482749fa337ec Mon Sep 17 00:00:00 2001 From: Athoss Date: Mon, 27 Jan 2020 14:11:58 +0000 Subject: [PATCH 14/45] Translated using Weblate (Hungarian) Currently translated at 95.8% (3023 of 3156 strings) --- OsmAnd/res/values-hu/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 343cf85537..4d4af2ead0 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -2388,7 +2388,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük A–Z 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á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. Minden térképjelölő áthelyezve az előzményekbe Térképjelölő áthelyezve az előzményekhez From 5a18a0a349aab07657f7d9900084a287dece1e08 Mon Sep 17 00:00:00 2001 From: Tymofij Lytvynenko Date: Mon, 27 Jan 2020 11:10:37 +0000 Subject: [PATCH 15/45] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3156 of 3156 strings) --- OsmAnd/res/values-uk/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index edb345a414..73f50679b6 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -1380,7 +1380,7 @@ Відхилити Аудіо Поділитись нотаткою - OSM примітки + A/V примітки Мережева мапа Тільки дороги Вільно %1$s From 87ba97ffe685ee115ef5cd1c0a01972229118944 Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Mon, 27 Jan 2020 11:09:33 +0000 Subject: [PATCH 16/45] Translated using Weblate (Sardinian) Currently translated at 94.6% (2986 of 3156 strings) --- OsmAnd/res/values-sc/strings.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 105e112e12..1f71f3970e 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -3448,4 +3448,22 @@ Pro praghere iscrie su còdighe intreu As a bìdere s\'icona petzi durante sa navigatzione o su movimentu. S\'icona de sa mapa aparit in sa mapa ebbia, e divenit s\'icona de navigatzione durante sa navigatzione. Inoghe podes pompiare e cumpartzire sos registros de s\'aplicatzione + Anàlisi de su geo intent \'%s\' fallida. + Pro impreare custa optzione b\'at bisòngiu de unu permissu. + Custu est unu filtru pro non registrare puntos in suta de una lestresa isseberada. Faghet in modu chi sas rastas registradas pàrgiant prus regulares cando benint pompiadas in sa mapa. + Efetu segundàriu: in sa rasta tua ant a mancare totu sas setziones in ue no as rispetadu su critèriu de sa lestresa mìnima (es. cando ispinghes sa bitzicleta tua cara a artu in unu montigru). Annotamala, non b\'ant a èssere informatziones a pitzu de sos perìodos de pasu, che a sas pàusas. Custu at a influentzare totu sas anàlisis o sos post-protzessamentos, a es. cando ses chirchende de determinare sa longària totale de su biàgiu tuo, su tempus in movimentu, o sa lestresa mèdia tua. + Intervallu de arrastamentu + Indiritzu web + Dislinda s\'indiritzu web cun sa sintassi de paràmetros: lat={0}, lon={1}, marcadesutempus={2}, hdop={3}, artària={4}, lestresa={5}, diretzione={6}. + Notìfica + Lestresa mìnima + Acuradesa mìnima + Movimentu mìnimu + Menù — Logos meos — Rastas + Menù — Logos meos — Notas + Menù — Logos meos — Modìficas de OSM + Riprìstina sas impostatziones predefinidas de s\'estensione + Imprea s\'aplicatzione de sistema + Sonu de s\'oturadore de sa fotocàmera + S\'autorizatzione est resèssida \ No newline at end of file From 757314c56bd1dee3f7de254d48a96320a5cab450 Mon Sep 17 00:00:00 2001 From: IgorEliezer Date: Mon, 27 Jan 2020 06:25:52 +0000 Subject: [PATCH 17/45] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3156 of 3156 strings) --- OsmAnd/res/values-pt-rBR/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 07a39b8133..4da7fd57cc 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -344,7 +344,7 @@ Copiando arquivos de dados… "Calcular rota off-line " Caminhão - Visão intermediária + Para nível intermediário Zoom mínimo: %1$s A fonte da quadrícula %1$s foi salva Moderadores de tráfego @@ -537,8 +537,8 @@ "Simular usando a rota calculada " Simular usando trilha GPX Sem zoom automático - Aproximar - Afastar + Para nível aproximado + Para nível afastado Lupa Mapa base mundial Versão: From 0ddaa696b81d76abd73120bac43355dc2184b4c5 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Mon, 27 Jan 2020 11:15:33 +0000 Subject: [PATCH 18/45] Translated using Weblate (Esperanto) Currently translated at 94.9% (2994 of 3156 strings) --- OsmAnd/res/values-eo/strings.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index 1a762b81f2..de0128e61b 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -3401,8 +3401,8 @@ Indikas lokon: %1$s x %2$s" Ĉu rekomencigi ĉiujn agordojn pri profiloj\? %1$s: %2$s %1$s %2$s - La dosiero “%1$s” ne enhavas regulojn pri kurs‑difinado, bonvolu elekti alian dosieron. - Nesubtenata tipo de dosiero. Elektu dosieron kun la finaĵo %1$s. + Neniuj reguloj pri kurs‑difinado en “%1$s”. Bonvolu elekti alian dosieron. + Bonvolu elekti dosieron kun la subtenata finaĵo %1$s. Enporti el dosiero Enporti dosieron de kurs‑difinado Enporti profilon @@ -3427,5 +3427,7 @@ Indikas lokon: %1$s x %2$s" OSM La emblemo montriĝos nur dum navigi aŭ dum moviĝi. Map‑emblemo montriĝas nur dum foliumi mapon kaj ŝanĝiĝas dum navigi al la emblemo de navigo. - Tie ĉi vi povas legi kaj kunhavigi protokolojn de la aplikaĵo + Legi kaj kunhavigi detalajn protokolojn de la aplikaĵo + Permeso estas necesa por uzi tiun ĉi eblaĵon. + Tiu ĉi filtrilo preventas registri punktojn sub difinita rapidlimo. Tiel registritaj spuroj aspektos pli glate dum vidiĝi sur la mapo. \ No newline at end of file From e5dcabdeaf663da9eae50a193aeba045a92dc00e Mon Sep 17 00:00:00 2001 From: xmd5a Date: Mon, 27 Jan 2020 22:05:49 +0300 Subject: [PATCH 19/45] Add phrase --- OsmAnd/res/values/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 2685d47466..26e6050c65 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4179,4 +4179,6 @@ Ghost bike + Paintball + From bb8f68f2353a4213dfa0f805210d01982d6fd6c8 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Mon, 27 Jan 2020 21:29:52 +0200 Subject: [PATCH 20/45] Bigger favorites ui icon --- OsmAnd/res/layout/favorites_list_item.xml | 33 +++++++++++-------- OsmAnd/res/layout/menu_obj_list_item.xml | 4 +-- .../MapContextMenuFragment.java | 2 +- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/OsmAnd/res/layout/favorites_list_item.xml b/OsmAnd/res/layout/favorites_list_item.xml index 202c4cc6c5..7b3588f435 100644 --- a/OsmAnd/res/layout/favorites_list_item.xml +++ b/OsmAnd/res/layout/favorites_list_item.xml @@ -30,22 +30,27 @@ android:orientation="horizontal" android:paddingLeft="@dimen/list_content_padding"> - + android:layout_height="match_parent"> - + + + + diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 2443f517a6..5094421d85 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -1281,7 +1281,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo Drawable icon = menu.getRightIcon(); int iconId = menu.getRightIconId(); - int sizeId = menu.isBigRightIcon() ? R.dimen.context_menu_big_icon_size : R.dimen.map_widget_icon; + int sizeId = menu.isBigRightIcon() ? R.dimen.context_menu_big_icon_size : R.dimen.dialog_button_height; int iconViewSize = getResources().getDimensionPixelSize(sizeId); ViewGroup.LayoutParams params = iconView.getLayoutParams(); params.width = iconViewSize; From 889c15a64a2b1fbc1f10396290106b6d22c279bb Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 28 Jan 2020 11:04:28 +0100 Subject: [PATCH 21/45] Fix #8337 --- OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java index d3ab9bff5a..acabdba2db 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java @@ -329,7 +329,6 @@ public class OsmAndLocationProvider implements SensorEventListener { } }; service.registerGnssStatusCallback((GnssStatus.Callback) gpsStatusListener); - service.registerGnssNavigationMessageCallback((GnssNavigationMessage.Callback) gpsStatusListener); } else { gpsStatusListener = new Listener() { private GpsStatus gpsStatus; From f5cc13eeb88d2b69cb0061bd8a0c5e8b668230b0 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Tue, 28 Jan 2020 15:09:02 +0200 Subject: [PATCH 22/45] Fix create new favorite --- OsmAnd/src/net/osmand/data/FavouritePoint.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/data/FavouritePoint.java b/OsmAnd/src/net/osmand/data/FavouritePoint.java index 2af499a8c6..4d70bd663b 100644 --- a/OsmAnd/src/net/osmand/data/FavouritePoint.java +++ b/OsmAnd/src/net/osmand/data/FavouritePoint.java @@ -3,7 +3,6 @@ package net.osmand.data; import java.io.Serializable; import android.content.Context; -import android.content.res.Resources; import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; import android.support.annotation.StringRes; @@ -19,7 +18,6 @@ public class FavouritePoint implements Serializable, LocationPoint { private static final String HIDDEN = "hidden"; private static final String ADDRESS_EXTENSION = "address"; - private static final String DEFAULT_ICON_NAME = "special_star"; protected String name = ""; protected String description; @@ -139,6 +137,8 @@ public class FavouritePoint implements Serializable, LocationPoint { public int getOverlayIconId() { if (isSpecialPoint()) { return specialPointType.getIconId(); + } else if (iconId == 0) { + return R.drawable.mx_special_star; } return iconId; } @@ -202,7 +202,6 @@ public class FavouritePoint implements Serializable, LocationPoint { return "Favourite " + getName(); //$NON-NLS-1$ } - @Override public boolean equals(Object o) { if (this == o) return true; @@ -253,7 +252,6 @@ public class FavouritePoint implements Serializable, LocationPoint { return result; } - public enum SpecialPointType { HOME("home", R.string.home_button, R.drawable.mx_special_house), WORK("work", R.string.work_button, R.drawable.mx_special_building), @@ -286,7 +284,6 @@ public class FavouritePoint implements Serializable, LocationPoint { } } - public static FavouritePoint fromWpt(@NonNull WptPt pt, @NonNull Context ctx) { String name = pt.name; String categoryName = pt.category != null ? pt.category : ""; From f65331d84e84ee421f8eef5a696d03ec30e3392c Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Tue, 28 Jan 2020 16:55:43 +0200 Subject: [PATCH 23/45] polygon label work in progress --- .../osmand/binary/BinaryMapDataObject.java | 20 ++++++++++++++++++- .../osmand/binary/BinaryMapIndexReader.java | 3 ++- .../java/net/osmand/osm/edit/OsmMapUtils.java | 3 +-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java index 5e18b1ee96..c3797a5017 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java @@ -19,6 +19,7 @@ public class BinaryMapDataObject { protected int[] types = null; protected int[] additionalTypes = null; protected int objectType = RenderingRulesStorage.POINT_RULES; + protected int[] labelCoordinates = null; protected TIntObjectHashMap objectNames = null; protected TIntArrayList namesOrder = null; @@ -33,7 +34,7 @@ public class BinaryMapDataObject { public BinaryMapDataObject(long id, int[] coordinates, int[][] polygonInnerCoordinates, int objectType, boolean area, - int[] types, int[] additionalTypes){ + int[] types, int[] additionalTypes, int[] labelCoordinates){ this.polygonInnerCoordinates = polygonInnerCoordinates; this.coordinates = coordinates; this.additionalTypes = additionalTypes; @@ -41,6 +42,7 @@ public class BinaryMapDataObject { this.id = id; this.objectType = objectType; this.area = area; + this.labelCoordinates = labelCoordinates; } protected void setCoordinates(int[] coordinates) { @@ -282,6 +284,18 @@ public class BinaryMapDataObject { } } + //do we need it? use precision? + if (equals) { + if (labelCoordinates == null || thatObj.labelCoordinates == null) { + equals = labelCoordinates == thatObj.labelCoordinates; + //do we need it? precision? +// } else { +// for(int i = 0; i < labelCoordinates.length && equals; i++) { +// equals = labelCoordinates[i] == thatObj.labelCoordinates[i]; +// } + } + } + return equals; } // thatObj.mapIndex.decodeType(thatObj.types[0]) @@ -367,4 +381,8 @@ public class BinaryMapDataObject { public int getObjectType() { return objectType; } + + public int[] getLabelCoordinates() { + return labelCoordinates; + } } 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 69841ad906..5da9e92aa9 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -1917,7 +1917,8 @@ public class BinaryMapIndexReader { BinaryMapDataObject bm = new BinaryMapDataObject(o.id, o.coordinates, o.polygonInnerCoordinates, o.objectType, o.area, - types.toArray(), additionalTypes.isEmpty() ? null : additionalTypes.toArray()); + types.toArray(), additionalTypes.isEmpty() ? null : additionalTypes.toArray(), + o.labelCoordinates); if (o.namesOrder != null) { bm.objectNames = new TIntObjectHashMap<>(); bm.namesOrder = new TIntArrayList(); diff --git a/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java b/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java index 3460774594..06a2f6a08e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java +++ b/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java @@ -50,7 +50,7 @@ public class OsmMapUtils { } public static LatLon getComplexPolyCenter(Collection nodes) { - double precision = 1e-4; //where to put constant? + double precision = 1e-4; //where to set precision constant? final List> rings = new ArrayList<>(); List outerRing = new ArrayList<>(); @@ -59,7 +59,6 @@ public class OsmMapUtils { } rings.add(outerRing); return getPolylabelPoint(rings, precision); - //return getPolylabelPoint(new Polygon(points), precision); } public static LatLon getWeightCenter(Collection nodes) { From 78edec22598f4567535709d757a2d0db41fce4d6 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Tue, 28 Jan 2020 18:29:53 +0200 Subject: [PATCH 24/45] Fix #7244 Configure Map: add sunset / sunrise time to Map Mode --- OsmAnd/res/values-ar/strings.xml | 2 +- OsmAnd/res/values-be/strings.xml | 2 +- OsmAnd/res/values-ca/strings.xml | 2 +- OsmAnd/res/values-da/strings.xml | 2 +- OsmAnd/res/values-de/strings.xml | 2 +- OsmAnd/res/values-el/strings.xml | 2 +- OsmAnd/res/values-eo/strings.xml | 2 +- OsmAnd/res/values-es-rAR/strings.xml | 2 +- OsmAnd/res/values-es-rUS/strings.xml | 2 +- OsmAnd/res/values-es/strings.xml | 2 +- OsmAnd/res/values-et/strings.xml | 2 +- OsmAnd/res/values-eu/strings.xml | 2 +- OsmAnd/res/values-fa/strings.xml | 2 +- OsmAnd/res/values-fr/strings.xml | 2 +- OsmAnd/res/values-gl/strings.xml | 2 +- OsmAnd/res/values-he/strings.xml | 2 +- OsmAnd/res/values-hu/strings.xml | 2 +- OsmAnd/res/values-is/strings.xml | 2 +- OsmAnd/res/values-it/strings.xml | 2 +- OsmAnd/res/values-ja/strings.xml | 2 +- OsmAnd/res/values-kn/strings.xml | 2 +- OsmAnd/res/values-nb/strings.xml | 2 +- OsmAnd/res/values-nl/strings.xml | 2 +- OsmAnd/res/values-pl/strings.xml | 2 +- OsmAnd/res/values-pt-rBR/strings.xml | 2 +- OsmAnd/res/values-pt/strings.xml | 2 +- OsmAnd/res/values-ro/strings.xml | 2 +- OsmAnd/res/values-ru/strings.xml | 2 +- OsmAnd/res/values-sc/strings.xml | 2 +- OsmAnd/res/values-sk/strings.xml | 2 +- OsmAnd/res/values-sl/strings.xml | 2 +- OsmAnd/res/values-sr/strings.xml | 2 +- OsmAnd/res/values-tr/strings.xml | 2 +- OsmAnd/res/values-uk/strings.xml | 2 +- OsmAnd/res/values-zh-rCN/strings.xml | 2 +- OsmAnd/res/values-zh-rTW/strings.xml | 2 +- OsmAnd/res/values/strings.xml | 5 ++- .../activities/FavoritesTreeFragment.java | 2 +- .../osmand/plus/dialogs/ConfigureMapMenu.java | 35 ++++++++++++------- 39 files changed, 63 insertions(+), 51 deletions(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index 6020f1653f..bcb5475282 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3308,7 +3308,7 @@ حدد الحد المسموح به لعرض السيارة على الطرق. محاكاة موقعك باستخدام مسار GPX مسجل. زر لجعل الشاشة مركز نقطة الانطلاق وحساب الطريق إلى الوجهة أو فتح مربع حوار لتحديد الوجهة إذا لم تكن علامة الوجهة علي الخريطة. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s شخصي تنزيل %s diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index 7488c6a26a..4181b27dd1 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -3360,7 +3360,7 @@ Дадаць новы профіль \"%1$s\"\? Захоўваць кірунак Падчас запісу захоўваць кірунак для кожнага пункта маршруту. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Асабісты Спампоўванне %s diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml index 4cc7cdb7a5..d467566bea 100644 --- a/OsmAnd/res/values-ca/strings.xml +++ b/OsmAnd/res/values-ca/strings.xml @@ -3394,7 +3394,7 @@ Abasta l\'àrea: %1$s x %2$s Emergents de control, diàlegs i notificacions que surten a OsmAnd mentre s\'utilitza. Uneix segments Voleu afegir el perfil nou \'%1$s\'\? - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personal S\'està baixant %s diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 6bab01067d..04f44fa4d3 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -3406,7 +3406,7 @@ Repræsenterer område: %1$s x %2$s Tilføj ny profil \'%1$s\'\? Medtag overskrift Gem overskrift til hvert TrackPoint under optagelsen. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personlig Henter %s diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index fef23dd418..6b2d5d6176 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -3403,7 +3403,7 @@ Lon %2$s Neues Profil \'%1$s\' hinzufügen\? Richtung einbeziehen Richtung zu jedem Trackpunkt während der Aufnahme speichern. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Persönlich %s herunterladen diff --git a/OsmAnd/res/values-el/strings.xml b/OsmAnd/res/values-el/strings.xml index f6b431a67d..f73d4eb97e 100644 --- a/OsmAnd/res/values-el/strings.xml +++ b/OsmAnd/res/values-el/strings.xml @@ -3399,7 +3399,7 @@ Προσθήκη νέας κατατομής (προφίλ) \'%1$s\'; Συμπερίληψη κατεύθυνσης Αποθήκευση κατεύθυνσης για κάθε σημείο ίχνους κατά την εγγραφή. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Προσωπικό Λήψη %s diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index de0128e61b..49bf036bf7 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -3378,7 +3378,7 @@ Indikas lokon: %1$s x %2$s" Ĉu aldoni novan profilon “%1$s”\? Inkluzivi direkton Konservi direkton al ĉiu punkto de kurso dum registri. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personaj Elŝutado de %s diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 9b48719030..47e974ad01 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -3415,7 +3415,7 @@ Lon %2$s ¿Añadir el nuevo perfil «%1$s»\? Incluir rumbo Guarda el rumbo para cada punto de la traza durante el seguimiento. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personal Descargando %s diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml index 6cc331d621..e5691a8680 100644 --- a/OsmAnd/res/values-es-rUS/strings.xml +++ b/OsmAnd/res/values-es-rUS/strings.xml @@ -3403,7 +3403,7 @@ Lon %2$s ¿Añadir el nuevo perfil «%1$s»\? Incluir rumbo Guarda el rumbo para cada punto de la traza durante la grabación. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personal Descargando %s diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index 542c9f121a..c37bac4680 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -3394,7 +3394,7 @@ ¿Añadir el nuevo perfil «%1$s»\? Incluir rumbo Guarda el rumbo para cada punto de la traza durante la grabación. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personal Descargando %s diff --git a/OsmAnd/res/values-et/strings.xml b/OsmAnd/res/values-et/strings.xml index 5ea1a4e737..d3f705215d 100644 --- a/OsmAnd/res/values-et/strings.xml +++ b/OsmAnd/res/values-et/strings.xml @@ -1032,7 +1032,7 @@ Lisada uus profiil \'%1$s\'\? Kaasa pealkiri Salvestamise ajal salvesta kurss igasse teekonnapunkti. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Isiklik Allalaadimine %s diff --git a/OsmAnd/res/values-eu/strings.xml b/OsmAnd/res/values-eu/strings.xml index c90a72dfba..977fc08bcf 100644 --- a/OsmAnd/res/values-eu/strings.xml +++ b/OsmAnd/res/values-eu/strings.xml @@ -3400,7 +3400,7 @@ Area honi dagokio: %1$s x %2$s Gehitu \'%1$s\' profil berria\? Sartu norabidea Gorde lorratzeko puntu bakoitzerako norabidea grabatzean. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Pertsonala %s deskargatzen diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml index 14a03fd017..d96dd58ba4 100644 --- a/OsmAnd/res/values-fa/strings.xml +++ b/OsmAnd/res/values-fa/strings.xml @@ -3431,7 +3431,7 @@ پیوند پاره‌ها ثبت جهت هنگام ضبط، جهت را برای هر یک از نقطه‌های رد ثبت کن. - %1$s • %2$s + %1$s • %2$s %1$s،‏ %2$s شخصی در حال بارگیری %s diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 9a3fe969d3..6151c1f56f 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3376,7 +3376,7 @@ représentant la zone : %1$s x %2$s Afficher les pistes cyclables Réseaux Personnel - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Téléchargement %s Épais diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml index 6c9e395110..32ed6a7881 100644 --- a/OsmAnd/res/values-gl/strings.xml +++ b/OsmAnd/res/values-gl/strings.xml @@ -3430,7 +3430,7 @@ Lon %2$s Engadir novo perfil \'%1$s\'\? Incluír encabezamento Gardar encabezamento en cada punto da pista (trackpoint) mentres se grava. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Persoal Baixando %s diff --git a/OsmAnd/res/values-he/strings.xml b/OsmAnd/res/values-he/strings.xml index 93eea39e48..d544a6e58b 100644 --- a/OsmAnd/res/values-he/strings.xml +++ b/OsmAnd/res/values-he/strings.xml @@ -3386,7 +3386,7 @@ להוסיף פרופיל חדש ‚%1&s’\? כולל הכותרת לשמור את הכותרת של כל נקודת דרך בזמן ההקלטה. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s אישי %s בהורדה diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 4d4af2ead0..eaab44ad56 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -3232,7 +3232,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Felugró üzenetek, párbeszédablakok és értesítések beállításai. Javasolt térképek Hozzáadja az új „%1$s” profilt\? - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Személyes %s letöltése diff --git a/OsmAnd/res/values-is/strings.xml b/OsmAnd/res/values-is/strings.xml index 356a036437..5713e34992 100644 --- a/OsmAnd/res/values-is/strings.xml +++ b/OsmAnd/res/values-is/strings.xml @@ -3407,7 +3407,7 @@ Stendur fyrir svæði: %1$s x %2$s Bæta við nýja sniðinu \'%1$s\'\? Hafa með stefnu Vista stefnu í hvern ferilpunkt á meðan upptöku stendur. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Persónulegt Sæki %s diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index fc00ff1325..aeffddb96e 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -3394,7 +3394,7 @@ Rappresenta l\'area: %1$s x %2$s Aggiungere il nuovo profilo \'%1$s\'\? Salva orientamento Durante la registrazione salva l\'orientamento per ogni punto della traccia - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personale Scaricamento %s diff --git a/OsmAnd/res/values-ja/strings.xml b/OsmAnd/res/values-ja/strings.xml index 3f5ffef2db..e9e70c5533 100644 --- a/OsmAnd/res/values-ja/strings.xml +++ b/OsmAnd/res/values-ja/strings.xml @@ -3402,7 +3402,7 @@ POIの更新は利用できません をダウンロード中 濃い 砂漠などの過疎地に向いたマップスタイルです。 - %1$s • %2$s + %1$s • %2$s %1$s, %2$s ナビゲーションアイコンの選択 マップアイコンの選択 diff --git a/OsmAnd/res/values-kn/strings.xml b/OsmAnd/res/values-kn/strings.xml index 5611407d50..cf40b4668a 100644 --- a/OsmAnd/res/values-kn/strings.xml +++ b/OsmAnd/res/values-kn/strings.xml @@ -361,7 +361,7 @@ ಹೊಸ ಪ್ರೊಫೈಲ್ ಸೇರಿಸುವುದೇ \'%1$s\'\? ಶೀರ್ಷಿಕೆಯನ್ನು ಸೇರಿಸಿ ರೆಕಾರ್ಡಿಂಗ್ ಮಾಡುವಾಗ ಪ್ರತಿ ಟ್ರ್ಯಾಕ್ ಪಾಯಿಂಟ್‌ಗೆ ಶೀರ್ಷಿಕೆ ಉಳಿಸಿ. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s ವೈಯಕ್ತಿಕ ಡೌನ್‌ಲೋಡ್ ಮಾಡಲಾಗುತ್ತಿದೆ%s diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 5414b0c8dc..54ae4e5659 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -3405,7 +3405,7 @@ Programtillegg legger til ny profil i OsmAnd Skru av Nytt programtillegg lagt til - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personlig Laster ned %s diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index dedea85c89..45c970715c 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -3276,7 +3276,7 @@ voor Gebied: %1$s x %2$s Sla koers naar elk trackpunt op tijdens het opnemen. Richting toevoegen Persoonlijk - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Downloaden %s Voor woestijnen en andere dunbevolkte gebieden. Toont meer details op schaal. diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index 2b8472db98..4dc90fb373 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -3396,7 +3396,7 @@ Reprezentuje obszar: %1$s x %2$s Dodać nowy profil \'%1$s\'\? Dołącz kierunek Zapisz podczas nagrywania kierunek do każdego punktu trasy. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Osobiste Pobieranie %s diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 4da7fd57cc..1e97cb393c 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -3391,7 +3391,7 @@ Pôr do Sol: %2$s Adicionar novo perfil \'%1$s\'\? Incluir direção Salve o cabeçalho em cada ponto da trilha durante a gravação. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Pessoal Baixando %s diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml index 55fa242a73..ea53e8df12 100644 --- a/OsmAnd/res/values-pt/strings.xml +++ b/OsmAnd/res/values-pt/strings.xml @@ -3376,7 +3376,7 @@ Adicionar novo perfil \'%1$s\'\? Incluir a direção Gravar direção para cada ponto de pista durante a gravação. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Pessoal Descarregando %s diff --git a/OsmAnd/res/values-ro/strings.xml b/OsmAnd/res/values-ro/strings.xml index 32aa71b28c..36a259d6fb 100644 --- a/OsmAnd/res/values-ro/strings.xml +++ b/OsmAnd/res/values-ro/strings.xml @@ -2653,7 +2653,7 @@ Adăugați un profil nou \'%1$s\'\? Includeți titlu Salvați poziția fiecarui punct al traseului în timpul înregistrării. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personal Descarcarea diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 05c178b475..d3fe9c2425 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3347,7 +3347,7 @@ Узловые сети Предлагаемые карты Объединить сегменты - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Для пустынь и других малонаселенных районов. Отображает больше деталей на шкале просмотра. Выберите значок навигации diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 1f71f3970e..e6d3f5e468 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -3398,7 +3398,7 @@ Pro praghere iscrie su còdighe intreu Annanghere su profilu nou \'%1$s\'\? Inclue sa diretzione Sarva sa diretzione pro cada puntu cando ses registrende. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personale Iscarrighende %s diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 23366fa189..842baa09b9 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -3382,7 +3382,7 @@ Zodpovedá oblasti: %1$s x %2$s Pridať nový profil \'%1$s\'\? Pridať nadpis Pridať nadpis ku každému bodu trasy pri zázname. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Osobné Sťahujem %s diff --git a/OsmAnd/res/values-sl/strings.xml b/OsmAnd/res/values-sl/strings.xml index 3d2c2254ea..ba16808d38 100644 --- a/OsmAnd/res/values-sl/strings.xml +++ b/OsmAnd/res/values-sl/strings.xml @@ -3274,7 +3274,7 @@ Koda predstavlja območje: %1$s x %2$s Omrežja vozlišč Vključi glavo Shrani glavo k vsaki točki sledi med beleženjem. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Osebno Poteka prejemanje %s diff --git a/OsmAnd/res/values-sr/strings.xml b/OsmAnd/res/values-sr/strings.xml index 983f2e7d09..e80cb73271 100644 --- a/OsmAnd/res/values-sr/strings.xml +++ b/OsmAnd/res/values-sr/strings.xml @@ -3394,7 +3394,7 @@ Додај нови профил ’%1$s’\? Укључи заглавље Сачувај заглавље свакој тачки праћења приликом снимања. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Лични Преузимам %s diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index cf8b8517dd..213c1f2497 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -3359,7 +3359,7 @@ \'%1$s\' yeni profil eklensin mi\? Başlığı dahil et Kayıt sırasında her izleme noktasına başlığı kaydet. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Kişisel %s indiriliyor diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 73f50679b6..6d0ddf0808 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -3394,7 +3394,7 @@ Додати новий профіль \'%1$s\'\? Зберегти заголовок Зберегти заголовок для кожної точки треку під час запису. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Особистий Завантажується %s diff --git a/OsmAnd/res/values-zh-rCN/strings.xml b/OsmAnd/res/values-zh-rCN/strings.xml index 39d638a743..82c1a05c75 100644 --- a/OsmAnd/res/values-zh-rCN/strings.xml +++ b/OsmAnd/res/values-zh-rCN/strings.xml @@ -2798,7 +2798,7 @@ 下载地图对话框 建议的地图 关闭 - %1$s • %2$s + %1$s • %2$s 选择导航图标 选择地图图标 在您点击“应用”后,已删除的配置将永久丢失。 diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index d26592f846..639fcc0269 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -3394,7 +3394,7 @@ 新增新的設定檔「%1$s」? 包含標題 在記錄時將標題儲存到每個追蹤點。 - %1$s • %2$s + %1$s • %2$s %1$s, %2$s 個人 正在下載 %s diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 8635f82a6e..7b1ec14f21 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,6 +11,9 @@ Thx - Hardy --> + %1$s/%2$s + Sunset at %1$s + Sunrise at %1$s Permission is required to use this option. Check and share detailed logs of the application No routing rules in \'%1$s\'. Please choose another file. @@ -81,7 +84,7 @@ OsmAnd default profiles cannot be deleted, but disabled (on the previous screen), or be sorted to the bottom. Edit profiles The \'Navigation type\' governs how routes are calculated. - %1$s • %2$s + %1$s • %2$s %1$s, %2$s Personal Add the new profile \'%1$s\'? diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java index 6e072e1afc..e466e1b789 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java @@ -954,7 +954,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen name.setTextColor(getResources().getColor(visible ? enabledColor : disabledColor)); distanceText.setText(distance); if (model.isAddressSpecified()) { - distanceText.setText(String.format(getString(R.string.distance_and_address), distance.trim(), model.getAddress())); + distanceText.setText(String.format(getString(R.string.ltr_or_rtl_combine_via_bold_point), distance.trim(), model.getAddress())); } icon.setImageDrawable(FavoriteImageDrawable.getOrCreate(getActivity(), visible ? model.getColor() : getResources().getColor(disabledIconColor), false, model)); diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index 5cfc3d6429..52f0d4eecd 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -583,9 +583,29 @@ public class ConfigureMapMenu { } }).createItem()); + String description = ""; + SunriseSunset sunriseSunset = activity.getMyApplication().getDaynightHelper().getSunriseSunset(); + if (sunriseSunset != null) { + DateFormat dateFormat = DateFormat.getTimeInstance(DateFormat.SHORT); + String sunriseTime = dateFormat.format(sunriseSunset.getSunrise()); + String sunsetTime = dateFormat.format(sunriseSunset.getSunset()); + OsmandSettings.DayNightMode dayNightMode = activity.getMyApplication().getSettings().DAYNIGHT_MODE.get(); + if (dayNightMode.isDay() || dayNightMode.isNight()) { + if (sunriseSunset.isDaytime()) { + description = String.format(app.getString(R.string.sunset_at), sunsetTime); + } else { + description = String.format(app.getString(R.string.sunrise_at), sunriseTime); + } + } else if (dayNightMode.isAuto() || dayNightMode.isSensor()) { + description = String.format(app.getString(R.string.ltr_or_rtl_combine_via_slash), sunriseTime, sunsetTime); + } + description = String.format(app.getString(R.string.ltr_or_rtl_combine_via_bold_point), getDayNightDescr(activity), description); + } else { + description = getDayNightDescr(activity); + } adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.map_mode, activity) .setId(MAP_MODE_ID) - .setDescription(getDayNightDescr(activity)).setLayout(R.layout.list_item_single_line_descrition_narrow) + .setDescription(description) .setIcon(getDayNightIcon(activity)).setListener(new ItemClickListener() { @Override public boolean onContextMenuClick(final ArrayAdapter ad, int itemId, @@ -595,18 +615,7 @@ public class ConfigureMapMenu { bld.setTitle(R.string.daynight); final String[] items = new String[OsmandSettings.DayNightMode.values().length]; for (int i = 0; i < items.length; i++) { - items[i] = OsmandSettings.DayNightMode.values()[i].toHumanString(activity - .getMyApplication()); - } - - SunriseSunset sunriseSunset = activity.getMyApplication().getDaynightHelper().getSunriseSunset(); - if (sunriseSunset != null) { - DateFormat dateFormat = DateFormat.getTimeInstance(DateFormat.SHORT); - String sunriseSunsetTime = "\n" + dateFormat.format(activity.getMyApplication() - .getDaynightHelper().getSunriseSunset().getSunrise()) + "/" + - dateFormat.format(activity.getMyApplication() - .getDaynightHelper().getSunriseSunset().getSunset()); - items[0] += sunriseSunsetTime; + items[i] = OsmandSettings.DayNightMode.values()[i].toHumanString(app); } int i = view.getSettings().DAYNIGHT_MODE.get().ordinal(); bld.setNegativeButton(R.string.shared_string_dismiss, null); From 8c8f83c5d02e18cca69de2571be5a73f15e2a944 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Tue, 28 Jan 2020 19:35:58 +0200 Subject: [PATCH 25/45] work in progress --- .../osmand/binary/BinaryMapIndexReader.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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 5da9e92aa9..7270616a78 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -1135,6 +1135,7 @@ public class BinaryMapIndexReader { TIntArrayList additionalTypes = null; TIntObjectHashMap stringNames = null; TIntArrayList stringOrder = null; + TIntArrayList labelCoordinates = null; long id = 0; boolean loop = true; @@ -1232,6 +1233,20 @@ public class BinaryMapIndexReader { req.stat.lastStringNamesSize += sizeL; } break; + case OsmandOdb.MapData.LABELCOORDINATES_FIELD_NUMBER: + System.out.println("label coords"); + labelCoordinates = new TIntArrayList(); + sizeL = codedIS.readRawVarint32(); + old = codedIS.pushLimit(sizeL); + if (READ_STATS) { + req.stat.addTagHeader(OsmandOdb.MapData.LABELCOORDINATES_FIELD_NUMBER, sizeL); + req.stat.lastObjectLabelCoordinates += sizeL; + } + while (codedIS.getBytesUntilLimit() > 0) { + labelCoordinates.add(codedIS.readRawVarint32()); + } + codedIS.popLimit(old); + break; default: skipUnknownField(t); break; @@ -1259,6 +1274,12 @@ public class BinaryMapIndexReader { dataObject.id = id; dataObject.area = area; dataObject.mapIndex = root; + if (labelCoordinates != null) { + dataObject.labelCoordinates = labelCoordinates.toArray(); + } else { + dataObject.labelCoordinates = new int[0]; + } + return dataObject; } @@ -1562,6 +1583,7 @@ public class BinaryMapIndexReader { public int lastObjectAdditionalTypes; public int lastObjectTypes; public int lastObjectCoordinates; + public int lastObjectLabelCoordinates; public int lastObjectSize; public int lastBlockStringTableSize; @@ -1586,6 +1608,7 @@ public class BinaryMapIndexReader { lastObjectAdditionalTypes = 0; lastObjectTypes = 0; lastObjectCoordinates = 0; + lastObjectLabelCoordinates = 0; } } @@ -2094,7 +2117,7 @@ public class BinaryMapIndexReader { public static void main(String[] args) throws IOException { File fl = new File(System.getProperty("maps") + "/Synthetic_test_rendering.obf"); - fl = new File(System.getProperty("maps") + "/Belarus_europe_2.obf"); + fl = new File("/home/madwasp79/OsmAnd-maps/_Creator/Poly_center.obf"); RandomAccessFile raf = new RandomAccessFile(fl, "r"); From 6f48ca6cbbac520d757485d6aefb950b80f4aae8 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 28 Jan 2020 18:48:43 +0100 Subject: [PATCH 26/45] Fix labelx, labely --- .../osmand/binary/BinaryMapDataObject.java | 83 +++++++++---------- .../osmand/binary/BinaryMapIndexReader.java | 29 ++----- 2 files changed, 46 insertions(+), 66 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java index c3797a5017..5e0327f079 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java @@ -19,7 +19,8 @@ public class BinaryMapDataObject { protected int[] types = null; protected int[] additionalTypes = null; protected int objectType = RenderingRulesStorage.POINT_RULES; - protected int[] labelCoordinates = null; + protected int labelX; + protected int labelY; protected TIntObjectHashMap objectNames = null; protected TIntArrayList namesOrder = null; @@ -34,7 +35,7 @@ public class BinaryMapDataObject { public BinaryMapDataObject(long id, int[] coordinates, int[][] polygonInnerCoordinates, int objectType, boolean area, - int[] types, int[] additionalTypes, int[] labelCoordinates){ + int[] types, int[] additionalTypes, int labelX, int labelY){ this.polygonInnerCoordinates = polygonInnerCoordinates; this.coordinates = coordinates; this.additionalTypes = additionalTypes; @@ -42,7 +43,8 @@ public class BinaryMapDataObject { this.id = id; this.objectType = objectType; this.area = area; - this.labelCoordinates = labelCoordinates; + this.labelX = labelX; + this.labelY = labelY; } protected void setCoordinates(int[] coordinates) { @@ -204,79 +206,80 @@ public class BinaryMapDataObject { && this.id == thatObj.id && this.area == thatObj.area && compareCoordinates(this.coordinates, thatObj.coordinates, coordinatesPrecision) ) { - if(mapIndex == null) { + if (mapIndex == null) { throw new IllegalStateException("Illegal binary object: " + id); } - if(thatObj.mapIndex == null) { + if (thatObj.mapIndex == null) { throw new IllegalStateException("Illegal binary object: " + thatObj.id); } boolean equals = true; - if(equals) { - if(polygonInnerCoordinates == null || thatObj.polygonInnerCoordinates == null) { - equals = polygonInnerCoordinates == thatObj.polygonInnerCoordinates; - } else if(polygonInnerCoordinates.length != thatObj.polygonInnerCoordinates.length){ + if (equals) { + if (polygonInnerCoordinates == null || thatObj.polygonInnerCoordinates == null) { + equals = polygonInnerCoordinates == thatObj.polygonInnerCoordinates; + } else if (polygonInnerCoordinates.length != thatObj.polygonInnerCoordinates.length) { equals = false; } else { - for(int i = 0; i < polygonInnerCoordinates.length && equals; i++) { - if(polygonInnerCoordinates[i] == null || thatObj.polygonInnerCoordinates[i] == null) { - equals = polygonInnerCoordinates[i] == thatObj.polygonInnerCoordinates[i]; - } else if(polygonInnerCoordinates[i].length != thatObj.polygonInnerCoordinates[i].length){ + for (int i = 0; i < polygonInnerCoordinates.length && equals; i++) { + if (polygonInnerCoordinates[i] == null || thatObj.polygonInnerCoordinates[i] == null) { + equals = polygonInnerCoordinates[i] == thatObj.polygonInnerCoordinates[i]; + } else if (polygonInnerCoordinates[i].length != thatObj.polygonInnerCoordinates[i].length) { equals = false; } else { - equals = compareCoordinates(polygonInnerCoordinates[i], thatObj.polygonInnerCoordinates[i], coordinatesPrecision); + equals = compareCoordinates(polygonInnerCoordinates[i], thatObj.polygonInnerCoordinates[i], + coordinatesPrecision); } } } } - if(equals) { - if(types == null || thatObj.types == null) { - equals = types == thatObj.types; - } else if(types.length != thatObj.types.length){ + if (equals) { + if (types == null || thatObj.types == null) { + equals = types == thatObj.types; + } else if (types.length != thatObj.types.length) { equals = false; } else { - for(int i = 0; i < types.length && equals; i++) { + for (int i = 0; i < types.length && equals; i++) { TagValuePair o = mapIndex.decodeType(types[i]); TagValuePair s = thatObj.mapIndex.decodeType(thatObj.types[i]); equals = o.equals(s) && equals; } } } - if(equals) { - if(additionalTypes == null || thatObj.additionalTypes == null) { - equals = additionalTypes == thatObj.additionalTypes; - } else if(additionalTypes.length != thatObj.additionalTypes.length){ + if (equals) { + if (additionalTypes == null || thatObj.additionalTypes == null) { + equals = additionalTypes == thatObj.additionalTypes; + } else if (additionalTypes.length != thatObj.additionalTypes.length) { equals = false; } else { - for(int i = 0; i < additionalTypes.length && equals; i++) { + for (int i = 0; i < additionalTypes.length && equals; i++) { TagValuePair o = mapIndex.decodeType(additionalTypes[i]); TagValuePair s = thatObj.mapIndex.decodeType(thatObj.additionalTypes[i]); equals = o.equals(s); } } } - if(equals) { - if(namesOrder == null || thatObj.namesOrder == null) { - equals = namesOrder == thatObj.namesOrder; - } else if(namesOrder.size() != thatObj.namesOrder.size()){ + if (equals) { + if (namesOrder == null || thatObj.namesOrder == null) { + equals = namesOrder == thatObj.namesOrder; + } else if (namesOrder.size() != thatObj.namesOrder.size()) { equals = false; } else { - for(int i = 0; i < namesOrder.size() && equals; i++) { + for (int i = 0; i < namesOrder.size() && equals; i++) { TagValuePair o = mapIndex.decodeType(namesOrder.get(i)); TagValuePair s = thatObj.mapIndex.decodeType(thatObj.namesOrder.get(i)); equals = o.equals(s); } } } - if(equals) { + if (equals) { // here we know that name indexes are equal & it is enough to check the value sets - if(objectNames == null || thatObj.objectNames == null) { - equals = objectNames == thatObj.objectNames; - } else if(objectNames.size() != thatObj.objectNames.size()){ + if (objectNames == null || thatObj.objectNames == null) { + equals = objectNames == thatObj.objectNames; + } else if (objectNames.size() != thatObj.objectNames.size()) { equals = false; } else { - for(int i = 0; i < namesOrder.size() && equals; i++) { + for (int i = 0; i < namesOrder.size() && equals; i++) { String o = objectNames.get(namesOrder.get(i)); String s = thatObj.objectNames.get(thatObj.namesOrder.get(i)); equals = Algorithms.objectEquals(o, s); @@ -284,18 +287,6 @@ public class BinaryMapDataObject { } } - //do we need it? use precision? - if (equals) { - if (labelCoordinates == null || thatObj.labelCoordinates == null) { - equals = labelCoordinates == thatObj.labelCoordinates; - //do we need it? precision? -// } else { -// for(int i = 0; i < labelCoordinates.length && equals; i++) { -// equals = labelCoordinates[i] == thatObj.labelCoordinates[i]; -// } - } - } - return equals; } // thatObj.mapIndex.decodeType(thatObj.types[0]) 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 7270616a78..c8d78211ae 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -76,7 +76,6 @@ import gnu.trove.map.TIntObjectMap; import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.map.hash.TLongObjectHashMap; import gnu.trove.set.hash.TIntHashSet; -import gnu.trove.set.hash.TLongHashSet; public class BinaryMapIndexReader { @@ -1135,8 +1134,8 @@ public class BinaryMapIndexReader { TIntArrayList additionalTypes = null; TIntObjectHashMap stringNames = null; TIntArrayList stringOrder = null; - TIntArrayList labelCoordinates = null; long id = 0; + int labelX = 0, labelY = 0; boolean loop = true; while (loop) { @@ -1234,18 +1233,13 @@ public class BinaryMapIndexReader { } break; case OsmandOdb.MapData.LABELCOORDINATES_FIELD_NUMBER: - System.out.println("label coords"); - labelCoordinates = new TIntArrayList(); - sizeL = codedIS.readRawVarint32(); - old = codedIS.pushLimit(sizeL); + labelX = codedIS.readRawVarint32(); + labelY = codedIS.readRawVarint32(); if (READ_STATS) { - req.stat.addTagHeader(OsmandOdb.MapData.LABELCOORDINATES_FIELD_NUMBER, sizeL); - req.stat.lastObjectLabelCoordinates += sizeL; + req.stat.addTagHeader(OsmandOdb.MapData.LABELCOORDINATES_FIELD_NUMBER, 0); + req.stat.lastObjectLabelCoordinates += CodedOutputStream.computeRawVarint32Size(labelX); + req.stat.lastObjectLabelCoordinates += CodedOutputStream.computeRawVarint32Size(labelY); } - while (codedIS.getBytesUntilLimit() > 0) { - labelCoordinates.add(codedIS.readRawVarint32()); - } - codedIS.popLimit(old); break; default: skipUnknownField(t); @@ -1274,11 +1268,8 @@ public class BinaryMapIndexReader { dataObject.id = id; dataObject.area = area; dataObject.mapIndex = root; - if (labelCoordinates != null) { - dataObject.labelCoordinates = labelCoordinates.toArray(); - } else { - dataObject.labelCoordinates = new int[0]; - } + dataObject.labelX = labelX; + dataObject.labelY = labelY; return dataObject; } @@ -1941,7 +1932,7 @@ public class BinaryMapIndexReader { BinaryMapDataObject bm = new BinaryMapDataObject(o.id, o.coordinates, o.polygonInnerCoordinates, o.objectType, o.area, types.toArray(), additionalTypes.isEmpty() ? null : additionalTypes.toArray(), - o.labelCoordinates); + o.labelX, o.labelY); if (o.namesOrder != null) { bm.objectNames = new TIntObjectHashMap<>(); bm.namesOrder = new TIntArrayList(); @@ -2225,7 +2216,6 @@ public class BinaryMapIndexReader { private static List readGPX(File f) { List res = new ArrayList(); try { - StringBuilder content = new StringBuilder(); BufferedReader reader = new BufferedReader(getUTF8Reader(new FileInputStream(f))); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder dom = factory.newDocumentBuilder(); @@ -2242,7 +2232,6 @@ public class BinaryMapIndexReader { // Document doc = dom.parse(new InputSource(new StringReader(content.toString()))); Document doc = dom.parse(new InputSource(reader)); NodeList list = doc.getElementsByTagName("trkpt"); - Way w = new Way(-1); for (int i = 0; i < list.getLength(); i++) { Element item = (Element) list.item(i); try { From 6778ebda7cecccfd73e6883a1f0bd45a0b5831df Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 28 Jan 2020 19:11:12 +0100 Subject: [PATCH 27/45] Fix labelx, labely --- .../osmand/binary/BinaryMapDataObject.java | 7 +------ .../osmand/binary/BinaryMapIndexReader.java | 21 ++++++++++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java index 5e0327f079..f9f8f7183e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java @@ -368,12 +368,7 @@ public class BinaryMapDataObject { return coordinates; } - public int getObjectType() { return objectType; } - - public int[] getLabelCoordinates() { - return labelCoordinates; - } -} +} 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 c8d78211ae..fca044e0c2 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -1233,12 +1233,23 @@ public class BinaryMapIndexReader { } break; case OsmandOdb.MapData.LABELCOORDINATES_FIELD_NUMBER: - labelX = codedIS.readRawVarint32(); - labelY = codedIS.readRawVarint32(); + sizeL = codedIS.readRawVarint32(); + old = codedIS.pushLimit(sizeL); + int i = 0; + while (codedIS.getBytesUntilLimit() > 0) { + if (i == 0) { + labelX = codedIS.readSInt32(); + } else if (i == 1) { + labelY = codedIS.readSInt32(); + } else { + codedIS.readRawVarint32(); + } + i++; + } + codedIS.popLimit(old); if (READ_STATS) { - req.stat.addTagHeader(OsmandOdb.MapData.LABELCOORDINATES_FIELD_NUMBER, 0); - req.stat.lastObjectLabelCoordinates += CodedOutputStream.computeRawVarint32Size(labelX); - req.stat.lastObjectLabelCoordinates += CodedOutputStream.computeRawVarint32Size(labelY); + req.stat.addTagHeader(OsmandOdb.MapData.LABELCOORDINATES_FIELD_NUMBER, sizeL); + req.stat.lastObjectLabelCoordinates += sizeL; } break; default: From ac11868e2ad22d070aedf25f900382fce81dc6d9 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 28 Jan 2020 19:44:51 +0100 Subject: [PATCH 28/45] Fix labelx, labely --- .../osmand/binary/BinaryMapDataObject.java | 28 +++++++++++++++++++ .../osmand/binary/BinaryMapIndexReader.java | 3 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java index f9f8f7183e..4a3c465699 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapDataObject.java @@ -362,7 +362,35 @@ public class BinaryMapDataObject { } + public boolean isLabelSpecified() { + return (labelX != 0 || labelY != 0) && coordinates.length > 0; + } + public int getLabelX() { + long sum = 0; + int LABEL_SHIFT = 31 - BinaryMapIndexReader.LABEL_ZOOM_ENCODE; + int len = coordinates.length / 2; + for(int i = 0; i < len; i++) { + sum += coordinates[2 * i]; + } + int average = ((int) (sum >> BinaryMapIndexReader.SHIFT_COORDINATES)/ len) + << (BinaryMapIndexReader.SHIFT_COORDINATES - LABEL_SHIFT); + int label31X = (average + this.labelX) << LABEL_SHIFT; + return label31X; + } + + public int getLabelY() { + long sum = 0; + int LABEL_SHIFT = 31 - BinaryMapIndexReader.LABEL_ZOOM_ENCODE; + int len = coordinates.length / 2; + for(int i = 0; i < len; i++) { + sum += coordinates[2 * i + 1]; + } + int average = ((int) (sum >> BinaryMapIndexReader.SHIFT_COORDINATES)/ len) + << (BinaryMapIndexReader.SHIFT_COORDINATES - LABEL_SHIFT); + int label31Y = (average + this.labelY) << LABEL_SHIFT; + return label31Y; + } public int[] getCoordinates() { return coordinates; 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 fca044e0c2..4117223104 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -81,6 +81,7 @@ public class BinaryMapIndexReader { public final static int TRANSPORT_STOP_ZOOM = 24; public static final int SHIFT_COORDINATES = 5; + public static final int LABEL_ZOOM_ENCODE = 31; private final static Log log = PlatformUtil.getLog(BinaryMapIndexReader.class); public static boolean READ_STATS = false; public static final SearchPoiTypeFilter ACCEPT_ALL_POI_TYPE_FILTER = new SearchPoiTypeFilter() { @@ -2119,7 +2120,7 @@ public class BinaryMapIndexReader { public static void main(String[] args) throws IOException { File fl = new File(System.getProperty("maps") + "/Synthetic_test_rendering.obf"); - fl = new File("/home/madwasp79/OsmAnd-maps/_Creator/Poly_center.obf"); + fl = new File(System.getProperty("maps") + "/Belarus_europe_2.obf"); RandomAccessFile raf = new RandomAccessFile(fl, "r"); From a8973e7c5d729b501ea8c69969675bc9917f3300 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Mon, 27 Jan 2020 21:01:20 +0000 Subject: [PATCH 29/45] Translated using Weblate (French) Currently translated at 99.9% (3154 of 3156 strings) --- OsmAnd/res/values-fr/strings.xml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 9a3fe969d3..220fb82982 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -596,18 +596,18 @@ Utiliser les cartes en ligne (télécharge et conserve en cache les tuiles sur la carte mémoire). Cartes en ligne Sélectionnez la source de la carte : en ligne ou tuile en cache. - Ce greffon permet d\'accéder à une grand nombre de cartes en ligne (aussi appelées tuiles ou cartes raster) qui vont de cartes OpenStreetMap (comme Mapnik) jusqu\'aux images satellites en passant par des cartes spécialisées comme des cartes météo, des cartes de climat, des cartes géologiques, des couches de relief, etc. + Accédez à une grand nombre de cartes en ligne (aussi appelées tuiles ou cartes raster) qui vont de cartes OpenStreetMap (comme Mapnik) jusqu\'aux images satellites en passant par des cartes spécialisées comme des cartes météo, des cartes de climat, des cartes géologiques, les couches de relief, etc. \n -\nChacune de ces cartes est utilisable, comme carte principale, sur-couche ou sous-couche d\'une autre carte. Afin de gérer au mieux la superposition des cartes, vous pouvez masquer certains éléments des cartes vectorielles hors ligne depuis le menu \"Paramétrer la carte\". +\nChacune de ces cartes est utilisable, comme carte principale, sur-couche ou sous-couche d\'une autre carte. Afin de gérer au mieux la superposition des cartes et améliorer la lisibilité, vous pouvez masquer certains éléments des cartes vectorielles hors ligne depuis le menu \"Paramétrer la carte\". \n \nLes cartes tuiles peuvent être obtenues directement en ligne ou peuvent être préparées pour un usage hors ligne grâce à des outils tiers puis copiées dans le dossier de données d\'OsmAnd sous forme de base de données SQLite. Affiche les préférences afin d\'activer le suivi et la navigation en arrière-plan (écran éteint) en réveillant périodiquement le GPS. - Ce greffon active dans OsmAnd les options d\'accessibilité de votre appareil (réglage de la vitesse des voix de synthèse vocale, utilisation du trackball pour zoomer ou annonces vocales de votre position). - Ce greffon permet de gérer les paramètres de développement et de débogage tels que la simulation de navigation ou l\'affichage des performances du rendu. Ces paramètres sont conçus pour les développeurs et peuvent être ignorés par les autres utilisateurs. + Activez, dans OsmAnd, les options d\'accessibilité de votre appareil (régler la vitesse des voix de synthèse vocale, utiliser le trackball pour zoomer ou activer les annonces vocales de votre position). + Gérez les paramètres de développement et de débogage tels que la simulation de navigation, l\'affichage des performances ou le guidage vocal. Ces paramètres sont conçus pour les développeurs et peuvent être ignorés par les autres utilisateurs. Gestionnaire de greffons Les greffons ajoutent à l\'application des fonctionnalités supplémentaires et des paramètres avancés. Gestionnaire de greffons - Grâce à ce greffon vous pouvez gérer vos contributions à OpenStreetMap (OSM) directement depuis l\'application OsmAnd. Par exemple : créer ou modifier les points d\'intérêt OSM, déclarer ou commenter les notes OSM et envoyer vos traces GPX (nécessite un compte OSM). OpenStreetMap est une communauté ouverte de cartographie publique. Pour plus de détails, consultez https://openstreetmap.org. + Contribuez à OpenStreetMap (OSM) directement depuis l\'application OsmAnd. Par exemple : créez ou modifiez les points d\'intérêt OSM, créez ou modifiez les notes OSM et envoyez vos traces GPX (nécessite un compte OSM). OpenStreetMap est une communauté ouverte et mondiale de cartographie publique. Cartes vectorielles (hors-ligne) peuvent s\'afficher plus rapidement. Peut ne pas fonctionner sur certains appareils. Sélectionnez une voix et testez les annonces vocales : Débogage et développement OsmAnd @@ -720,9 +720,8 @@ PM AM Lieu de stationnement - Ce greffon permet d\'enregistrer l\'emplacement de stationnement de votre véhicule et, si besoin, de mesurer la durée de stationnement restante. - -Ces informations sont visibles sur le Tableau de bord comme sur la carte. Un rappel peut même être ajouté à votre calendrier. + Enregistrez l\'emplacement de stationnement de votre véhicule et, si besoin, mesurez la durée de stationnement restante. +\nCes informations sont visibles sur le Tableau de bord comme sur la carte. Un rappel peut même être ajouté à votre calendrier. Stationnement Marquer comme stationnement Supprimer l\'emplacement de stationnement @@ -892,7 +891,7 @@ Ces informations sont visibles sur le Tableau de bord comme sur la carte. Un rap parties Appuyez sur \"Utiliser la position...\" pour ajouter une note sur le point. Notes audio - Ce greffon permet de prendre des notes (photos, audios ou vidéos) sur un itinéraire soit en utilisant un bouton affiché sur la carte, soit directement depuis le menu contextuel de n\'importe quel point sur la carte. + Prenez des notes (photos, audios ou vidéos) pendant votre itinéraire soit en utilisant un bouton, soit depuis le menu contextuel de n\'importe quel point. Notes audio/vidéo Greffon OsmAnd pour les courbes de niveau hors-ligne Ce greffon permet l\'affichage de courbes de niveau ainsi que du relief (ombres) qui s\'ajoutent au-dessus des cartes standard d\'OsmAnd. Ces informations sont particulièrement utiles pour les sportifs, les randonneurs, les cyclistes et d\'une manière générale par toutes les personnes qui souhaitent connaitre le relief. @@ -993,7 +992,7 @@ Ces informations sont visibles sur le Tableau de bord comme sur la carte. Un rap altitude Nom du fichier GPX Fichier GPX {0} enregistré - Ce greffon permet, depuis la carte, de créer un itinéraire soit un cliquant sur la carte, soit en ouvrant ou en modifiant un fichier GPX existant ainsi que de mesurer la distance entre des points. L\'itinéraire créé peut être enregistré dans un fichier GPX qui peut lui-même être utilisé ensuite pour une navigation. + Créez un itinéraire (soit en appuyant sur la carte soit en ouvrant un fichier GPX existant) et mesurez la distance entre points. Enregistrez ces itinéraires comme fichiers GPX et plus tard charger les pour vous faire guider. Mesure de distance et Outil de planification Ne plus afficher Fichier de modifications OSM %1$s généré avec succès @@ -1202,7 +1201,7 @@ Ces informations sont visibles sur le Tableau de bord comme sur la carte. Un rap Fichier GPX vide Traces Favoris - Favoris + Mes lieux favoris \n\nAppui long pour afficher sur la carte Démarrer la navigation pas à pas automatiquement sélectionné(s) @@ -1648,7 +1647,7 @@ Ces informations sont visibles sur le Tableau de bord comme sur la carte. Un rap Contact Merci d\'indiquer un type de point d\'intérêt. Jours travaillés - Emplacements récents + Lieux récents Favoris Afficher au démarrage Afficher les données GPX @@ -3444,4 +3443,12 @@ représentant la zone : %1$s x %2$s Recommandation : il est difficile de prédire ce qui sera enregistré et ce qui ne le sera pas, il peut être préférable de désactiver ce filtre. Ce filtre limite l\'enregistrement de points en double lorsque les déplacements sont très lents donnant une apparence plus régulière aux traces. Recommandation : un paramètre de 5 mètres est adapté si vous n\'avez pas besoin de détails et ne souhaitez pas enregistrer des points au repos. + Effet secondaire : votre trace ne contiendra pas les parties où la vitesse minimale n\'a pas été atteinte (par exemple lorsque vous poussez votre vélo en montée ou pendant une pause). De ce fait certaines informations de votre trace seront faussées comme la durée de déplacement ou la vitesse moyenne. + Recommandation : commencez par utiliser la détection de mouvement via le filtre de déplacement minimum (B) vous pourriez obtenir de meilleurs résultats en perdant moins de données. Si vos traces restent bruyantes à basse vitesse, essayez ici des valeurs non nulles. Veuillez noter que certaines mesures peuvent retourner une vitesse nulle (en raison de méthodes basées sur le réseau), dans ce cas rien ne sera enregistré. + Seuls les points mesurés avec un minimum de précision en mètres/pieds (information communiquée par votre puce GPS) seront enregistrés. La précision fait référence à la dispersion de plusieurs mesures successives et n\'est pas directement liée à la distance entre ces mesures et votre position réelle. + Effet secondaire : avec le filtrage par précision certains points peuvent manquer ; par exemple : sous un pont, en forêt, entre de hauts bâtiments ou dans certaines conditions météorologiques. + Remarque : si la localisation GPS est activée juste avant le début d\'enregistrement, la première position peut être imprécise. L\'application pourrait attendre quelques secondes avant d\'enregistrer un point (ou enregistrer le meilleur de 3 points successifs, etc), mais ces évolutions ne sont pas encore disponibles. + Menu > Mes lieux favoris > Traces + Menu > Mes lieux favoris > Notes + Menu > Mes lieux favoris > Modifications OSM \ No newline at end of file From ac082a8323f1d5adaf10fa4d5ec99264734d8797 Mon Sep 17 00:00:00 2001 From: iman Date: Tue, 28 Jan 2020 14:23:33 +0000 Subject: [PATCH 30/45] Translated using Weblate (Persian) Currently translated at 95.8% (3023 of 3156 strings) --- OsmAnd/res/values-fa/strings.xml | 99 +++++++++++++++++++------------- 1 file changed, 58 insertions(+), 41 deletions(-) diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml index 14a03fd017..da35d5a147 100644 --- a/OsmAnd/res/values-fa/strings.xml +++ b/OsmAnd/res/values-fa/strings.xml @@ -2,7 +2,7 @@ پشتیبان‌گیری از تغییرات OSM ناموفق بود. زمان - دقت + صحت سرعت ارتفاع نقطه @@ -162,7 +162,7 @@ افزونهٔ «نقشه‌های آنلاین» را فعال کنید تا منابع مختلفی را برای نقشه انتخاب کنید پشتیبان‌گیری در قالب تغییر OSM حذف نقطه - استفاده از فیلتر کالمن + استفاده از پالایهٔ Kalman حذف مسیر هیچ‌کدام افزونهٔ دراپ‌باکس @@ -192,12 +192,12 @@ مقصد %1$s تنظیم به عنوان مقصد ایمیل - ذخیره‌کردن با نام - این فیلتر حذف شود؟ - فیلتر «{0}» حذف شد - فیلتر «{0}» ایجاد شد + ذخیره با نام + این پالایه حذف شود؟ + پالایهٔ «{0}» حذف شد + پالایهٔ «{0}» ایجاد شد پاک‌کردن - فیلتر + پالایش همهٔ برچسب‌های دیگر حفظ شد باز است توضیح @@ -374,7 +374,7 @@ چپ-جلو ساعت به‌طرف - دقت + صحت ارتفاع من اینجا هستم آپلود همه @@ -790,7 +790,7 @@ جست‌وجوی حرف‌به‌حرف نام ساختمان‌ها جست‌وجوی حرف‌به‌حرف نام خیابان‌ها بارکردن مجدد کاشی - ضبط خودکار رد هنگام ناوبری + ردنگاری خودکار در هنگام ناوبری در حال بارکردن کدهای پستی… در حال تبدیل اسامی محلی/انگلیسی… ناموفق @@ -850,9 +850,9 @@ زمانی که صفحه خاموش است موقعیت شما را ردگیری می‌کند. اجرای OsmAnd در پس‌زمینه برای استفاده از خدمات ناوبری موقعیت مکانی را روشن کنید. - مخفی‌کردن فیلتر - نمایش فیلتر - فیلتر + مخفی‌کردن پالایه + نمایش پالایه + پالایه منبع نقشه… جست‌وجوی POI استفاده از گوی چرخان (توپک) برای جابه‌جاکردن نقشه. @@ -1036,7 +1036,7 @@ بارکردن رندرکننده ناموفق بود. رندرکنندهٔ بُرداری شکل‌وشمایل رندرگیری را انتخاب نمایید - فیلتر + بنویسید تا پالایش شود جست‌وجوی حمل‌ونقل در ایستگاه نحوهٔ چرخش نقشه: لایهٔ POI… @@ -1483,7 +1483,7 @@ حافظهٔ داخلی محل ذخیره‌سازی نقشه کپی - فیلتر بر اساس نام + پالایش بر اساس نام جست‌وجوی همه باز است اطلاعات A-GPS @@ -1860,8 +1860,8 @@ ضبط‌کردن اطلاعاتی وجود ندارد رنگ‌بندی منحنی‌های میزان - کمترین سرعت برای ورود به سیستم - کمترین دقت برای ثبت + کمترین سرعت برای ثبت + کمترین صحت برای ثبت ‏POI کریسمس در آستانهٔ کریسمس و تعطیلات سال نو، می‌توانید نقاط توجه در کریسمس، مانند درخت‌های کریسمس، فروشگاه‌ها و غیره را ببینید. نقاط توجه تعطیلات کریسمس نمایش داده شود؟ @@ -1873,14 +1873,14 @@ ویرایش دسته‌ها زیردسته‌ها دسته‌های انتخاب‌شده - ایجاد فیلتر سفارشی + ایجاد پالایهٔ سفارشی جست‌وجوی سفارشی - فیلترها - به‌کارگیری فیلترها - ذخیره‌ فیلتر - حذف فیلتر - فیلتر جدید - لطفاً برای فیلتر جدید نامی وارد کنید. این نام به «دسته‌ها» اضافه می‌شود. + پالایه‌ها + به‌کارگیری پالایه‌ها + ذخیره‌ٔ پالایه + حذف پالایه + پالایهٔ جدید + لطفاً برای این پالایه نامی بنویسید. این نام به «دسته‌ها» اضافه می‌شود. نام فایل GPX: مشاهده بر روی نقشه پس از ذخیره نقشه را بپیمایید و نقاط را اضافه کنید @@ -2053,7 +2053,7 @@ \nپهنهٔ متناظر: %1$s × %2$s محدودهٔ جست‌وجو را بزرگ‌تر کن جست‌وجو را تغییر دهید یا شعاع آن را بزرگ‌تر کنید. - ثبت رد درصورت تقاضا + ردنگاری بر اساس تقاضا میانگین %1$d از %2$d صعود/نزول @@ -2293,7 +2293,7 @@ نام کاربری را بنویسید فقط تصاویری که کاربر زیر اضافه کرده است نام کاربری - فیلتر تصاویر بر اساس ارسال‌کننده، تاریخ یا نوع. فقط در زوم نزدیک کار می‌کند. + پالایش تصاویر بر اساس ارسال‌کننده، تاریخ یا نوع. فقط در زوم نزدیک کار می‌کند. خط‌کش شعاعی مجوزها درون‌برد فایل ناموفق بود. لطفاً بررسی کنید OsmAnd اجازهٔ خواندن آن را داشته باشد. @@ -2350,9 +2350,9 @@ یادداشت‌های OSM خود را به‌صورت ناشناس یا با نام کاربری‌تان در سایت OpenStreetMap.org، آپلود کنید. خروجی %1$d را بگیرید و بروید در نوار اعلان دستگاه یک اعلان برای ضبط سفر نشان می‌دهد. - فیلتر: هیچ نقطه‌ای ثبت نمی‌شود مگر به این سرعت برسد. - فیلتر: کمترین مسافتی که یک نقطه باید از موقعیت قبلی داشته باشد تا ثبت شود. - فیلتر: هیچ نقطه‌ای ثبت نمی‌شود مگر به این دقت برسد. + پالایه: هیچ نقطه‌ای ثبت نمی‌شود مگر به این سرعت برسد. + پالایه: کمترین مسافتی که یک نقطه باید از موقعیت قبلی داشته باشد تا ثبت شود. + پالایه: ضبط انجام نمی‌شود مگر با رسیدن به این میزان صحت. پیداکردن پارکینگ افزودن بازهٔ زمانی خنثی‌کردن همه @@ -3315,8 +3315,8 @@ مسیر پوشهٔ داده‌های OsmAnd را درج کنید پوشهٔ داده‌های OsmAnd تغییر کند؟ انتقال به مقصد جدید - ذخیره‌گاه داخلی از کاربر و سایر برنامک‌ها پنهان است، منحصراً OsmAnd به آن دسترسی دارد - تغییر پوشهٔ ذخیره‌سازی داده‌ها + ذخیره‌گاه داخلی OsmAnd (از دید کاربران و سایر برنامه‌ها پنهان است). + تغییر پوشهٔ ذخیره‌سازی پارک برفی سورتمه کالسکه‌ای سورتمه @@ -3364,26 +3364,26 @@ به‌روزرسانی همهٔ نقشه‌ها آیا همهٔ نقشه‌ها (%1$d) را به‌روز می‌کنید؟ • تنظیمات برنامه و پروفایل‌ها به‌روز شد: تنظیمات بر اساس نوع مرتب شده‌اند و امکان شخصی‌سازی هر پروفایل اضافه شده است. -\n +\n \n• کادر جدیدی برای دانلود نقشه اضافه شده که هنگام مرور، نقشه‌ها را پیشنهاد می‌کند. -\n -\n• اصلاحاتی در پوستهٔ شب انجام شد. -\n +\n +\n• اصلاحاتی در پوستهٔ تیره انجام شد. +\n \n• چند ایراد مسیریابی در سراسر جهان رفع شد. -\n +\n \n• نقشهٔ پایه با جزئیات بیشتر از شبکهٔ راه‌ها به‌روز شد. -\n +\n \n• مناطق آب‌گرفته در سراسر جهان اصلاح شد. -\n +\n \n• مسیریابی اسکی: پروفایل ارتفاعی و دشواری مسیر به جزئیات مسیرها افزوده شد. -\n +\n \n• اصلاح سایر باگ‌ها \n \n این تنظیم را می‌توانید بر همهٔ پروفایل‌ها یا فقط بر پروفایل جاری به کار ببندید. مشترک ترجیح جاده‌های روسازی‌نشده - جاده‌های روسازی‌نشده را ترجیح می‌دهم. + جاده‌های روسازی‌نشده را به روسازی‌شده ترجیح می‌دهم. ویرایش‌های OSM دکمه‌ای برای آشکار/پنهان کردن منحنی‌های میزان روی نقشه. نشان‌دادن منحنی‌های میزان @@ -3438,8 +3438,8 @@ ضخیم برای بیابان‌ها و سایر نواحی با جمعیت پراکنده. جزئیات بیشتری دارد. پروفایل تازهٔ «%1$s» اضافه شود؟ - نماد ناوبری - نماد نقشه + نماد موقعیت هنگام حرکت + نماد موقعیت هنگام توقف با لمس «به‌کارگیری»، پروفایل‌های حذف‌شده برای همیشه از بین می‌روند. پروفایل اصلی انتخاب رنگ @@ -3461,4 +3461,21 @@ درون‌برد از فایل درون‌برد فایل مسیریابی درون‌برد پروفایل + + این یک پالایهٔ قطع‌کننده برای سرعت‌های پایین است تا نقاطی که سرعتشان از حدی پایین‌تر است ضبط نشوند. می‌تواند سبب شود که ردهای ضبط‌شده به‌شکل هموارتری روی نقشه دیده شوند. + اثر جانبی: همهٔ قطعه‌هایی که در آن‌ها به حداقل سرعت معیار نرسید از رد حذف خواهد شد (مثلاً هنگامی که دوچرخه‌تان را بالای یک تپه با شیب تند می‌برید). همچنین هیچ اطلاعاتی دربارهٔ بازه‌های توقف، مانند استراحت‌ها، ضبط نمی‌شود. این مسئله بر همهٔ تحلیل‌ها یا پس‌پردازش‌ها تأثیر می‌گذارد، مانند زمانی که بخواهید مسافت کلی سفر، مدت حرکت یا سرعت متوسط خود را بدانید. + توصیه: ابتدا از پالایهٔ «کمترین جابه‌جایی» به‌منظور تشخیص حرکت استفاده کنید (B). این‌گونه شاید نتایج بهتری بگیرید و همچنین دادهٔ کمتری از دست می‌دهید. اگر ردها در سرعت‌های پایین نویز دارد، برای اینجا از مقدارهای غیرصفر استفاده کنید. لطفاً توجه نمایید که برخی اندازه‌گیری‌ها ممکن است اصلاً هیچ سرعتی را گزارش نکنند (برخی روش‌های مبتنی بر شبکه)، که در این صورت هیچ چیزی ضبط نخواهد شد. + توجه: بررسی «سرعت>۰»: بیشتر چیپست‌های GPS فقط در صورتی مقدار سرعت را گزارش می‌کنند که الگوریتم، شما را در حال حرکت تشخیص دهد و اگر در حال حرکت نباشید چیزی گزارش نمی‌کنند. بنابراین استفاده از تنظیم «>۰» در این پالایه، به تشخیص حرکت توسط چیپست GPS وابسته است. البته حتی اگر این پالایش در زمان ضبط انجام نشود، ما از این ویژگی در تحلیل‌های GPX خود استفاده می‌کنیم تا مسافت اصلاح‌شده را محاسبه کنیم؛ یعنی مقداری که برای «مسافت اصلاح‌شده» گزارش می‌کنیم میزان مسافتی است که در هنگام حرکت ضبط شده. + این مورد فقط نقاطی را ضبط می‌کند که با شاخص کمترین صحت (به متر/فوت، مطابق گزارش اندروید از چیپست) اندازه‌گیری شده‌اند. منظور از صحت، نمودار نقطه‌ای اندازه‌گیری‌های تکراری است و مستقیماً مربوط به دقت نمی‌شود (دقت: میزان نزدیکی اندازه‌گیری‌ها به موقعیت واقعی). + اثر جانبی: درنتیجهٔ پالایش بر اساس صحت، ممکن است مثلاً زیر پل‌ها، زیر درختان، میان ساختمان‌های بلند یا در شرایط جوّی بخصوص، نقاط تماماً از دست بروند. + توصیه: سخت است آنچه ثبت می‌شود یا آنچه ثبت نمی‌شود را پیشبینی کنیم. شاید بهتر باشد این پالایه را خاموش کنید. + توجه: اگر بلافاصله پیش از ضبط، GPS خاموش بوده، ممکن است نخستین نقطه صحت کمتری داشته باشد؛ بنابراین ممکن است بخواهیم طوری کدنویسی کنیم که یک نقطه با یک یا چند ثانیه تأخیر ضبط شود (یا از سه نقطهٔ پی‌درپی بهترینشان را ضبط کنیم و...)، البته این هنوز انجام نشده. + اعلان + کمترین سرعت + کمترین صحت + کمترین جابجایی + منو — مکان‌های من — ردها + منو — مکان‌های من — یادداشت‌ها + منو — مکان‌های من — ویرایش‌های OSM + بازنشانی تنظیمات افزونه به پیشفرض \ No newline at end of file From 6564328c3bead89036f2265c4186d8d1853d0af6 Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Mon, 27 Jan 2020 18:14:37 +0000 Subject: [PATCH 31/45] Translated using Weblate (Sardinian) Currently translated at 94.6% (2987 of 3156 strings) --- OsmAnd/res/values-sc/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 1f71f3970e..24a2656c8a 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -3466,4 +3466,7 @@ Pro praghere iscrie su còdighe intreu Imprea s\'aplicatzione de sistema Sonu de s\'oturadore de sa fotocàmera S\'autorizatzione est resèssida + Impòsitu: Proa a impreare, in antis, su rilevamentu de movimentu pro mèdiu de sul filtru de movimentu mìnimu (B). Diat pòdere produire risultados mègius, e tue dias pòdere pèrdere datos de mancu. Si sas rastas tuas abarrant burdellosas a lestresas bassas, proa a impreare inoghe valores diferentes dae zero. Pro praghere ammenta·ti chi carchi mèdida diat pòdere non rilevare perunu valore de lestresa (unas àteras maneras basadas in subra de sa retza), e chi in custu casu non dias registrare nudda. + Impòsitu: est prus difìtzile a intzertare ite at a èssere registradu e ite nono. Diat èssere mègius a istudare custu filtru. + Intervallu tampone (buffer) \ No newline at end of file From 54922744b7d40a09f2d6efe0b340ec9ae80e78c7 Mon Sep 17 00:00:00 2001 From: Franco Date: Mon, 27 Jan 2020 16:59:15 +0000 Subject: [PATCH 32/45] Translated using Weblate (Spanish (Argentina)) Currently translated at 98.5% (3108 of 3156 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 72 +++++++++++++++++----------- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 9b48719030..c3934c4271 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -2299,23 +2299,11 @@ Lon %2$s \n ¡Más países alrededor del globo están disponibles para descargar! \n Obtén un navegador confiable en tu país - ya sea Francia, Alemania, México, Reino Unido, España, Países bajos, Estados Unidos, Rusia, Brasil o cualquier otro. "Navegación GPS -\n -\n \n • Funciona en línea (rápido) o sin conexión (sin cargos de roaming al viajar al extranjero) -\n -\n \n • Guía por voz giro-a-giro (voces grabadas y sintetizadas) -\n -\n \n • (Opcional) Guía de carriles, nombres de calles y tiempo estimado al destino -\n -\n \n • Admite puntos intermedios en el itinerario -\n -\n \n • La ruta se recalcula al salirse de la misma -\n -\n \n • Busca destinos por dirección, por tipo (por ejemplo: Restaurantes, hoteles, estaciones de servicio, museos), o por coordenada geográfica " Vista del mapa \n • Muestra tu ubicación y orientación @@ -3347,8 +3335,8 @@ Lon %2$s Usado %1$s MB Usado %1$s kB Curvas de nivel y sombreado - Preferir ruta sin pavimentar - Prefiere rutas sin pavimentar. + Preferir caminos sin pavimentar + Prefiere caminos sin pavimentar. Actualizar todos los mapas ¿Actualizar todos los mapas (%1$d)\? • Ajustes de la aplicación y del perfil actualizados. Cómoda distribución de los ajustes por tipo y posibilidad de personalizar cada perfil @@ -3370,8 +3358,8 @@ Lon %2$s \n Puedes aplicar este cambio a todos los perfiles o sólo al marcado. Compartido - Preferir rutas sin pavimentar - Ruta por terreno sin pavimento. + Preferir caminos sin pavimentar + Prefiere los caminos sin pavimentar a los pavimentados para el trazado de rutas. Ediciones de OSM Un botón que muestra u oculta las curvas de nivel en el mapa. Mostrar curvas de nivel @@ -3388,13 +3376,13 @@ Lon %2$s El perfil «%1$s» ya existe. ¿Sobrescribir\? No se pudo exportar el perfil. Importar perfil - Añade un perfil abriendo el archivo en OsmAnd. + Añade un perfil abriendo este archivo con OsmAnd. Error de importación de %1$s: %2$s %1$s importado. Blanco Alternar %1$s y %2$s Punto de partida - Estima el tiempo de llegada para los tipos de caminos desconocidos, y limita la velocidad para todos los caminos (puede desviarse) + Estima el tiempo de llegada para los tipos de caminos desconocidos, y limita la velocidad para todos los caminos (puede afectar a la ruta) Traza guardada Nombre del archivo vacío Revertir @@ -3414,27 +3402,27 @@ Lon %2$s Unir segmentos ¿Añadir el nuevo perfil «%1$s»\? Incluir rumbo - Guarda el rumbo para cada punto de la traza durante el seguimiento. + Guarda el rumbo para cada punto de la traza durante la grabación. %1$s • %2$s %1$s, %2$s Personal Descargando %s Espesor Para desiertos y otras zonas escasamente pobladas. Más detallado. - Icono de navegación - Icono del mapa - Al pulsar en «Aplicar», todos los perfiles serán borrados completamente. + Icono de la ubicación mientras se mueve + Icono de la ubicación en reposo + Al pulsar en «Aplicar», los perfiles borrados se perderán completamente. Perfil principal Elegir el color - Los perfiles de OsmAnd se pueden mover a la parte inferior, pero no se pueden borrar. Vuelve para quitarlos. + Los perfiles predefinidos de OsmAnd no se pueden borrar, sino desactivar (en la pantalla anterior) u ordenarse en la parte inferior. Editar perfiles - El «Tipo de navegación» afecta a las reglas para los cálculos de la ruta. + El «Tipo de navegación» rige la forma en que se calculan las rutas. Aspecto del perfil Icono, color y nombre Editar la lista de perfiles Perfil marcado - Al pulsar en «%1$s», se perderán todos los cambios. - Todos los ajustes del perfil volverán a los valores predefinidos de la instalación. + Al pulsar en «%1$s», serán descartados todos los cambios. + Restablecer todos los ajustes del perfil a los valores predefinidos de la instalación. ¿Restablecer todos los ajustes del perfil\? %1$s %2$s %1$s: %2$s @@ -3452,7 +3440,7 @@ Lon %2$s Seguimiento en línea Precisión de registro Puedes encontrar todas tus trazas grabadas en «%1$s» o en la carpeta OsmAnd usando el administrador de archivos. - Puedes encontrar todas tus notas en «%1$s» + Puedes encontrar todas tus notas en «%1$s». Notas de video Notas fotográficas Recálculo de la ruta @@ -3462,10 +3450,36 @@ Lon %2$s Edición de OSM Puedes ver todas tus ediciones no subidas o errores de OSM en «%1$s». Los puntos subidos no se muestran en OsmAnd. OSM - El icono sólo se muestra mientras se navega o se mueve. - El icono del mapa sólo se muestra en el mapa. + El icono se muestra mientras se navega o se mueve. + El icono se muestra en reposo. Comprueba y comparte los registros detallados de la aplicación No se puede analizar la geointención «%s». Se necesita permiso para usar esta opción. Se trata de un filtro de corte de baja velocidad para no grabar puntos por debajo de una cierta velocidad. Esto puede hacer que las trazas grabadas se vean más suaves cuando se muestran en el mapa. + Efecto secundario: En la traza faltarán todos los tramos en los que no se haya cumplido el criterio de velocidad mínima (por ejemplo, cuando se empuja la bicicleta por una colina empinada). Además, no habrá información sobre los períodos de descanso, como las pausas. Esto tiene efectos en cualquier análisis o post-proceso, como cuando se trata de determinar la duración total del viaje, el tiempo en movimiento, o la velocidad promedio. + Recomendación: Prueba primero a utilizar la detección de movimiento mediante el filtro de desplazamiento mínimo de registro (B), puede producir mejores resultados y perderá menos datos. Si las trazas siguen siendo ruidosas a bajas velocidades, prueba aquí con valores distintos de cero. Tenga en cuenta que algunas mediciones pueden no informar ningún valor de velocidad (algunos métodos basados en la red), en cuyo caso no se registraría nada. + Observación: comprobar velocidad > 0: La mayoría de los chipsets de GPS informan un valor de velocidad sólo si el algoritmo determina que está en movimiento. Por lo tanto, el uso del ajuste > 0 en este filtro, en cierto sentido utiliza la detección de movimiento del conjunto de chips del GPS. Pero incluso si no se filtra aquí en el momento de la grabación, seguimos utilizando esta función en nuestro análisis GPX para determinar la distancia corregida, es decir, el valor que se muestra en ese campo es la distancia grabada en movimiento. + Esto registrará solo los puntos medidos con una indicación de precisión mínima (en metros o pies, según lo informado por Android para su conjunto de chips). La precisión se refiere a la dispersión de mediciones repetidas, y no está directamente relacionada con la precisión, que define qué tan cerca están sus mediciones de su posición real. + Efecto secundario: Como resultado del filtrado por precisión, pueden faltar puntos por ejemplo debajo de puentes, bajo árboles, entre edificios altos o con ciertas condiciones climáticas. + Recomendación: Es difícil predecir lo que se grabará y lo que no, puede ser mejor apagar este filtro. + Observación: Si el GPS se hubiera apagado inmediatamente antes de una grabación, el primer punto medido podría tener una precisión disminuida, por lo que en nuestro código puede que queramos esperar un segundo más o menos antes de grabar un punto (o grabar el mejor de 3 puntos consecutivos, etc.), pero esto todavía no se ha implementado. + Este filtro evita que se registren puntos duplicados en los que puede haber muy poco movimiento real, y da un aspecto espacial más agradable a las pistas que no se procesan posteriormente. + Efectos secundarios: Los períodos de descanso no se registran en absoluto o sólo en un punto cada uno. Los pequeños movimientos (del mundo real) (por ejemplo, hacia los lados, para marcar un posible desvío en su viaje) pueden ser filtrados. Su archivo contiene menos información para el post-procesamiento, y tiene peores estadísticas al filtrar los puntos obviamente redundantes en el tiempo de grabación, mientras que potencialmente mantiene los artefactos causados por la mala recepción o los efectos del chipset del GPS. + Recomendación: Un ajuste de 5 metros puede funcionar bien si no necesitas capturar detalles más finos que eso, y no deseas capturar explícitamente los datos mientras está en reposo. + Memoria intermedia + Intervalo de seguimiento + Dirección web + Indica la dirección web con sintaxis de parámetros : lat={0}, lon={1}, timestamp={2}, hdop={3}, altitude={4}, speed={5}, bearing={6}. + Notificación + Velocidad mínima + Precisión mínima + Desplazamiento mínimo + Menú — Mis sitios — Trazas + Menú — Mis sitios — Notas + Menú — Mis sitios — Ediciones de OSM + Restablecer ajustes del complemento a valores predefinidos + División de grabación + Usar la aplicación del sistema + Reproducir sonido al fotografiar + Autorización exitosa \ No newline at end of file From 4758987a48f198a0f5b89a91106a7bb51548159d Mon Sep 17 00:00:00 2001 From: Franco Date: Mon, 27 Jan 2020 18:15:17 +0000 Subject: [PATCH 33/45] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3766 of 3766 strings) --- OsmAnd/res/values-es-rAR/phrases.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml index ef4ab358ab..ad54870d9d 100644 --- a/OsmAnd/res/values-es-rAR/phrases.xml +++ b/OsmAnd/res/values-es-rAR/phrases.xml @@ -3791,4 +3791,5 @@ Activo Inactivo Número de erupciones + Bicicleta fantasma \ No newline at end of file From a240dec39e5c4f0f40726ef8df65544218019c88 Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Mon, 27 Jan 2020 18:23:25 +0000 Subject: [PATCH 34/45] Translated using Weblate (Sardinian) Currently translated at 100.0% (266 of 266 strings) Translation: OsmAnd/Telegram Translate-URL: https://hosted.weblate.org/projects/osmand/telegram/sc/ --- OsmAnd-telegram/res/values-sc/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd-telegram/res/values-sc/strings.xml b/OsmAnd-telegram/res/values-sc/strings.xml index 5198a5c437..cb4d03169f 100644 --- a/OsmAnd-telegram/res/values-sc/strings.xml +++ b/OsmAnd-telegram/res/values-sc/strings.xml @@ -262,4 +262,9 @@ Cunsigiadu Istadu de s\'arrastadore de OsmAnd Torra a OsmAnd + Ùrtimu agiornamentu dae Telegram: %1$s + Ùrtima risposta: %1$s + Ùrtimu agiornamentu dae Telegram: %1$s a como + Ùrtima risposta: %1$s a como + %1$s a como \ No newline at end of file From 5404f626ec59e8bfbc0a9db7c2827c1048a7e9dc Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Wed, 29 Jan 2020 10:19:23 +0200 Subject: [PATCH 35/45] add npe checks --- OsmAnd/src/net/osmand/plus/TargetPointsHelper.java | 4 +++- OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java index 046456a172..005e38d71e 100644 --- a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java +++ b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java @@ -445,7 +445,9 @@ public class TargetPointsHelper { Location lastKnownLocation = ctx.getLocationProvider().getLastKnownLocation(); LatLon latLon = lastKnownLocation != null ? new LatLon(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude()) : null; - routingHelper.checkAndUpdateStartLocation(latLon); + if (latLon != null) { + routingHelper.checkAndUpdateStartLocation(latLon); + } setMyLocationPoint(latLon, false, null); } } diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 401d8c7584..75ca6d2dd0 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -174,7 +174,9 @@ public class RoutingHelper { } public synchronized void setFinalAndCurrentLocation(LatLon finalLocation, List intermediatePoints, Location currentLocation){ - checkAndUpdateStartLocation(currentLocation); + if (currentLocation != null) { + checkAndUpdateStartLocation(currentLocation); + } RouteCalculationResult previousRoute = route; clearCurrentRoute(finalLocation, intermediatePoints); // to update route From 2481142f0b01bd7220bcb09651206e43aba06e06 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Wed, 29 Jan 2020 11:25:05 +0200 Subject: [PATCH 36/45] add npe checks --- OsmAnd/src/net/osmand/plus/TargetPointsHelper.java | 4 +--- .../src/net/osmand/plus/routing/RoutingHelper.java | 14 +++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java index 005e38d71e..046456a172 100644 --- a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java +++ b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java @@ -445,9 +445,7 @@ public class TargetPointsHelper { Location lastKnownLocation = ctx.getLocationProvider().getLastKnownLocation(); LatLon latLon = lastKnownLocation != null ? new LatLon(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude()) : null; - if (latLon != null) { - routingHelper.checkAndUpdateStartLocation(latLon); - } + routingHelper.checkAndUpdateStartLocation(latLon); setMyLocationPoint(latLon, false, null); } } diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 75ca6d2dd0..11c0d56d9e 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -174,9 +174,7 @@ public class RoutingHelper { } public synchronized void setFinalAndCurrentLocation(LatLon finalLocation, List intermediatePoints, Location currentLocation){ - if (currentLocation != null) { - checkAndUpdateStartLocation(currentLocation); - } + checkAndUpdateStartLocation(currentLocation); RouteCalculationResult previousRoute = route; clearCurrentRoute(finalLocation, intermediatePoints); // to update route @@ -268,10 +266,12 @@ public class RoutingHelper { } public void checkAndUpdateStartLocation(LatLon newStartLocation) { - LatLon lastStartLocation = app.getSettings().getLastStartPoint(); - if (lastStartLocation == null || MapUtils.getDistance(newStartLocation, lastStartLocation) > CACHE_RADIUS) { - app.getMapViewTrackingUtilities().detectDrivingRegion(newStartLocation); - app.getSettings().setLastStartPoint(newStartLocation); + if (newStartLocation != null) { + LatLon lastStartLocation = app.getSettings().getLastStartPoint(); + if (lastStartLocation == null || MapUtils.getDistance(newStartLocation, lastStartLocation) > CACHE_RADIUS) { + app.getMapViewTrackingUtilities().detectDrivingRegion(newStartLocation); + app.getSettings().setLastStartPoint(newStartLocation); + } } } From deefab0f8c8c96edbaf56cbd25955b5a4574dcd3 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Wed, 29 Jan 2020 11:31:19 +0200 Subject: [PATCH 37/45] add npe checks 2 --- OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 11c0d56d9e..b9973c6ebe 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -262,7 +262,9 @@ public class RoutingHelper { return finalLocation; } public void checkAndUpdateStartLocation(Location nextStartLocation) { - checkAndUpdateStartLocation(new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude())); + if (nextStartLocation != null) { + checkAndUpdateStartLocation(new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude())); + } } public void checkAndUpdateStartLocation(LatLon newStartLocation) { From d8012120c085fd0f8df33a3854edc234021fb56c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 29 Jan 2020 12:07:34 +0200 Subject: [PATCH 38/45] Fix points update via callback --- .../telegram/InitAppBroadcastReceiver.kt | 9 +++-- .../osmand/telegram/TelegramApplication.kt | 4 +-- .../telegram/helpers/OsmandAidlHelper.kt | 34 +++++++++++++------ .../telegram/helpers/ShowLocationHelper.kt | 13 +++++-- 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/InitAppBroadcastReceiver.kt b/OsmAnd-telegram/src/net/osmand/telegram/InitAppBroadcastReceiver.kt index 362bc028a4..02a89618af 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/InitAppBroadcastReceiver.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/InitAppBroadcastReceiver.kt @@ -7,6 +7,11 @@ import android.content.Intent class InitAppBroadcastReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { - // do nothing, TelegramApplication already initialized + // check if aidl connection was lost + val app = context.applicationContext as TelegramApplication + val aidlHelper = app.osmandAidlHelper + if (aidlHelper.isOsmandBound() && !aidlHelper.isOsmandConnected()) { + aidlHelper.connectOsmand() + } } -} +} \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt index 1eda69b2dd..ee6bbb29d4 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt @@ -42,7 +42,7 @@ class TelegramApplication : Application() { telegramHelper.messageActiveTimeSec = settings.locHistoryTime uiUtils = UiUtils(this) osmandAidlHelper = OsmandAidlHelper(this) - osmandAidlHelper.listener = object : OsmandHelperListener { + osmandAidlHelper.addConnectionListener(object : OsmandHelperListener { override fun onOsmandConnectionStateChanged(connected: Boolean) { if (connected) { osmandAidlHelper.clearNavDrawerItems("net.osmand.telegram") @@ -60,7 +60,7 @@ class TelegramApplication : Application() { showLocationHelper.addOrUpdateStatusWidget(-1, false) } } - } + }) osmandAidlHelper.setUpdatesListener(object : UpdatesListener { override fun update() { if (settings.hasAnyChatToShowOnMap()) { diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt index 6ff7d5fe80..dd93c294db 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt @@ -58,6 +58,8 @@ class OsmandAidlHelper(private val app: TelegramApplication) { const val OSMAND_NIGHTLY_PACKAGE_NAME = "net.osmand.dev" const val UPDATE_TIME_MS = 5000L + + private const val CALLBACK_INVALID_ID = -1L } private var mIOsmAndAidlInterface: IOsmAndAidlInterface? = null @@ -68,7 +70,7 @@ class OsmandAidlHelper(private val app: TelegramApplication) { private var osmandUpdatesCallbackId: Long = -1 private var osmandContextMenuCallbackId: Long = -1 - var listener: OsmandHelperListener? = null + private val connectionListeners = HashSet() interface OsmandHelperListener { fun onOsmandConnectionStateChanged(connected: Boolean) @@ -133,6 +135,14 @@ class OsmandAidlHelper(private val app: TelegramApplication) { } } + fun addConnectionListener(listener: OsmandHelperListener) { + connectionListeners.add(listener) + } + + fun removeConnectionListener(listener: OsmandHelperListener) { + connectionListeners.remove(listener) + } + fun setSearchCompleteListener(mSearchCompleteListener: SearchCompleteListener) { this.mSearchCompleteListener = mSearchCompleteListener } @@ -155,7 +165,7 @@ class OsmandAidlHelper(private val app: TelegramApplication) { this.mUpdatesListener = mUpdatesListener } - fun updatesCallbackRegistered() = osmandUpdatesCallbackId > 0 + fun updatesCallbackRegistered() = osmandUpdatesCallbackId > CALLBACK_INVALID_ID /** * Class for interacting with the main interface of the service. */ @@ -169,16 +179,18 @@ class OsmandAidlHelper(private val app: TelegramApplication) { // representation of that from the raw service object. mIOsmAndAidlInterface = IOsmAndAidlInterface.Stub.asInterface(service) initialized = true - //Toast.makeText(app, "OsmAnd connected", Toast.LENGTH_SHORT).show() - listener?.onOsmandConnectionStateChanged(true) + connectionListeners.forEach { + it.onOsmandConnectionStateChanged(true) + } } override fun onServiceDisconnected(className: ComponentName) { // This is called when the connection with the service has been // unexpectedly disconnected -- that is, its process crashed. mIOsmAndAidlInterface = null - //Toast.makeText(app, "OsmAnd disconnected", Toast.LENGTH_SHORT).show() - listener?.onOsmandConnectionStateChanged(false) + connectionListeners.forEach { + it.onOsmandConnectionStateChanged(false) + } } } @@ -193,7 +205,7 @@ class OsmandAidlHelper(private val app: TelegramApplication) { fun isOsmandConnected(): Boolean { return mIOsmAndAidlInterface != null } - + /** * Get list of active GPX files. * @@ -1162,20 +1174,20 @@ class OsmandAidlHelper(private val app: TelegramApplication) { if (mIOsmAndAidlInterface != null) { try { osmandUpdatesCallbackId = mIOsmAndAidlInterface!!.registerForUpdates(UPDATE_TIME_MS, mIOsmAndAidlCallback) - return osmandUpdatesCallbackId > 0 + return osmandUpdatesCallbackId > CALLBACK_INVALID_ID } catch (e: RemoteException) { e.printStackTrace() } } return false } - + fun unregisterFromUpdates(): Boolean { if (mIOsmAndAidlInterface != null) { try { val unregistered = mIOsmAndAidlInterface!!.unregisterFromUpdates(osmandUpdatesCallbackId) if (unregistered) { - osmandUpdatesCallbackId = 0 + osmandUpdatesCallbackId = CALLBACK_INVALID_ID } return unregistered } catch (e: RemoteException) { @@ -1222,7 +1234,7 @@ class OsmandAidlHelper(private val app: TelegramApplication) { val params = RemoveContextMenuButtonsParams(paramsId, osmandContextMenuCallbackId) val removed = mIOsmAndAidlInterface!!.removeContextMenuButtons(params) if (removed) { - osmandContextMenuCallbackId = -1 + osmandContextMenuCallbackId = CALLBACK_INVALID_ID } return removed } catch (e: RemoteException) { diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt index fbe168c62a..adf59d90c9 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt @@ -77,6 +77,15 @@ class ShowLocationHelper(private val app: TelegramApplication) { private var forcedStop: Boolean = false init { + app.osmandAidlHelper.addConnectionListener(object : OsmandAidlHelper.OsmandHelperListener { + override fun onOsmandConnectionStateChanged(connected: Boolean) { + if (!connected && showingLocation && !app.settings.monitoringEnabled) { + if (isUseOsmandCallback() && app.osmandAidlHelper.updatesCallbackRegistered()) { + showingLocation = false + } + } + } + }) app.osmandAidlHelper.setContextMenuButtonsListener(object : ContextMenuButtonsListener { override fun onContextMenuButtonClicked(buttonId: Int, pointId: String, layerId: String) { @@ -137,7 +146,7 @@ class ShowLocationHelper(private val app: TelegramApplication) { osmandAidlHelper.showMapPoint(MAP_LAYER_ID, pointId, name, name, item.chatTitle, Color.WHITE, aLatLon, details, params) } } - + fun updateLocationsOnMap() { osmandAidlHelper.execOsmandApi { val messages = telegramHelper.getMessages() @@ -427,7 +436,7 @@ class ShowLocationHelper(private val app: TelegramApplication) { forcedStop = force if (showingLocation) { showingLocation = false - if (isUseOsmandCallback() && app.osmandAidlHelper.updatesCallbackRegistered()) { + if (isUseOsmandCallback() && osmandAidlHelper.updatesCallbackRegistered()) { osmandAidlHelper.unregisterFromUpdates() } else if (!app.settings.monitoringEnabled) { app.stopUserLocationService() From 154d9651a8f219d5516a11a8519c93b09a5b1426 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Wed, 29 Jan 2020 15:31:00 +0300 Subject: [PATCH 39/45] Add phrase --- OsmAnd/res/values/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 26e6050c65..5700c195b2 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4181,4 +4181,6 @@ Paintball + Mountain rescue + From f6229444123696369ea6ecd6591ddba341f5ec58 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Wed, 29 Jan 2020 20:20:04 +0300 Subject: [PATCH 40/45] Add phrase --- OsmAnd/res/values/phrases.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 5700c195b2..ac60f18c9f 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4182,5 +4182,6 @@ Paintball Mountain rescue + Security store From cf8eef64a4a54280aaeb56fee2b4c89eb0d7e5f9 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Thu, 30 Jan 2020 11:36:22 +0200 Subject: [PATCH 41/45] fix params --- .../net/osmand/plus/render/MapRenderRepositories.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java index f6b5837e09..c5bfc2e9f3 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java +++ b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java @@ -366,7 +366,7 @@ public class MapRenderRepositories { coordinantes[2 * k + 1] = r.getPoint31YTile(k); } BinaryMapDataObject mo = new BinaryMapDataObject( r.getId(), coordinantes, new int[0][], - RenderingRulesStorage.LINE_RULES, true, roTypes, null); + RenderingRulesStorage.LINE_RULES, true, roTypes, null, 0,0); TIntObjectHashMap names = r.getNames(); if(names != null) { TIntObjectIterator it = names.iterator(); @@ -472,7 +472,7 @@ public class MapRenderRepositories { topY}; BinaryMapDataObject o = new BinaryMapDataObject(-1, coordinates, new int[0][], RenderingRulesStorage.POLYGON_RULES, true, - new int[]{ocean[0] && !land[0] ? mi.coastlineEncodingType : (mi.landEncodingType)}, null); + new int[]{ocean[0] && !land[0] ? mi.coastlineEncodingType : (mi.landEncodingType)}, null, 0, 0); o.setMapIndex(mi); tempResult.add(o); } @@ -982,7 +982,7 @@ public class MapRenderRepositories { coordinates[j * 2 + 1] = (int) (ring.get(j) & mask); } BinaryMapDataObject o = new BinaryMapDataObject(dbId, coordinates, - new int[0][], RenderingRulesStorage.POLYGON_RULES, true, new int[] { mapIndex.coastlineBrokenEncodingType }, null); + new int[0][], RenderingRulesStorage.POLYGON_RULES, true, new int[] { mapIndex.coastlineBrokenEncodingType }, null, 0,0); o.setMapIndex(mapIndex); result.add(o); } @@ -1002,7 +1002,7 @@ public class MapRenderRepositories { clockwiseFound = clockwiseFound || clockwise; BinaryMapDataObject o = new BinaryMapDataObject(dbId, coordinates, new int[0][], RenderingRulesStorage.POLYGON_RULES, true, new int[] { clockwise ? mapIndex.coastlineEncodingType - : mapIndex.landEncodingType }, null); + : mapIndex.landEncodingType }, null, 0,0); o.setMapIndex(mapIndex); o.setArea(true); result.add(o); @@ -1012,7 +1012,7 @@ public class MapRenderRepositories { // add complete water tile BinaryMapDataObject o = new BinaryMapDataObject(dbId, new int[] { leftX, topY, rightX, topY, rightX, bottomY, leftX, bottomY, leftX, topY }, - new int[0][], RenderingRulesStorage.POLYGON_RULES, true, new int[] { mapIndex.coastlineEncodingType }, null); + new int[0][], RenderingRulesStorage.POLYGON_RULES, true, new int[] { mapIndex.coastlineEncodingType }, null, 0,0); o.setMapIndex(mapIndex); log.info("!!! Isolated islands !!!"); //$NON-NLS-1$ result.add(o); From 0703dd9636e2913716db559bb68a5674d7c30486 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Thu, 30 Jan 2020 12:37:42 +0300 Subject: [PATCH 42/45] Change phrase name --- OsmAnd/res/values-da/phrases.xml | 2 +- OsmAnd/res/values-de/phrases.xml | 2 +- OsmAnd/res/values-eo/phrases.xml | 2 +- OsmAnd/res/values-es-rAR/phrases.xml | 2 +- OsmAnd/res/values-es-rUS/phrases.xml | 2 +- OsmAnd/res/values-es/phrases.xml | 2 +- OsmAnd/res/values-et/phrases.xml | 2 +- OsmAnd/res/values-gl/phrases.xml | 2 +- OsmAnd/res/values-hu/phrases.xml | 2 +- OsmAnd/res/values-pt-rBR/phrases.xml | 2 +- OsmAnd/res/values-pt/phrases.xml | 2 +- OsmAnd/res/values-ru/phrases.xml | 2 +- OsmAnd/res/values-sc/phrases.xml | 2 +- OsmAnd/res/values-uk/phrases.xml | 2 +- OsmAnd/res/values-zh-rTW/phrases.xml | 2 +- OsmAnd/res/values/phrases.xml | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index 1450b1bfa4..e44af3601d 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -3785,7 +3785,7 @@ Maar Caldera Lavadome - J́ord + J́ord Sidste udbrud Uddød Sovende diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index 715dbe3041..50a120eea6 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -3780,7 +3780,7 @@ Maar Caldera Lavadom - Erde + Erde Letzter Ausbruch Erloschen Ruhend diff --git a/OsmAnd/res/values-eo/phrases.xml b/OsmAnd/res/values-eo/phrases.xml index 7819e8d094..b2269f6c6b 100644 --- a/OsmAnd/res/values-eo/phrases.xml +++ b/OsmAnd/res/values-eo/phrases.xml @@ -3770,7 +3770,7 @@ malprofund‑kratera (maaro) kaldero lafkupolo - ŝlimvulkano + ŝlimvulkano Antaŭa erupcio neaktiva dormanta diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml index ad54870d9d..84847a8f7f 100644 --- a/OsmAnd/res/values-es-rAR/phrases.xml +++ b/OsmAnd/res/values-es-rAR/phrases.xml @@ -3784,7 +3784,7 @@ Maar Caldera Cúpula de lava - Tierra (lodosa) + Tierra (lodosa) Última erupción Extinto Latente o dormido diff --git a/OsmAnd/res/values-es-rUS/phrases.xml b/OsmAnd/res/values-es-rUS/phrases.xml index f99d5a8f6c..875f65d017 100644 --- a/OsmAnd/res/values-es-rUS/phrases.xml +++ b/OsmAnd/res/values-es-rUS/phrases.xml @@ -3784,7 +3784,7 @@ Maar Caldera Cúpula de lava - Tierra (lodosa) + Tierra (lodosa) Última erupción Extinto Latente o dormido diff --git a/OsmAnd/res/values-es/phrases.xml b/OsmAnd/res/values-es/phrases.xml index ade81e0967..7dba16b44c 100644 --- a/OsmAnd/res/values-es/phrases.xml +++ b/OsmAnd/res/values-es/phrases.xml @@ -3778,7 +3778,7 @@ Maar Caldera Cúpula de lava - Tierra + Tierra Última erupción Extinto Latente diff --git a/OsmAnd/res/values-et/phrases.xml b/OsmAnd/res/values-et/phrases.xml index 42dace0c6e..42528c34d6 100644 --- a/OsmAnd/res/values-et/phrases.xml +++ b/OsmAnd/res/values-et/phrases.xml @@ -3759,7 +3759,7 @@ Maar Kaldeera Laava kuppel - Muld + Muld Viimane purse Kustunud Tegevusetu diff --git a/OsmAnd/res/values-gl/phrases.xml b/OsmAnd/res/values-gl/phrases.xml index a2d621a450..035cd085d2 100644 --- a/OsmAnd/res/values-gl/phrases.xml +++ b/OsmAnd/res/values-gl/phrases.xml @@ -3770,7 +3770,7 @@ Maar Caldeira Cúpula de lava - Terra + Terra Última erupción Extinguido Dormente diff --git a/OsmAnd/res/values-hu/phrases.xml b/OsmAnd/res/values-hu/phrases.xml index 5c640191de..16d5468953 100644 --- a/OsmAnd/res/values-hu/phrases.xml +++ b/OsmAnd/res/values-hu/phrases.xml @@ -3770,7 +3770,7 @@ Maar-vulkán Kaldera Lávakupola - Sárvulkán + Sárvulkán Utolsó kitörés Kialudt Szunnyadó diff --git a/OsmAnd/res/values-pt-rBR/phrases.xml b/OsmAnd/res/values-pt-rBR/phrases.xml index 1d057c1340..9838056910 100644 --- a/OsmAnd/res/values-pt-rBR/phrases.xml +++ b/OsmAnd/res/values-pt-rBR/phrases.xml @@ -3777,7 +3777,7 @@ Maar Caldeira Domo de lava - Terra (lamacenta) + Terra (lamacenta) Última erupção Extinto Dormente diff --git a/OsmAnd/res/values-pt/phrases.xml b/OsmAnd/res/values-pt/phrases.xml index 69fe54d268..572e50ceee 100644 --- a/OsmAnd/res/values-pt/phrases.xml +++ b/OsmAnd/res/values-pt/phrases.xml @@ -3762,7 +3762,7 @@ Maar Caldera Cúpula de lava - Sujeira + Sujeira Última erupção Extinto Dormente diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index d9f3e4afb5..95e72ca7b6 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3650,7 +3650,7 @@ Маар Калдера Лавовый купол - Грязевой + Грязевой Последнее извержение Потухший Спящий diff --git a/OsmAnd/res/values-sc/phrases.xml b/OsmAnd/res/values-sc/phrases.xml index d5c66fba0c..ccd08b457b 100644 --- a/OsmAnd/res/values-sc/phrases.xml +++ b/OsmAnd/res/values-sc/phrases.xml @@ -3775,7 +3775,7 @@ Maar Caldera Cùpola de lava - Terra + Terra Ùrtima erutzione Istudadu Durmende diff --git a/OsmAnd/res/values-uk/phrases.xml b/OsmAnd/res/values-uk/phrases.xml index 20f40b7b7f..de7382003e 100644 --- a/OsmAnd/res/values-uk/phrases.xml +++ b/OsmAnd/res/values-uk/phrases.xml @@ -3765,7 +3765,7 @@ Маар Кальдера Лавовий купол - Брудовий + Брудовий Останнє виверження Вимерлий Сплячий diff --git a/OsmAnd/res/values-zh-rTW/phrases.xml b/OsmAnd/res/values-zh-rTW/phrases.xml index 665b5a2fc5..0379ebb581 100644 --- a/OsmAnd/res/values-zh-rTW/phrases.xml +++ b/OsmAnd/res/values-zh-rTW/phrases.xml @@ -3776,7 +3776,7 @@ 低平火山口 破火山口 火山穹丘 - 火山灰 + 火山灰 最後一次噴發 死火山 休眠火山 diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index ac60f18c9f..d3804c94e2 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4169,7 +4169,7 @@ Maar Caldera Lava dome - Dirt + Mud Last eruption Extinct Dormant From e16daa5163561dc02f4a46b7ad91bbb664646534 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Thu, 30 Jan 2020 18:22:37 +0200 Subject: [PATCH 43/45] zoom tweaks --- .../src/main/java/net/osmand/binary/BinaryMapIndexReader.java | 4 ++-- .../src/main/java/net/osmand/osm/edit/OsmMapUtils.java | 4 +--- 2 files changed, 3 insertions(+), 5 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 4117223104..9fc3a2b9dd 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -81,7 +81,7 @@ public class BinaryMapIndexReader { public final static int TRANSPORT_STOP_ZOOM = 24; public static final int SHIFT_COORDINATES = 5; - public static final int LABEL_ZOOM_ENCODE = 31; + public static final int LABEL_ZOOM_ENCODE = 26; private final static Log log = PlatformUtil.getLog(BinaryMapIndexReader.class); public static boolean READ_STATS = false; public static final SearchPoiTypeFilter ACCEPT_ALL_POI_TYPE_FILTER = new SearchPoiTypeFilter() { @@ -2120,7 +2120,7 @@ public class BinaryMapIndexReader { public static void main(String[] args) throws IOException { File fl = new File(System.getProperty("maps") + "/Synthetic_test_rendering.obf"); - fl = new File(System.getProperty("maps") + "/Belarus_europe_2.obf"); + fl = new File("/home/madwasp79/OsmAnd-maps/Poly_center2.obf"); RandomAccessFile raf = new RandomAccessFile(fl, "r"); diff --git a/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java b/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java index 06a2f6a08e..d5f3ca1b55 100644 --- a/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java +++ b/OsmAnd-java/src/main/java/net/osmand/osm/edit/OsmMapUtils.java @@ -1,6 +1,5 @@ package net.osmand.osm.edit; -import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -50,7 +49,7 @@ public class OsmMapUtils { } public static LatLon getComplexPolyCenter(Collection nodes) { - double precision = 1e-4; //where to set precision constant? + double precision = 1e-5; //where to set precision constant? final List> rings = new ArrayList<>(); List outerRing = new ArrayList<>(); @@ -100,7 +99,6 @@ public class OsmMapUtils { return null; } boolean area = w.getFirstNodeId() == w.getLastNodeId(); -// LatLon ll = area ? getMathWeightCenterForNodes(nodes) : getWeightCenterForNodes(nodes); LatLon ll = area ? getComplexPolyCenter(nodes) : getWeightCenterForNodes(nodes); if(ll == null) { return null; From 96dcf116e77fc84ffffa8d52744d66b49d7b56bf Mon Sep 17 00:00:00 2001 From: xmd5a Date: Fri, 31 Jan 2020 11:26:48 +0300 Subject: [PATCH 44/45] Add phrase --- OsmAnd/res/values/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index d3804c94e2..477e547ca3 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4184,4 +4184,6 @@ Mountain rescue Security store + Bowling center + From 3ac9b6afe2ca5cc20cb4c0b6055c36449cf4be12 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Fri, 31 Jan 2020 11:00:18 +0200 Subject: [PATCH 45/45] Fix #8182 fix French string --- OsmAnd/res/values-fr/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index a464a94da9..aa6dd4c020 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -1803,7 +1803,7 @@ Sélectionnez le bitrate audio Impossible de déterminer l\'adresse Recherche de l\'adresse - Fréquence de mise à jour + Mise à jour Télécharger uniquement en WiFi Mise à jour en temps réel Randonnée à cheval