Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	OsmAnd/src/net/osmand/plus/OsmandApplication.java
#	OsmAnd/src/net/osmand/plus/settings/datastorage/task/MoveFilesTask.java
  • Loading branch information
Flashby2 committed Apr 14, 2023
2 parents dc7c710 + e12dc66 commit c985f22
Show file tree
Hide file tree
Showing 65 changed files with 1,409 additions and 303 deletions.
3 changes: 3 additions & 0 deletions OsmAnd-java/src/main/java/net/osmand/IndexConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class IndexConstants {
public static final String GEN_LOG_EXT = ".gen.log";
public static final String HEIGHTMAP_SQLITE_EXT = ".sqlite";
public static final String DOWNLOAD_EXT = ".download";
public static final String TIF_EXT = ".tif";
public static final String TIFF_DB_EXT = ".tiff.db";

public static final String VOICE_INDEX_EXT_ZIP = ".voice.zip";
Expand Down Expand Up @@ -93,6 +94,8 @@ public class IndexConstants {
public static final String ROUTING_PROFILES_DIR = "routing/";
public static final String PLUGINS_DIR = "plugins/";
public static final String HEIGHTMAP_INDEX_DIR = "heightmap/";
public static final String GEOTIFF_SQLITE_CACHE_DIR = "geotiff_sqlite_cache/";
public static final String GEOTIFF_DIR = "geotiff/";
public static final String WEATHER_INDEX_DIR = "weather/";
public static final String WEATHER_FORECAST_DIR = "weather_forecast/";

Expand Down
1 change: 0 additions & 1 deletion OsmAnd-java/src/main/java/net/osmand/data/Amenity.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class Amenity extends MapObject {
public static final String MAPILLARY = "mapillary";
public static final String DISH = "dish";
public static final String REF = "ref";
public static final String LCN_REF = "lcn_ref";
public static final String OSM_DELETE_VALUE = "delete";
public static final String OSM_DELETE_TAG = "osmand_change";
public static final String IMAGE_TITLE = "image_title";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -361,7 +362,11 @@ public void startElement(Map<String, String> attrsMap, String name) throws XmlPu
} else if("renderingAttribute".equals(name)){ //$NON-NLS-1$
String attr = attrsMap.get("name");
RenderingRule root = new RenderingRule(new HashMap<String, String>(), false, RenderingRulesStorage.this);
renderingAttributes.put(attr, root);
if (renderingAttributes.containsKey(attr)) {
renderingAttributes.get(attr).addIfElseChildren(root);
} else {
renderingAttributes.put(attr, root);
}
stack.push(root);
} else if("renderingProperty".equals(name)){ //$NON-NLS-1$
String attr = attrsMap.get("attr");
Expand Down Expand Up @@ -562,13 +567,14 @@ private static void printRenderingRule(String indent, RenderingRule rr, PrintStr
public static void main(String[] args) throws XmlPullParserException, IOException {
STORE_ATTRIBUTES = true;
// InputStream is = RenderingRulesStorage.class.getResourceAsStream("default.render.xml");
final String loc = "/Users/victorshcherb/osmand/repos/resources/rendering_styles/";
String defaultFile = loc + "UniRS.render.xml";
final String stylesDir = System.getProperty("repo.dir") + "/resources/rendering_styles/";
String styleName = "topo";
// String styleName = "default";
if(args.length > 0) {
defaultFile = args[0];
styleName = args[0];
}
final Map<String, String> renderingConstants = new LinkedHashMap<String, String>();
InputStream is = new FileInputStream(loc + "default.render.xml");
InputStream is = new FileInputStream(stylesDir + "default.render.xml");
try {
XmlPullParser parser = PlatformUtil.newXMLPullParser();
parser.setInput(is, "UTF-8");
Expand All @@ -587,25 +593,35 @@ public static void main(String[] args) throws XmlPullParserException, IOExceptio
} finally {
is.close();
}
RenderingRulesStorage storage = new RenderingRulesStorage("default", renderingConstants);
RenderingRulesStorage storage = new RenderingRulesStorage(styleName, renderingConstants);
final RenderingRulesStorageResolver resolver = new RenderingRulesStorageResolver() {
@Override
public RenderingRulesStorage resolve(String name, RenderingRulesStorageResolver ref) throws XmlPullParserException, IOException {
RenderingRulesStorage depends = new RenderingRulesStorage(name, renderingConstants);
// depends.parseRulesFromXmlInputStream(RenderingRulesStorage.class.getResourceAsStream(name + ".render.xml"), ref);
depends.parseRulesFromXmlInputStream(new FileInputStream(loc + name + ".render.xml"), ref, false);
depends.parseRulesFromXmlInputStream(new FileInputStream(stylesDir + name + ".render.xml"), ref, false);
return depends;
}
};
is = new FileInputStream(defaultFile);

is = new FileInputStream(stylesDir + styleName + ".render.xml");
storage.parseRulesFromXmlInputStream(is, resolver, false);
if (stylesDir != null) {
for (File file : new File(stylesDir).listFiles()) {
if (file.isFile() && file.getName().endsWith("addon.render.xml")) {
InputStream is3 = new FileInputStream(file);
storage.parseRulesFromXmlInputStream(is3, resolver, true);
is3.close();
}
}
}

// storage = new RenderingRulesStorage("", null);
// new DefaultRenderingRulesStorage().createStyle(storage);
for (RenderingRuleProperty p : storage.PROPS.getCustomRules()) {
System.out.println(p.getCategory() + " " + p.getName() + " " + p.getAttrName());
}
// printAllRules(storage);
// for (RenderingRuleProperty p : storage.PROPS.getCustomRules()) {
// System.out.println(p.getCategory() + " " + p.getName() + " " + p.getAttrName());
// }
printAllRules(storage);
// testSearch(storage);
}

Expand All @@ -614,13 +630,16 @@ protected static void testSearch(RenderingRulesStorage storage) {
// int count = 100000;
// for (int i = 0; i < count; i++) {
RenderingRuleSearchRequest searchRequest = new RenderingRuleSearchRequest(storage);
searchRequest.setStringFilter(storage.PROPS.R_TAG, "highway");
searchRequest.setStringFilter(storage.PROPS.R_VALUE, "residential");
// searchRequest.setStringFilter(storage.PROPS.R_ADDITIONAL, "leaf_type=broadleaved");
searchRequest.setStringFilter(storage.PROPS.R_TAG, "contour");
searchRequest.setStringFilter(storage.PROPS.R_VALUE, "elevation");
searchRequest.setStringFilter(storage.PROPS.R_ADDITIONAL, "contourtype=10m");
// searchRequest.setIntFilter(storage.PROPS.R_LAYER, 1);
searchRequest.setIntFilter(storage.PROPS.R_MINZOOM, 13);
searchRequest.setIntFilter(storage.PROPS.R_MAXZOOM, 13);
searchRequest.setIntFilter(storage.PROPS.R_MINZOOM, 15);
searchRequest.setIntFilter(storage.PROPS.R_MAXZOOM, 15);
// searchRequest.setBooleanFilter(storage.PROPS.R_NIGHT_MODE, true);
searchRequest.setStringFilter(storage.PROPS.get("contourColorScheme"), "yellow");
searchRequest.setStringFilter(storage.PROPS.get("contourLines"), "15");

// for (RenderingRuleProperty customProp : storage.PROPS.getCustomRules()) {
// if (customProp.isBoolean()) {
// searchRequest.setBooleanFilter(customProp, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,9 @@ private void inferCommonActiveLane(TurnType currentTurn, TurnType nextTurn) {
singleTurn = nextTurn.getValue();
} else if (currentTurn.isPossibleRightTurn() && TurnType.isRightTurn(nextTurn.getActiveCommonLaneTurn())) {
singleTurn = nextTurn.getActiveCommonLaneTurn();
} else if ((currentTurn.goAhead() || currentTurn.keepLeft() || currentTurn.keepRight())
&& TurnType.isKeepDirectionTurn(nextTurn.getActiveCommonLaneTurn())) {
singleTurn = nextTurn.getActiveCommonLaneTurn();
}
}
if (singleTurn == 0) {
Expand Down
1 change: 1 addition & 0 deletions OsmAnd-telegram/res/values-hr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,5 @@
<string name="live_now">Sada uživo</string>
<string name="enter_code">Upiši kȏd</string>
<string name="shared_string_error">Greška</string>
<string name="send_live_location_error">Greška prilikom slanja trenutne lokacije: %1$s</string>
</resources>
14 changes: 14 additions & 0 deletions OsmAnd/res/drawable/ic_action_bluetooth_disabled.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M17.71,7.71L14.2667,11.1453L11,7.8787V2H12L17.71,7.71ZM13,5.83L14.88,7.71L13,9.59V5.83Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
<path
android:pathData="M15.7929,18.2071L21.2929,23.7071L22.7071,22.2929L2.7071,2.2929L1.2929,3.7071L10.0879,12.5021L5,17.59L6.41,19L11,14.41V22H12L15.7929,18.2071ZM13,15.4142L14.3779,16.7921L13,18.17V15.4142Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>
4 changes: 2 additions & 2 deletions OsmAnd/res/drawable/ic_action_edit_dark.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M17.2929,9.7071L14.2929,6.7071L3,18V21H6L17.2929,9.7071Z"
android:pathData="M3,17.4998V20.9998H6.5L17.6893,9.8106L14.1893,6.3106L3,17.4998Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M15.7071,5.2929L17.2929,3.7071C17.6834,3.3166 18.3166,3.3166 18.7071,3.7071L20.2929,5.2929C20.6834,5.6834 20.6834,6.3165 20.2929,6.7071L18.7071,8.2929L15.7071,5.2929Z"
android:pathData="M16.3106,4.1892L19.8106,7.6892L21.2929,6.207C21.6834,5.8164 21.6834,5.1833 21.2929,4.7927L19.2071,2.707C18.8166,2.3164 18.1834,2.3164 17.7929,2.707L16.3106,4.1892Z"
android:fillColor="#ffffff"/>
</vector>
11 changes: 11 additions & 0 deletions OsmAnd/res/drawable/ic_action_edit_outlined.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M4,19.9998V17.9141L14.5429,7.3712L16.6287,9.457L6.0858,19.9998H4ZM17.3713,4.5427L18.5,3.4141L20.5858,5.4998L21.2796,4.8061L20.5858,5.4998L19.4571,6.6285L17.3713,4.5427Z"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#ffffff"/>
</vector>
14 changes: 14 additions & 0 deletions OsmAnd/res/drawable/ic_action_folder_open.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2,4C0.8954,4 0,4.8954 0,6V18C0,19.1046 0.8954,20 2,20H16C18.2091,20 20,18.2091 20,16V8C20,6.8954 19.1046,6 18,6H10L8,4H2Z"
android:strokeAlpha="0.7"
android:fillColor="#ffffff"
android:fillAlpha="0.7"/>
<path
android:pathData="M3.2207,12.0482C3.5701,11.4024 4.2454,11 4.9797,11H22.4197C23.2925,11 24,11.7075 24,12.5803C24,12.8554 23.9282,13.1256 23.7918,13.3644L20.5758,18.9923C20.2198,19.6154 19.5571,20 18.8394,20H1.5959C0.7145,20 0,19.2855 0,18.4041C0,18.1389 0.0661,17.8779 0.1923,17.6446L3.2207,12.0482Z"
android:fillColor="#ffffff"/>
</vector>
22 changes: 22 additions & 0 deletions OsmAnd/res/drawable/ic_action_sensor.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M20,12C20,14.2092 19.1046,16.2092 17.6569,17.6569L19.0711,19.0711C20.8807,17.2614 22,14.7614 22,12C22,9.2386 20.8807,6.7386 19.0711,4.929L17.6569,6.3432C19.1046,7.7909 20,9.7909 20,12Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M4,12C4,14.2092 4.8954,16.2092 6.3432,17.6569L4.9289,19.0711C3.1193,17.2614 2,14.7614 2,12C2,9.2386 3.1193,6.7386 4.9289,4.929L6.3432,6.3432C4.8954,7.7909 4,9.7909 4,12Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M6,12C6,13.6569 6.6716,15.1569 7.7574,16.2427L9.1716,14.8285C8.4477,14.1046 8,13.1046 8,12C8,10.8955 8.4477,9.8954 9.1716,9.1716L7.7574,7.7574C6.6716,8.8432 6,10.3432 6,12Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M14.8284,14.8285L16.2426,16.2427C17.3284,15.1569 18,13.6569 18,12C18,10.3432 17.3284,8.8432 16.2426,7.7574L14.8284,9.1716C15.5523,9.8954 16,10.8955 16,12C16,13.1046 15.5523,14.1046 14.8284,14.8285Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M10,10C10,9.4477 10.4477,9 11,9H13C13.5523,9 14,9.4477 14,10V13C14,14.1046 13.1046,15 12,15C10.8954,15 10,14.1046 10,13V10ZM13,10.5C13,10.7761 12.7761,11 12.5,11C12.2239,11 12,10.7761 12,10.5C12,10.2239 12.2239,10 12.5,10C12.7761,10 13,10.2239 13,10.5Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>
43 changes: 43 additions & 0 deletions OsmAnd/res/drawable/ic_action_sensor_bicycle_power_outlined.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,7C12.5523,7 13,6.5523 13,6C13,5.4477 12.5523,5 12,5C11.4477,5 11,5.4477 11,6C11,6.5523 11.4477,7 12,7Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M17,12C17,12.5523 17.4477,13 18,13C18.5523,13 19,12.5523 19,12C19,11.4477 18.5523,11 18,11C17.4477,11 17,11.4477 17,12Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M8,9C8.5523,9 9,8.5523 9,8C9,7.4477 8.5523,7 8,7C7.4477,7 7,7.4477 7,8C7,8.5523 7.4477,9 8,9Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M16,9C16.5523,9 17,8.5523 17,8C17,7.4477 16.5523,7 16,7C15.4477,7 15,7.4477 15,8C15,8.5523 15.4477,9 16,9Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M14.8025,2.3989C14.6604,2.3575 14.5173,2.3192 14.3735,2.284L14.3095,2.148C13.9795,1.4472 13.2746,1 12.5,1H11.5C10.7254,1 10.0205,1.4472 9.6905,2.148L9.6265,2.284C9.4827,2.3191 9.3396,2.3575 9.1974,2.399L9.074,2.3132C8.4379,1.8713 7.6038,1.8364 6.933,2.2237L6.0669,2.7237C5.3962,3.111 5.0093,3.8508 5.0739,4.6226L5.0865,4.7724C4.9795,4.8748 4.8747,4.9795 4.7724,5.0865L4.6226,5.074C3.8507,5.0093 3.1109,5.3962 2.7236,6.067L2.2236,6.933C1.8364,7.6038 1.8712,8.4379 2.3131,9.074L2.3989,9.1975C2.3574,9.3397 2.3191,9.4828 2.2839,9.6265L2.148,9.6905C1.4472,10.0205 1,10.7254 1,11.5V12.5C1,12.5844 1.0053,12.6679 1.0157,12.7502C0.9851,12.9928 0.9989,13.2419 1.0597,13.4851L3.0597,21.4851C3.2823,22.3754 4.0823,23 5,23C10.3333,23 15.6666,22.9999 20.9999,22.9999C22.6568,22.9999 23.9999,21.6568 23.9999,19.9999C23.9999,18.6053 23.0483,17.433 21.759,17.0968L21.7762,17.067C22.1635,16.3962 22.1286,15.5621 21.6867,14.926L21.601,14.8026C21.6425,14.6605 21.6808,14.5173 21.716,14.3735L21.852,14.3094C22.5528,13.9795 23,13.2746 23,12.5V11.5C23,10.7254 22.5528,10.0205 21.852,9.6905L21.716,9.6265C21.6808,9.4827 21.6425,9.3396 21.601,9.1975L21.6868,9.074C22.1287,8.4379 22.1635,7.6038 21.7762,6.933L21.2762,6.067C20.889,5.3962 20.1492,5.0093 19.3773,5.074L19.2275,5.0865C19.1251,4.9795 19.0204,4.8748 18.9134,4.7724L18.926,4.6227C18.9906,3.8508 18.6037,3.111 17.9329,2.7237L17.0669,2.2237C16.3961,1.8364 15.562,1.8713 14.9259,2.3132L14.8025,2.3989ZM15.1042,4.6245L16.0669,3.9558L16.9329,4.4558L16.8351,5.6239C17.4118,6.0608 17.9388,6.5877 18.376,7.1648L19.5442,7.067L20.0442,7.933L19.3754,8.8957C19.6563,9.5623 19.8493,10.2821 19.9394,11.0006L21,11.5V12.5L19.9393,12.9994C19.8492,13.7183 19.6562,14.438 19.3754,15.1043L20.0441,16.067L19.7749,16.5333L14.8,9.9C13.6402,8.3535 11.4464,8.0401 9.9,9.2C9.2755,9.6683 8.8521,10.3052 8.6456,11H4.0606C4.1506,10.2828 4.3433,9.5633 4.6245,8.8959L3.9557,7.933L4.4557,7.067L5.6239,7.1648C6.0611,6.5877 6.5881,6.0608 7.1648,5.6239L7.0669,4.4558L7.933,3.9558L8.8958,4.6246C9.5628,4.3435 10.2826,4.1506 11.0006,4.0606L11.5,3H12.5L12.9994,4.0606C13.7177,4.1507 14.4375,4.3436 15.1042,4.6245ZM5,13H3L5,21H7L8,17L9,21H11L13,13H11L10,17L9,13H7L6,17L5,13ZM13.1214,11.0038C12.6087,10.4254 11.7293,10.3281 11.1,10.8001C11.0179,10.8616 10.944,10.93 10.8783,11.0038C10.9186,11.0013 10.9592,11.0001 11.0001,11.0001H13.0001C13.0407,11.0001 13.0812,11.0013 13.1214,11.0038ZM14.952,13.436C14.9483,13.4524 14.9444,13.4688 14.9403,13.4852L14.015,17.1867L15.3749,19H14C13.4477,19 13,19.4477 13,20C13,20.5523 13.4477,21 14,21H21C21.5523,21 22,20.5523 22,20C22,19.4477 21.5523,19 21,19H19.1249L14.952,13.436Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
<path
android:pathData="M16.0669,3.9558L15.1042,4.6245C14.4375,4.3436 13.7177,4.1507 12.9994,4.0606L12.5,3H11.5L11.0006,4.0606C10.2826,4.1506 9.5628,4.3435 8.8958,4.6246L7.933,3.9558L7.0669,4.4558L7.1648,5.6239C6.5881,6.0608 6.0611,6.5877 5.6239,7.1648L4.4557,7.067L3.9557,7.933L4.6245,8.8959C4.3433,9.5633 4.1506,10.2828 4.0606,11H8.6456C8.8521,10.3052 9.2755,9.6683 9.9,9.2C11.4464,8.0401 13.6402,8.3535 14.8,9.9L19.7749,16.5333L20.0441,16.067L19.3754,15.1043C19.6562,14.438 19.8492,13.7183 19.9393,12.9994L21,12.5V11.5L19.9394,11.0006C19.8493,10.2821 19.6563,9.5623 19.3754,8.8957L20.0442,7.933L19.5442,7.067L18.376,7.1648C17.9388,6.5877 17.4118,6.0608 16.8351,5.6239L16.9329,4.4558L16.0669,3.9558ZM13,6C13,6.5523 12.5523,7 12,7C11.4477,7 11,6.5523 11,6C11,5.4477 11.4477,5 12,5C12.5523,5 13,5.4477 13,6ZM18,13C17.4477,13 17,12.5523 17,12C17,11.4477 17.4477,11 18,11C18.5523,11 19,11.4477 19,12C19,12.5523 18.5523,13 18,13ZM9,8C9,8.5523 8.5523,9 8,9C7.4477,9 7,8.5523 7,8C7,7.4477 7.4477,7 8,7C8.5523,7 9,7.4477 9,8ZM17,8C17,8.5523 16.5523,9 16,9C15.4477,9 15,8.5523 15,8C15,7.4477 15.4477,7 16,7C16.5523,7 17,7.4477 17,8Z"
android:strokeAlpha="0.2"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:fillAlpha="0.2"/>
<path
android:pathData="M11.1,10.8001C11.7293,10.3281 12.6087,10.4254 13.1214,11.0038C13.0812,11.0013 13.0407,11.0001 13.0001,11.0001H11.0001C10.9592,11.0001 10.9186,11.0013 10.8783,11.0038C10.944,10.93 11.0179,10.8616 11.1,10.8001Z"
android:strokeAlpha="0.2"
android:fillColor="#ffffff"
android:fillAlpha="0.2"/>
<path
android:pathData="M14.9403,13.4852C14.9444,13.4688 14.9483,13.4524 14.952,13.436L19.1249,19H15.3749L14.015,17.1867L14.9403,13.4852Z"
android:strokeAlpha="0.2"
android:fillColor="#ffffff"
android:fillAlpha="0.2"/>
<path
android:pathData="M13,20C13,19.4477 13.4477,19 14,19H21C21.5523,19 22,19.4477 22,20C22,20.5523 21.5523,21 21,21H14C13.4477,21 13,20.5523 13,20Z"
android:strokeAlpha="0.5"
android:fillColor="#ffffff"
android:fillAlpha="0.5"/>
</vector>
Loading

0 comments on commit c985f22

Please sign in to comment.