Compare commits

..

10 Commits

Author SHA1 Message Date
x7z4w
7ad09956fb [search] Add Spanish synonyms
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2026-01-15 21:11:11 +01:00
Jean-Baptiste
1238ae3ef5 [android] Use dark background in the editor
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2026-01-15 19:56:35 +01:00
Yannik Bloscheck
41919f61a4 [types] Switched to using a constant for the filename
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
2026-01-15 19:27:42 +01:00
Yannik Bloscheck
6b0c505bdb [types] Fix opening of subtypes file for Android
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
2026-01-15 19:27:42 +01:00
Yannik Bloscheck
fd11533a60 [types] Adding subtypes file to Qt
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
2026-01-15 19:27:42 +01:00
x7z4w
66582ba249 [search] Add German synonym
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2026-01-15 19:19:56 +01:00
Jean-Baptiste
62a55abeec [android] Use default background color on bottomsheet
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2026-01-15 14:39:18 +01:00
Radek Olsak
393a26e82b [cmake] Fixed issue when lto enabled
Changed the original LTO setup hack using add_compile_options
into cmake way of adding LTO.

This issue made it impossible to compile flatpaks.

Signed-off-by: Radek Olsak <radek@olsak.net>
2026-01-15 12:30:03 +01:00
Yannik Bloscheck
1d10e25761 Adding general support for subtypes (and switching charging stations to using it)
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
2026-01-14 23:47:33 +01:00
x7z4w
64e13fde0f [search] nits
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2026-01-14 17:14:23 +00:00
41 changed files with 339 additions and 162 deletions

View File

@@ -34,79 +34,28 @@ on:
- track_generator/** - track_generator/**
- xcode/** - xcode/**
env:
SUBMODULE_CACHE_PATHS: |
.git/modules
3party/CMake-MetalShaderSupport
3party/Vulkan-Headers
3party/boost
3party/expat
3party/fast_double_parser
3party/fast_obj
3party/freetype/freetype
3party/gflags
3party/glaze
3party/glfw
3party/glm
3party/googletest
3party/harfbuzz/harfbuzz
3party/icu/icu
3party/imgui/imgui
3party/jansson/jansson
3party/just_gtfs
3party/protobuf/protobuf
3party/pugixml/pugixml
3party/utfcpp
tools/kothic
tools/osmctools
jobs: jobs:
lint: lint:
name: Android Lint name: Android Lint
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: codeberg.org/comaps/docker-android-sdk:latest
options: --user root
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
- name: Cache world map - name: Parallel submodules checkout
uses: actions/cache@v4
with:
path: data/world_mwm
key: world-mwm
- uses: actions/cache@v4
with:
path: ${{ env.SUBMODULE_CACHE_PATHS }}
key: submodules-${{ hashFiles('.gitmodules') }}
restore-keys: |
submodules-
- name: Sync and update submodules
shell: bash shell: bash
run: | run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
git submodule sync --recursive
git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Lint - name: Lint
shell: bash shell: bash
working-directory: android working-directory: android
run: | run: ./gradlew -Pandroidauto=true lint
# cd ..
# ./configure.sh
# cd android
./gradlew -Pandroidauto=true lint
android-check: android-check:
name: Build Android Debug name: Build Android Debug
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: codeberg.org/comaps/docker-android-sdk:latest
options: --user root
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@@ -122,32 +71,23 @@ jobs:
cancel-in-progress: true cancel-in-progress: true
steps: steps:
- name: Install build tools and dependencies
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 200 # enough to get all commits for the current day fetch-depth: 200 # enough to get all commits for the current day
- name: Cache world map - name: Parallel submodules checkout
uses: actions/cache@v4
with:
path: data/world_mwm
key: world-mwm
- uses: actions/cache@v4
with:
path: ${{ env.SUBMODULE_CACHE_PATHS }}
key: submodules-${{ hashFiles('.gitmodules') }}
restore-keys: |
submodules-
- name: Sync and update submodules
shell: bash shell: bash
run: | run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
git submodule sync --recursive
git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Configure ccache - name: Configure ccache
uses: https://github.com/hendrikmuhs/ccache-action@v1.2 uses: hendrikmuhs/ccache-action@v1.2
with: with:
key: ${{ github.workflow }}-${{ matrix.flavor }} key: ${{ github.workflow }}-${{ matrix.flavor }}
@@ -158,14 +98,13 @@ jobs:
CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache
run: | run: |
cd .. cmake --version
./configure.sh ninja --version
cd android
./gradlew -P${{ matrix.arch }} assemble${{ matrix.flavor }} ./gradlew -P${{ matrix.arch }} assemble${{ matrix.flavor }}
- name: Upload ${{ matrix.flavor }} apk - name: Upload ${{ matrix.flavor }} apk
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: android-${{ matrix.flavor }} name: android-${{ matrix.flavor }}
path: android/app/build/outputs/apk/**/*.apk path: android/app/build/outputs/apk/**/OrganicMaps-*.apk
if-no-files-found: error if-no-files-found: error

View File

@@ -104,7 +104,8 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel") elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel")
add_definitions(-DRELEASE) add_definitions(-DRELEASE)
if (NOT MSVC) if (NOT MSVC)
add_compile_options(-O3 $<$<CXX_COMPILER_ID:GNU>:-flto=auto>) add_compile_options(-O3)
set (CMAKE_INTERPROCEDURAL_OPTIMIZATION True)
endif() endif()
else() else()
message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE}) message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE})

View File

@@ -41,5 +41,5 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_gravity="bottom|start" android:layout_gravity="bottom|start"
android:background="?colorSurfaceContainerLow"/> android:background="?appBackground"/>
</FrameLayout> </FrameLayout>

View File

@@ -8,7 +8,7 @@
android:layout_margin="4dp" android:layout_margin="4dp"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
app:cardBackgroundColor="?cardBackground" app:cardBackgroundColor="?appBackground"
app:cardCornerRadius="12dp" app:cardCornerRadius="12dp"
app:cardElevation="2dp" app:cardElevation="2dp"
tools:showIn="@layout/item_charging_sockets"> tools:showIn="@layout/item_charging_sockets">

View File

@@ -6,6 +6,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipToPadding="false" android:clipToPadding="false"
android:background="@color/bg_editor"
tools:context=".editor.EditorActivity"> tools:context=".editor.EditorActivity">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -430,7 +431,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:layout_marginBottom="@dimen/margin_quarter" android:layout_marginBottom="@dimen/margin_quarter"
app:backgroundTint="?cardBackground"
android:textColor="@color/base_red" android:textColor="@color/base_red"
app:strokeColor="@color/base_red" app:strokeColor="@color/base_red"
android:text="@string/editor_business_vacant_button"/> android:text="@string/editor_business_vacant_button"/>
@@ -441,7 +441,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:layout_marginBottom="@dimen/margin_base" android:layout_marginBottom="@dimen/margin_base"
app:backgroundTint="?cardBackground"
android:textColor="@color/base_red" android:textColor="@color/base_red"
app:strokeColor="@color/base_red" app:strokeColor="@color/base_red"
tools:text="Reset my changes"/> tools:text="Reset my changes"/>

View File

@@ -2,10 +2,9 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?windowBackgroundForced"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar

View File

@@ -10,13 +10,13 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/frameLayout" android:id="@+id/frameLayout"
android:background="?windowBackgroundForced"> android:background="@color/bg_editor"
android:layout_marginBottom="@dimen/margin_quarter">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/phones_recycler" android:id="@+id/phones_recycler"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?cardBackground"
android:scrollbars="vertical" /> android:scrollbars="vertical" />
</FrameLayout> </FrameLayout>

View File

@@ -9,7 +9,7 @@
style="@style/MwmWidget.FrameLayout.Elevation" style="@style/MwmWidget.FrameLayout.Elevation"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?windowBackgroundForced" android:background="@color/bg_editor"
android:layout_above="@+id/tv__mode_switch" android:layout_above="@+id/tv__mode_switch"
android:layout_below="@id/toolbar"/> android:layout_below="@id/toolbar"/>
@@ -19,14 +19,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv__mode_switch" android:layout_alignTop="@+id/tv__mode_switch"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:background="?cardBackground"/> android:background="@color/bg_editor"/>
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/tv__mode_switch" android:id="@+id/tv__mode_switch"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:background="?clickableBackground"
android:gravity="center_vertical" android:gravity="center_vertical"
android:padding="@dimen/margin_base" android:padding="@dimen/margin_base"
android:text="@string/editor_time_advanced" android:text="@string/editor_time_advanced"
@@ -35,7 +34,7 @@
android:textColor="?colorSecondary" /> android:textColor="?colorSecondary" />
<include <include
layout="@layout/shadow_bottom" layout="@layout/item_divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@id/tv__mode_switch"/> android:layout_above="@id/tv__mode_switch"/>

View File

@@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?windowBackgroundForced"> android:background="@color/bg_editor">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -17,8 +17,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half" android:layout_marginTop="@dimen/margin_half"
style="@style/MwmWidget.M3.Editor.CardView" style="@style/MwmWidget.M3.Editor.CardView">
app:cardBackgroundColor="?cardBackground">
<LinearLayout <LinearLayout
android:id="@+id/examples" android:id="@+id/examples"

View File

@@ -4,7 +4,7 @@
android:id="@+id/recycler" android:id="@+id/recycler"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?windowBackgroundForced" android:background="@color/bg_editor"
android:paddingStart="@dimen/margin_half" android:paddingStart="@dimen/margin_half"
android:paddingEnd="@dimen/margin_half" android:paddingEnd="@dimen/margin_half"
android:scrollbars="vertical"/> android:scrollbars="vertical"/>

View File

@@ -6,7 +6,7 @@
android:layout_margin="4dp" android:layout_margin="4dp"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
app:cardBackgroundColor="?cardBackground" app:cardBackgroundColor="?appBackground"
app:cardCornerRadius="12dp" app:cardCornerRadius="12dp"
app:cardElevation="2dp"> app:cardElevation="2dp">

View File

@@ -21,5 +21,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/edit_socket_info_tooltip" android:text="@string/edit_socket_info_tooltip"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_marginBottom="@dimen/margin_quarter"/>
</LinearLayout> </LinearLayout>

View File

@@ -40,5 +40,5 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_gravity="bottom|center" android:layout_gravity="bottom|center"
android:background="?colorSurfaceContainerLow"/> android:background="?appBackground"/>
</FrameLayout> </FrameLayout>

View File

@@ -7,6 +7,7 @@
android:orientation="vertical" android:orientation="vertical"
android:paddingEnd="@dimen/margin_base" android:paddingEnd="@dimen/margin_base"
android:paddingStart="@dimen/margin_base" android:paddingStart="@dimen/margin_base"
android:background="@color/fg_editor"
android:animateLayoutChanges="true"> android:animateLayoutChanges="true">
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
@@ -20,7 +21,12 @@
android:textAppearance="@style/MwmTextAppearance.Body3" android:textAppearance="@style/MwmTextAppearance.Body3"
tools:drawableEnd="@drawable/ic_expand_more" /> tools:drawableEnd="@drawable/ic_expand_more" />
<include layout="@layout/recycler_default" /> <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/fg_editor"
android:scrollbars="vertical"/>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/more_names" android:id="@+id/more_names"

View File

@@ -4,5 +4,5 @@
android:id="@+id/recycler" android:id="@+id/recycler"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?cardBackground" android:background="?appBackground"
android:scrollbars="vertical"/> android:scrollbars="vertical"/>

View File

@@ -16,6 +16,8 @@
<color name="bg_panel">@color/bg_window</color> <color name="bg_panel">@color/bg_window</color>
<color name="bg_primary_dark">#FF588157</color> <color name="bg_primary_dark">#FF588157</color>
<color name="bg_app">#10140F</color> <color name="bg_app">#10140F</color>
<color name="bg_editor">#161b14</color>
<color name="fg_editor">#282e25</color>
<color name="bg_menu">#CC2D3237</color> <color name="bg_menu">#CC2D3237</color>

View File

@@ -151,7 +151,7 @@
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item> <item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item> <item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
<item name="appBackground">?android:attr/colorBackground</item> <item name="appBackground">@color/bg_app</item>
</style> </style>
<style name="MwmTheme" parent="MwmTheme.Base"/> <style name="MwmTheme" parent="MwmTheme.Base"/>

View File

@@ -65,6 +65,8 @@
<color name="bg_panel">@color/bg_window</color> <color name="bg_panel">@color/bg_window</color>
<color name="bg_primary_dark">#37653F</color> <!-- secondary dark --> <color name="bg_primary_dark">#37653F</color> <!-- secondary dark -->
<color name="bg_app">@android:color/white</color> <color name="bg_app">@android:color/white</color>
<color name="bg_editor">#ebefe4</color>
<color name="fg_editor">#f9faf2</color>
<color name="bg_dialog_translucent">#BB000000</color> <color name="bg_dialog_translucent">#BB000000</color>
<color name="bg_text_translucent">#99FFFFFF</color> <color name="bg_text_translucent">#99FFFFFF</color>

View File

@@ -89,8 +89,16 @@
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginBottom">@dimen/margin_half</item> <item name="android:layout_marginBottom">@dimen/margin_half</item>
<item name="cardBackgroundColor">?cardBackground</item> <item name="cardBackgroundColor">@color/fg_editor</item>
<item name="android:padding">@dimen/margin_base</item> <item name="android:padding">@dimen/margin_base</item>
<item name="cardPreventCornerOverlap">false</item> <item name="cardPreventCornerOverlap">false</item>
</style> </style>
<style name="MwmWidget.M3.CardView" parent="Widget.Material3.CardView.Elevated">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginBottom">@dimen/margin_half</item>
<item name="cardBackgroundColor">?appBackground</item>
<item name="android:padding">@dimen/margin_base</item>
<item name="cardPreventCornerOverlap">false</item>
</style>
</resources> </resources>

View File

@@ -239,10 +239,6 @@
<item name="android:foreground">@drawable/shadow_top</item> <item name="android:foreground">@drawable/shadow_top</item>
</style> </style>
<style name="MwmWidget.FrameLayout.BookmarkCategories">
<item name="android:background">?windowBackgroundForced</item>
</style>
<style name="MwmWidget.Counter"> <style name="MwmWidget.Counter">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
@@ -287,13 +283,13 @@
</style> </style>
<style name="MwmWidget.BottomSheetDialog" parent="Widget.Material3.BottomSheet.Modal"> <style name="MwmWidget.BottomSheetDialog" parent="Widget.Material3.BottomSheet.Modal">
<item name="backgroundTint">?colorSurfaceContainerLow</item> <item name="backgroundTint">?appBackground</item>
<item name="elevationOverlayEnabled">false</item> <item name="elevationOverlayEnabled">false</item>
<item name="shapeAppearance">@style/ShapeAppearance.Material3.LargeComponent</item> <item name="shapeAppearance">@style/ShapeAppearance.Material3.LargeComponent</item>
</style> </style>
<style name="MwmWidget.BottomSheet" parent="MwmWidget.BottomSheetDialog"> <style name="MwmWidget.BottomSheet" parent="MwmWidget.BottomSheetDialog">
<item name="android:background">?colorSurfaceContainerLow</item> <item name="android:background">?appBackground</item>
<item name="behavior_hideable">false</item> <item name="behavior_hideable">false</item>
</style> </style>

View File

@@ -278,10 +278,6 @@
<style name="MwmTheme.Navigation"> <style name="MwmTheme.Navigation">
<item name="iconTint">@color/white_primary</item> <item name="iconTint">@color/white_primary</item>
</style> </style>
<style name="PopupMenu" parent="ThemeOverlay.Material3">
<item name="android:popupBackground">?windowBackgroundForced</item>
</style>
<!-- Theme required to apply M3 dialog style on preference screen --> <!-- Theme required to apply M3 dialog style on preference screen -->
<style name="MwmTheme.M3.AlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog"> <style name="MwmTheme.M3.AlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="dialogCornerRadius">28dp</item> <item name="dialogCornerRadius">28dp</item>

View File

@@ -0,0 +1 @@
../../../../../data/subtypes.csv
1 ../../../../../data/subtypes.csv

View File

@@ -186,7 +186,7 @@
"place-state": "Щат|провинция", "place-state": "Щат|провинция",
"place-region": "Район|Регион", "place-region": "Район|Регион",
"place-island|place-islet": "Остров", "place-island|place-islet": "Остров",
"place-suburb|place-quarter|place-neighbourhood|landuse-residential": "Район|микрорайон|окръг|квартал|Предградие|Жилищен комплекс|ж.к.|ЖК", "place-suburb|place-quarter|place-neighbourhood|landuse-residential": "Район|микрорайон|окръг|квартал|Предградие|Жилищен комплекс|ЖК",
"place-hamlet": "Село", "place-hamlet": "Село",
"place-village": "Село", "place-village": "Село",
"place-locality": "местност|регион|Място", "place-locality": "местност|регион|Място",

View File

@@ -199,7 +199,7 @@
"place-state": "Штат|провинция", "place-state": "Штат|провинция",
"place-region": "Район", "place-region": "Район",
"place-island|place-islet": "Остров", "place-island|place-islet": "Остров",
"place-suburb|place-quarter|place-neighbourhood|landuse-residential": "Район|микрорайон|квартал|Жилая зона|Жилой комплекс|ж.к.|ЖК", "place-suburb|place-quarter|place-neighbourhood|landuse-residential": "Район|микрорайон|квартал|Жилая зона|Жилой комплекс|ЖК",
"place-hamlet": "Посёлок|деревня", "place-hamlet": "Посёлок|деревня",
"place-village": "Деревня|поселок", "place-village": "Деревня|поселок",
"place-locality": "Местность|регион", "place-locality": "Местность|регион",

View File

@@ -196,7 +196,7 @@
"place-state": "Штат|провінція|регіон", "place-state": "Штат|провінція|регіон",
"place-region": "Район|область", "place-region": "Район|область",
"place-island|place-islet": "Острів", "place-island|place-islet": "Острів",
"place-suburb|place-quarter|place-neighbourhood|landuse-residential": "Район|мікрорайон|квартал|округа|Сусідство|Житловий комплекс|ж.к.|ЖК", "place-suburb|place-quarter|place-neighbourhood|landuse-residential": "Район|мікрорайон|квартал|округа|Сусідство|Житловий комплекс|ЖК",
"place-hamlet": "Поселення|селище|село", "place-hamlet": "Поселення|селище|село",
"place-village": "Село|хутір|поселення", "place-village": "Село|хутір|поселення",
"place-locality": "Місцевість|регіон|Місце", "place-locality": "Місцевість|регіон|Місце",

2
data/subtypes.csv Normal file
View File

@@ -0,0 +1,2 @@
Types;Related Subtypes
amenity|charging_station;amenity|charging_station|motorcar,amenity|charging_station|motorcycle,amenity|charging_station|bicycle,amenity|charging_station|small,amenity|charging_station|carless
1 Types Related Subtypes
2 amenity|charging_station amenity|charging_station|motorcar,amenity|charging_station|motorcycle,amenity|charging_station|bicycle,amenity|charging_station|small,amenity|charging_station|carless

View File

@@ -113,6 +113,7 @@ auto constexpr TMP_OFFSETS_EXT = OFFSET_EXT EXTENSION_TMP;
#define SKIPPED_ELEMENTS_FILE "skipped_elements.json" #define SKIPPED_ELEMENTS_FILE "skipped_elements.json"
#define MAPCSS_MAPPING_FILE "mapcss-mapping.csv" #define MAPCSS_MAPPING_FILE "mapcss-mapping.csv"
#define SUBTYPES_FILE "subtypes.csv"
#define REPLACED_TAGS_FILE "replaced_tags.txt" #define REPLACED_TAGS_FILE "replaced_tags.txt"
#define MIXED_TAGS_FILE "mixed_tags.txt" #define MIXED_TAGS_FILE "mixed_tags.txt"
#define MIXED_NODES_FILE "mixed_nodes.txt" #define MIXED_NODES_FILE "mixed_nodes.txt"

View File

@@ -11,6 +11,7 @@
#include "indexer/classificator.hpp" #include "indexer/classificator.hpp"
#include "indexer/feature_impl.hpp" #include "indexer/feature_impl.hpp"
#include "indexer/ftypes_matcher.hpp" #include "indexer/ftypes_matcher.hpp"
#include "indexer/ftypes_subtypes.hpp"
#include "platform/platform.hpp" #include "platform/platform.hpp"
@@ -351,9 +352,11 @@ private:
// - both amenity-charging_station-motorcar and amenity-charging_station-bicycle are left; // - both amenity-charging_station-motorcar and amenity-charging_station-bicycle are left;
void LeaveLongestTypes(std::vector<generator::TypeStrings> & matchedTypes) void LeaveLongestTypes(std::vector<generator::TypeStrings> & matchedTypes)
{ {
auto const isChargingStation = [](auto const & lhs, auto const & rhs) // Prevents types, that either have subtypes or are subtypes, from being removed
auto subtypes = ftypes::Subtypes::Instance();
auto const hasSubtypeRelatedTypes = [subtypes](auto const & lhs, auto const & rhs)
{ {
return lhs.size() > 1 && rhs.size() > 1 && lhs.at(1) == "charging_station" && rhs.at(1) == "charging_station" && lhs.at(0) == "amenity" && rhs.at(0) == "amenity"; return subtypes.IsPathOfTypeWithSubtypesOrSubtype(lhs) || subtypes.IsPathOfTypeWithSubtypesOrSubtype(rhs);
}; };
auto const equalPrefix = [](auto const & lhs, auto const & rhs) auto const equalPrefix = [](auto const & lhs, auto const & rhs)
@@ -374,9 +377,10 @@ void LeaveLongestTypes(std::vector<generator::TypeStrings> & matchedTypes)
return lhs < rhs; return lhs < rhs;
}; };
auto const isEqual = [&equalPrefix, &isChargingStation](auto const & lhs, auto const & rhs) // `true` means it will be deleted, because being equal means it isn't unique
auto const isEqual = [&equalPrefix, &hasSubtypeRelatedTypes](auto const & lhs, auto const & rhs)
{ {
if (isChargingStation(lhs, rhs)) if (hasSubtypeRelatedTypes(lhs, rhs))
return false; return false;
if (equalPrefix(lhs, rhs)) if (equalPrefix(lhs, rhs))

View File

@@ -14,6 +14,7 @@
270C9C282E16AB6F00ABA688 /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 270C9C252E16AB6300ABA688 /* Profile.swift */; }; 270C9C282E16AB6F00ABA688 /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 270C9C252E16AB6300ABA688 /* Profile.swift */; };
27176A862E65B0150015F25F /* Icon.icon in Resources */ = {isa = PBXBuildFile; fileRef = 27176A852E65B0150015F25F /* Icon.icon */; }; 27176A862E65B0150015F25F /* Icon.icon in Resources */ = {isa = PBXBuildFile; fileRef = 27176A852E65B0150015F25F /* Icon.icon */; };
27176A8A2E65B01B0015F25F /* Debug Icon.icon in Resources */ = {isa = PBXBuildFile; fileRef = 27176A892E65B01B0015F25F /* Debug Icon.icon */; }; 27176A8A2E65B01B0015F25F /* Debug Icon.icon in Resources */ = {isa = PBXBuildFile; fileRef = 27176A892E65B01B0015F25F /* Debug Icon.icon */; };
272CA4492F127221005A3F5B /* subtypes.csv in Resources */ = {isa = PBXBuildFile; fileRef = 272CA4482F127221005A3F5B /* subtypes.csv */; };
272F1F392E0EE09000FA52EF /* ExistingProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 272F1F382E0EE08A00FA52EF /* ExistingProfileView.swift */; }; 272F1F392E0EE09000FA52EF /* ExistingProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 272F1F382E0EE08A00FA52EF /* ExistingProfileView.swift */; };
272F1F3B2E0EE0A300FA52EF /* NoExistingProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 272F1F3A2E0EE09500FA52EF /* NoExistingProfileView.swift */; }; 272F1F3B2E0EE0A300FA52EF /* NoExistingProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 272F1F3A2E0EE09500FA52EF /* NoExistingProfileView.swift */; };
272F1F3D2E0EE0C800FA52EF /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 272F1F3C2E0EE0C400FA52EF /* ProfileView.swift */; }; 272F1F3D2E0EE0C800FA52EF /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 272F1F3C2E0EE0C400FA52EF /* ProfileView.swift */; };
@@ -764,6 +765,7 @@
270C9C252E16AB6300ABA688 /* Profile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Profile.swift; sourceTree = "<group>"; }; 270C9C252E16AB6300ABA688 /* Profile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Profile.swift; sourceTree = "<group>"; };
27176A852E65B0150015F25F /* Icon.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = Icon.icon; sourceTree = "<group>"; }; 27176A852E65B0150015F25F /* Icon.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = Icon.icon; sourceTree = "<group>"; };
27176A892E65B01B0015F25F /* Debug Icon.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = "Debug Icon.icon"; sourceTree = "<group>"; }; 27176A892E65B01B0015F25F /* Debug Icon.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = "Debug Icon.icon"; sourceTree = "<group>"; };
272CA4482F127221005A3F5B /* subtypes.csv */ = {isa = PBXFileReference; lastKnownFileType = text; name = subtypes.csv; path = ../../data/subtypes.csv; sourceTree = SOURCE_ROOT; };
272F1F382E0EE08A00FA52EF /* ExistingProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExistingProfileView.swift; sourceTree = "<group>"; }; 272F1F382E0EE08A00FA52EF /* ExistingProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExistingProfileView.swift; sourceTree = "<group>"; };
272F1F3A2E0EE09500FA52EF /* NoExistingProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoExistingProfileView.swift; sourceTree = "<group>"; }; 272F1F3A2E0EE09500FA52EF /* NoExistingProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoExistingProfileView.swift; sourceTree = "<group>"; };
272F1F3C2E0EE0C400FA52EF /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = "<group>"; }; 272F1F3C2E0EE0C400FA52EF /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = "<group>"; };
@@ -3954,6 +3956,7 @@
F623DA6A1C9C2731006A3436 /* opening_hours_how_to_edit.html */, F623DA6A1C9C2731006A3436 /* opening_hours_how_to_edit.html */,
FA85F632145DDDC20090E1A0 /* packed_polygons.bin */, FA85F632145DDDC20090E1A0 /* packed_polygons.bin */,
451950391B7A3E070085DA05 /* patterns.txt */, 451950391B7A3E070085DA05 /* patterns.txt */,
272CA4482F127221005A3F5B /* subtypes.csv */,
FAAEA7D0161BD26600CCD661 /* synonyms.txt */, FAAEA7D0161BD26600CCD661 /* synonyms.txt */,
BB25B1A51FB32767007276FA /* transit_colors.txt */, BB25B1A51FB32767007276FA /* transit_colors.txt */,
FA64D9A813F975AD00350ECF /* types.txt */, FA64D9A813F975AD00350ECF /* types.txt */,
@@ -4281,6 +4284,7 @@
34AB66681FC5AA330078E451 /* TransportTransitPedestrian.xib in Resources */, 34AB66681FC5AA330078E451 /* TransportTransitPedestrian.xib in Resources */,
F6D67CDE2062BBA60032FD38 /* MWMBCCreateCategoryAlert.xib in Resources */, F6D67CDE2062BBA60032FD38 /* MWMBCCreateCategoryAlert.xib in Resources */,
3490D2E31CE9DD2500D0B838 /* MWMSideButtonsView.xib in Resources */, 3490D2E31CE9DD2500D0B838 /* MWMSideButtonsView.xib in Resources */,
272CA4492F127221005A3F5B /* subtypes.csv in Resources */,
F6E2FE2E1E097BA00083EBEC /* MWMStreetEditorEditTableViewCell.xib in Resources */, F6E2FE2E1E097BA00083EBEC /* MWMStreetEditorEditTableViewCell.xib in Resources */,
3463BA691DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */, 3463BA691DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */,
F623DA6C1C9C2731006A3436 /* opening_hours_how_to_edit.html in Resources */, F623DA6C1C9C2731006A3436 /* opening_hours_how_to_edit.html in Resources */,

View File

@@ -88,6 +88,8 @@ set(SRC
ftraits.hpp ftraits.hpp
ftypes_matcher.cpp ftypes_matcher.cpp
ftypes_matcher.hpp ftypes_matcher.hpp
ftypes_subtypes.cpp
ftypes_subtypes.hpp
house_to_street_iface.hpp house_to_street_iface.hpp
index_builder.cpp index_builder.cpp
index_builder.hpp index_builder.hpp

View File

@@ -3,6 +3,7 @@
#include "indexer/classificator.hpp" #include "indexer/classificator.hpp"
#include "indexer/feature.hpp" #include "indexer/feature.hpp"
#include "indexer/ftypes_matcher.hpp" #include "indexer/ftypes_matcher.hpp"
#include "indexer/ftypes_subtypes.hpp"
#include "base/assert.hpp" #include "base/assert.hpp"
#include "base/macros.hpp" #include "base/macros.hpp"
@@ -191,25 +192,13 @@ void TypesHolder::SortBySpec()
auto const getPriority = [&cl](uint32_t type) { return cl.GetObject(type)->GetMaxOverlaysPriority(); }; auto const getPriority = [&cl](uint32_t type) { return cl.GetObject(type)->GetMaxOverlaysPriority(); };
auto const & checker = UselessTypesChecker::Instance(); auto const & checker = UselessTypesChecker::Instance();
auto const & isChargingStationChecker = ftypes::IsCharingStationChecker::Instance(); auto const & subtypes = ftypes::Subtypes::Instance();
auto const & isChargingStationSmallChecker = ftypes::IsCharingStationSmallChecker::Instance();
std::stable_sort(begin(), end(), [&checker, &getPriority, &isChargingStationChecker, &isChargingStationSmallChecker](uint32_t t1, uint32_t t2) std::stable_sort(begin(), end(), [&checker, &getPriority, &subtypes](uint32_t t1, uint32_t t2)
{ {
if (isChargingStationChecker(t1) && isChargingStationChecker(t2)) std::optional<bool> const comaprisonResultBasedOnTypeRelation = subtypes.ComaprisonResultBasedOnTypeRelation(t1, t2);
{ if (comaprisonResultBasedOnTypeRelation.has_value())
if (isChargingStationSmallChecker(t1) && !isChargingStationSmallChecker(t2)) return comaprisonResultBasedOnTypeRelation.value();
return false;
else if (!isChargingStationSmallChecker(t1) && isChargingStationSmallChecker(t2))
return true;
uint8_t const t1Level = ftype::GetLevel(t1);
uint8_t const t2Level = ftype::GetLevel(t2);
if (t1Level == 2 && t2Level != 2)
return true;
else if (t1Level != 2 && t2Level == 2)
return false;
}
int const p1 = getPriority(t1); int const p1 = getPriority(t1);
int const p2 = getPriority(t2); int const p2 = getPriority(t2);

View File

@@ -5,6 +5,7 @@
#include "indexer/feature.hpp" #include "indexer/feature.hpp"
#include "indexer/feature_data.hpp" #include "indexer/feature_data.hpp"
#include "indexer/ftypes_matcher.hpp" #include "indexer/ftypes_matcher.hpp"
#include "indexer/ftypes_subtypes.hpp"
#include "indexer/scales.hpp" #include "indexer/scales.hpp"
#include "base/assert.hpp" #include "base/assert.hpp"
@@ -135,6 +136,9 @@ bool TypeAlwaysExists(uint32_t type, GeomType geomType = GeomType::Undefined)
if (IsUsefulStandaloneType(type, geomType)) if (IsUsefulStandaloneType(type, geomType))
return true; return true;
if (ftypes::Subtypes::Instance().IsTypeWithSubtypesOrSubtype(type))
return true;
uint8_t const typeLevel = ftype::GetLevel(type); uint8_t const typeLevel = ftype::GetLevel(type);
ftype::TruncValue(type, 1); ftype::TruncValue(type, 1);

View File

@@ -753,12 +753,6 @@ IsDirectionalChecker::IsDirectionalChecker() : ftypes::BaseChecker(1 /* level */
m_types.push_back(c.GetTypeByPath({"lateral"})); m_types.push_back(c.GetTypeByPath({"lateral"}));
} }
IsCharingStationChecker::IsCharingStationChecker() : ftypes::BaseChecker(2 /* level */)
{
Classificator const & c = classif();
m_types.push_back(c.GetTypeByPath({"amenity", "charging_station"}));
}
IsCharingStationCarChecker::IsCharingStationCarChecker() : ftypes::BaseChecker(3 /* level */) IsCharingStationCarChecker::IsCharingStationCarChecker() : ftypes::BaseChecker(3 /* level */)
{ {
Classificator const & c = classif(); Classificator const & c = classif();

View File

@@ -519,14 +519,6 @@ public:
DECLARE_CHECKER_INSTANCE(IsDirectionalChecker); DECLARE_CHECKER_INSTANCE(IsDirectionalChecker);
}; };
class IsCharingStationChecker : public ftypes::BaseChecker
{
IsCharingStationChecker();
public:
DECLARE_CHECKER_INSTANCE(IsCharingStationChecker);
};
class IsCharingStationCarChecker : public ftypes::BaseChecker class IsCharingStationCarChecker : public ftypes::BaseChecker
{ {
IsCharingStationCarChecker(); IsCharingStationCarChecker();

View File

@@ -0,0 +1,98 @@
#include "indexer/ftypes_subtypes.hpp"
#include "base/assert.hpp"
#include "coding/csv_reader.hpp"
#include "coding/reader_streambuf.hpp"
#include "indexer/classificator.hpp"
#include "platform/platform.hpp"
#include "defines.hpp"
namespace ftypes
{
/// Constructor
Subtypes::Subtypes()
{
auto const & classificator = classif();
// Get the stream to the CSV file.
Platform & platform = GetPlatform();
unique_ptr<ModelReader> reader = platform.GetReader(SUBTYPES_FILE);
ReaderStreamBuf buffer(std::move(reader));
istream stream(&buffer);
// Load the CSV file and go through the lines of it one by one.
for (auto const & columns : coding::CSVRunner(coding::CSVReader(stream, true, ';')))
{
// Skip empty lines.
if (columns.empty())
continue;
// There only should be two columns.
if (columns.size() != 2)
{
ASSERT(false, ("Parsing of subtypes file: Invalid columns \"", columns, "\""));
break;
}
// Parse the column. The first column has the type definitions(s) and the second one has the associated subtype definitions(s).
vector<uint32_t> types;
vector<uint32_t> subtypes;
for (int columnIndex = 0; columnIndex < 2; columnIndex++) {
string_view const column = columns[columnIndex];
// Separate the different type definitions by the `,`. There needs to be at least one.
vector<string_view> const typeDefinitions = strings::Tokenize(column, ",");
if (typeDefinitions.size() < 1)
{
ASSERT(columnIndex != 0, ("Parsing of subtypes file: Invalid or missing types definition \"", column, "\""));
ASSERT(columnIndex == 0, ("Parsing of subtypes file: Invalid or missing subtypes definition \"", column, "\""));
break;
}
// Parse the type definitions and convert them to actual types. Invalid types are getting skipped.
vector<uint32_t> typesInColumn;
for (auto typeDefinition : typeDefinitions)
{
vector<string_view> const typePath = strings::Tokenize(typeDefinition, "|");
uint32_t const type = classificator.GetTypeByPathSafe(typePath);
if (type != IndexAndTypeMapping::INVALID_TYPE)
{
typesInColumn.push_back(type);
vector<string> typesAndSubtypesPath(typePath.begin(), typePath.end());
if (find(m_typesAndSubtypesPaths.begin(), m_typesAndSubtypesPaths.end(), typesAndSubtypesPath) == m_typesAndSubtypesPaths.end())
m_typesAndSubtypesPaths.push_back(typesAndSubtypesPath);
}
else
{
ASSERT(columnIndex != 0, ("Parsing of subtypes file: Invalid type \"", typeDefinition, "\""));
ASSERT(columnIndex == 0, ("Parsing of subtypes file: Invalid subtype \"", typeDefinition, "\""));
}
}
if (columnIndex == 0)
types = typesInColumn;
else
subtypes = typesInColumn;
}
for (auto type : types)
{
m_types.insert(type);
m_typesWithSubtypes[type] = subtypes;
}
for (auto subtype : subtypes)
{
m_subtypes.insert(subtype);
}
}
}
/// Static instance
Subtypes const & Subtypes::Instance()
{
static Subtypes instance;
return instance;
}
} // namespace ftypes

View File

@@ -0,0 +1,122 @@
#pragma once
#include <map>
#include <unordered_set>
#include <vector>
namespace ftypes
{
using namespace std;
class Subtypes
{
public:
/// Static instance
static Subtypes const & Instance();
/**
* Checks if the given type is a type with subtypes or a subtype
* @param type The type to check
* @return `true` if it is a type with subtypes or a subtype, otherwise `false`
*/
bool IsTypeWithSubtypesOrSubtype(uint32_t const type) const
{
return IsTypeWithSubtypes(type) || IsSubtype(type);
}
/**
* Checks if the given type is a type with subtypes
* @param type The type to check
* @return `true` if it is a type with subtypes, otherwise `false`
*/
bool IsTypeWithSubtypes(uint32_t const type) const
{
return find(m_types.begin(), m_types.end(), type) != m_types.end();
}
/**
* Checks if the given type is a subtype
* @param type The type to check
* @return `true` if it is a subtype, otherwise `false`
*/
bool IsSubtype(uint32_t const type) const
{
return find(m_subtypes.begin(), m_subtypes.end(), type) != m_subtypes.end();
}
/**
* Checks if the given type is a subtype of a given parent type
* @param type The type to check
* @param parentType The possible parent type
* @return `true` if it is a subtype of the parent type, otherwise `false`
*/
bool IsSubtypeOfParentType(uint32_t const type, uint32_t const parentType) const
{
auto position = m_typesWithSubtypes.find(parentType);
if (position != m_typesWithSubtypes.end()) {
vector<uint32_t> subtypes = position->second;
return find(subtypes.begin(), subtypes.end(), type) != subtypes.end();
}
return false;
}
/**
* Compares to given types based on their type relation
* @param firstType The first type to compare
* @param secondType The type to compare
* @return `true` if the first type is a subtype but the second one isn't, `false` if it is the other way around
*/
optional<bool> ComaprisonResultBasedOnTypeRelation(uint32_t const firstType, uint32_t const secondType) const
{
bool const firstTypeIsSubtype = IsSubtype(firstType);
bool const secondTypeIsSubtype = IsSubtype(secondType);
if (!firstTypeIsSubtype && !secondTypeIsSubtype)
return {};
else if (firstTypeIsSubtype && !secondTypeIsSubtype)
return false;
else if (!firstTypeIsSubtype && secondTypeIsSubtype)
return true;
// If they got to here, both are subtypes. So use the order of the subtypes for the comparison.
for (auto [types, subtypes] : m_typesWithSubtypes)
{
for (auto const subtype : subtypes)
{
if (subtype == firstType)
return true;
else if (subtype == secondType)
return false;
}
}
return {};
}
/**
* Checks if the given type path belongs to a type with subtypes or a subtype
* @param typePath The type path to check
* @return `true` if it is a type with subtypes or a subtype, otherwise `false`
*/
bool IsPathOfTypeWithSubtypesOrSubtype(vector<string> const typePath) const
{
return find(m_typesAndSubtypesPaths.begin(), m_typesAndSubtypesPaths.end(), typePath) != m_typesAndSubtypesPaths.end();
}
private:
/// Constructor
Subtypes();
/// Types, which have subtypes, as unordered set for faster check performance
unordered_set<uint32_t> m_types;
/// Subypes as unordered set for faster check performance
unordered_set<uint32_t> m_subtypes;
/// Types with their associated subtypes
map<uint32_t, vector<uint32_t>> m_typesWithSubtypes;
/// Paths of types, which have subtypes, and subtypes for the generator
vector<vector<string>> m_typesAndSubtypesPaths;
};
} // namespace ftypes

View File

@@ -3,6 +3,7 @@
#include "indexer/feature.hpp" #include "indexer/feature.hpp"
#include "indexer/feature_algo.hpp" #include "indexer/feature_algo.hpp"
#include "indexer/ftypes_matcher.hpp" #include "indexer/ftypes_matcher.hpp"
#include "indexer/ftypes_subtypes.hpp"
#include "indexer/road_shields_parser.hpp" #include "indexer/road_shields_parser.hpp"
#include "geometry/mercator.hpp" #include "geometry/mercator.hpp"
@@ -119,6 +120,7 @@ std::string MapObject::GetLocalizedAllTypes(bool withMainType) const
copy.SortBySpec(); copy.SortBySpec();
auto const & isPoi = ftypes::IsPoiChecker::Instance(); auto const & isPoi = ftypes::IsPoiChecker::Instance();
auto const & subtypes = ftypes::Subtypes::Instance();
auto const & isDirectional = ftypes::IsDirectionalChecker::Instance(); auto const & isDirectional = ftypes::IsDirectionalChecker::Instance();
auto const & amenityChecker = ftypes::IsAmenityChecker::Instance(); auto const & amenityChecker = ftypes::IsAmenityChecker::Instance();
auto const & charingStationCarChecker = ftypes::IsCharingStationCarChecker::Instance(); auto const & charingStationCarChecker = ftypes::IsCharingStationCarChecker::Instance();
@@ -141,7 +143,7 @@ std::string MapObject::GetLocalizedAllTypes(bool withMainType) const
} }
// Ignore types that are not POI // Ignore types that are not POI
if (!isMainType && !isPoi(type) && !isDirectional(type)) if (!isMainType && !isPoi(type) && !subtypes.IsTypeWithSubtypesOrSubtype(type) && !isDirectional(type))
continue; continue;
// Ignore general amenity // Ignore general amenity

View File

@@ -33,7 +33,8 @@ std::array<UniString, 11> const kAllowedMisprints = {
}; };
static std::pair<UniString, UniString> const kPreprocessReplacements[] = { static std::pair<UniString, UniString> const kPreprocessReplacements[] = {
{MakeUniString("a. d."), MakeUniString("an den")}, {MakeUniString("a. d."), MakeUniString("auf an den der")},
{MakeUniString("a.d."), MakeUniString("auf an den der")}, // hacks to handle "(auf/an) (den/der)" in German
{MakeUniString("arm. gen"), MakeUniString("armádneho generála")}, {MakeUniString("arm. gen"), MakeUniString("armádneho generála")},
{MakeUniString("atr'"), MakeUniString("ambohitr'")}, {MakeUniString("atr'"), MakeUniString("ambohitr'")},
{MakeUniString("a. v."), MakeUniString("asociación vecinal")}, {MakeUniString("a. v."), MakeUniString("asociación vecinal")},
@@ -127,6 +128,7 @@ static std::pair<UniString, UniString> const kPreprocessReplacements[] = {
{MakeUniString("пр-д"), MakeUniString("проезд")}, {MakeUniString("пр-д"), MakeUniString("проезд")},
{MakeUniString("пр-т"), MakeUniString("проспект")}, {MakeUniString("пр-т"), MakeUniString("проспект")},
{MakeUniString("р"), MakeUniString("район")}, {MakeUniString("р"), MakeUniString("район")},
{MakeUniString("ж.к."), MakeUniString("жк")},
{MakeUniString("আ/এ"), MakeUniString("আবাসিক এলাকা")}, {MakeUniString("আ/এ"), MakeUniString("আবাসিক এলাকা")},
}; };

View File

@@ -94,7 +94,6 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"accs", {"access"}}, {"accs", {"access"}},
{"aceq", {"acequia"}}, {"aceq", {"acequia"}},
{"ach", {"ancien chemin"}}, {"ach", {"ancien chemin"}},
//{"a.d", {"auf der", "an der"}}, // unreachable
{"adi", {"ambodi"}}, {"adi", {"ambodi"}},
{"adm", {"admirała", "admirał"}}, {"adm", {"admirała", "admirał"}},
{"afb", {"air force base"}}, {"afb", {"air force base"}},
@@ -418,6 +417,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"diag", {"diagonal"}}, {"diag", {"diagonal"}},
{"dig", {"digues", "digue"}}, {"dig", {"digues", "digue"}},
{"disem", {"diseminado"}}, {"disem", {"diseminado"}},
{"dist", {"distribuidor"}},
{"distr", {"districte"}}, {"distr", {"districte"}},
{"divers", {"diversion"}}, {"divers", {"diversion"}},
{"dkm", {"denkmal"}}, {"dkm", {"denkmal"}},
@@ -622,7 +622,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"hse", {"house"}}, {"hse", {"house"}},
{"hs", {"haus", "high school"}}, {"hs", {"haus", "high school"}},
{"hst", {"haltestelle"}}, {"hst", {"haltestelle"}},
{"ht", {"heights", "hinteres", "hinterer", "hinter", "hintere"}}, {"ht", {"heights", "hinteres", "hinterer", "hinter", "hintere"}},
{"htl", {"höhere technische lehranstalt"}}, {"htl", {"höhere technische lehranstalt"}},
{"hts", {"heights"}}, {"hts", {"heights"}},
{"htt", {"hütte"}}, {"htt", {"hütte"}},
@@ -680,12 +680,12 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"kel", {"kelurahan"}}, {"kel", {"kelurahan"}},
{"kga", {"kleingartenanlage"}}, {"kga", {"kleingartenanlage"}},
{"kgg", {"kagalang-galang"}}, {"kgg", {"kagalang-galang"}},
{"kg", {"katastralgemeinde", "…kogel", "kampong", "kogel"}}, {"kg", {"katastralgemeinde", "kampong", "kogel"}},
{"kgv", {"kleingartenverein"}}, {"kgv", {"kleingartenverein"}},
{"kh", {"krankenhaus"}}, {"kh", {"krankenhaus"}},
{"kj", {"kuja"}}, {"kj", {"kuja"}},
{"k", {"kalea", "katu", "koło", "kolo", "kort(e)"}}, {"k", {"kalea", "katu", "koło", "kolo", "kort", "korte"}},
{"kl", {"konzentrationslager", "klein", "kleines", "kleiner", "kleine", "kylä"}}, {"kl", {"konzentrationslager", "klein", "kleines", "kleiner", "kleine", "kylä"}},
{"knm", {"khu nghỉ mát"}}, {"knm", {"khu nghỉ mát"}},
{"kol", {"kolonel", "kolonia"}}, {"kol", {"kolonel", "kolonia"}},
{"kon", {"koning", "koningin"}}, {"kon", {"koning", "koningin"}},
@@ -935,6 +935,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"port", {"port"}}, {"port", {"port"}},
{"pot", {"poterne"}}, {"pot", {"poterne"}},
{"pour", {"pourtour"}}, {"pour", {"pourtour"}},
{"ppal", {"principal"}},
{"p", {"pfad", "polku", "phường", "pater", "paseo"}}, {"p", {"pfad", "polku", "phường", "pater", "paseo"}},
{"pplk", {"podplukovníka"}}, {"pplk", {"podplukovníka"}},
{"ppłk", {"ppułkownika", "podpułkownika", "podpułkownik"}}, {"ppłk", {"ppułkownika", "podpułkownika", "podpułkownik"}},
@@ -1507,12 +1508,11 @@ void QueryParams::ClearStreetIndices()
AdditionalCommonTokens() AdditionalCommonTokens()
{ {
char const * arr[] = { char const * arr[] = {
"a", "and", "s", "the", // English "a", "and", "s", "the", // English
"am", "an", "auf", "der", "im", "und", "zum", // German "am", "an", "auf", "der", "im", "und", "zum", // German
"as", "d", "da", "das", "de", "del", "di", "do", "as", "d", "da", "das", "de", "del", "di", "do", "dos", "du", "e",
"dos", "du", "e", "el", "et", "la", "las", "le", "el", "et", "la", "las", "le", "les", "los", "o", "os", "y", // French, Italian, Portuguese, Spanish
"les", "los", "o", "os", "y", // French, Italian, Portuguese, Spanish "в", "и", "за", "к", "на", "я" // Cyrillic
"в", "и", "на", "я" // Cyrillic
}; };
for (char const * s : arr) for (char const * s : arr)
m_strings.insert(NormalizeAndSimplifyString(s)); m_strings.insert(NormalizeAndSimplifyString(s));

View File

@@ -124,6 +124,7 @@ copy_resources(
editor.config editor.config
packed_polygons.bin packed_polygons.bin
patterns.txt patterns.txt
subtypes.csv
transit_colors.txt transit_colors.txt
types.txt types.txt
mapcss-mapping.csv mapcss-mapping.csv

View File

@@ -7,6 +7,9 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
272CA4462F126795005A3F5B /* ftypes_subtypes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 272CA4442F126795005A3F5B /* ftypes_subtypes.hpp */; };
272CA4472F126795005A3F5B /* ftypes_subtypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 272CA4452F126795005A3F5B /* ftypes_subtypes.cpp */; };
272CA44D2F12723B005A3F5B /* subtypes.csv in Resources */ = {isa = PBXBuildFile; fileRef = 272CA44C2F12723B005A3F5B /* subtypes.csv */; };
27BCD5272E93E625002C50F0 /* feature_charge_sockets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27BCD5262E93E625002C50F0 /* feature_charge_sockets.cpp */; }; 27BCD5272E93E625002C50F0 /* feature_charge_sockets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27BCD5262E93E625002C50F0 /* feature_charge_sockets.cpp */; };
27BCD5282E93E625002C50F0 /* feature_charge_sockets.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 27BCD5252E93E625002C50F0 /* feature_charge_sockets.hpp */; }; 27BCD5282E93E625002C50F0 /* feature_charge_sockets.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 27BCD5252E93E625002C50F0 /* feature_charge_sockets.hpp */; };
27BCD52A2E93E670002C50F0 /* feature_charge_sockets_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27BCD5292E93E670002C50F0 /* feature_charge_sockets_test.cpp */; }; 27BCD52A2E93E670002C50F0 /* feature_charge_sockets_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27BCD5292E93E670002C50F0 /* feature_charge_sockets_test.cpp */; };
@@ -230,6 +233,9 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
272CA4442F126795005A3F5B /* ftypes_subtypes.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ftypes_subtypes.hpp; sourceTree = "<group>"; };
272CA4452F126795005A3F5B /* ftypes_subtypes.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ftypes_subtypes.cpp; sourceTree = "<group>"; };
272CA44C2F12723B005A3F5B /* subtypes.csv */ = {isa = PBXFileReference; lastKnownFileType = text; name = subtypes.csv; path = ../../data/subtypes.csv; sourceTree = "<group>"; };
27BCD5252E93E625002C50F0 /* feature_charge_sockets.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = feature_charge_sockets.hpp; sourceTree = "<group>"; }; 27BCD5252E93E625002C50F0 /* feature_charge_sockets.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = feature_charge_sockets.hpp; sourceTree = "<group>"; };
27BCD5262E93E625002C50F0 /* feature_charge_sockets.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = feature_charge_sockets.cpp; sourceTree = "<group>"; }; 27BCD5262E93E625002C50F0 /* feature_charge_sockets.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = feature_charge_sockets.cpp; sourceTree = "<group>"; };
27BCD5292E93E670002C50F0 /* feature_charge_sockets_test.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = feature_charge_sockets_test.cpp; sourceTree = "<group>"; }; 27BCD5292E93E670002C50F0 /* feature_charge_sockets_test.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = feature_charge_sockets_test.cpp; sourceTree = "<group>"; };
@@ -499,6 +505,7 @@
3496AB9C1DC1FA5200C5DDBA /* drules_proto.bin */, 3496AB9C1DC1FA5200C5DDBA /* drules_proto.bin */,
3496ABA21DC1FA7200C5DDBA /* editor.config */, 3496ABA21DC1FA7200C5DDBA /* editor.config */,
3496ABAE1DC1FAC900C5DDBA /* minsk-pass.mwm */, 3496ABAE1DC1FAC900C5DDBA /* minsk-pass.mwm */,
272CA44C2F12723B005A3F5B /* subtypes.csv */,
3496AB961DC1FA2000C5DDBA /* types.txt */, 3496AB961DC1FA2000C5DDBA /* types.txt */,
); );
name = Resources; name = Resources;
@@ -689,6 +696,8 @@
3D74ABBB1EA67C1E0063A898 /* ftypes_mapping.hpp */, 3D74ABBB1EA67C1E0063A898 /* ftypes_mapping.hpp */,
675340D51A3F540F00A0A8C3 /* ftypes_matcher.cpp */, 675340D51A3F540F00A0A8C3 /* ftypes_matcher.cpp */,
675340D61A3F540F00A0A8C3 /* ftypes_matcher.hpp */, 675340D61A3F540F00A0A8C3 /* ftypes_matcher.hpp */,
272CA4452F126795005A3F5B /* ftypes_subtypes.cpp */,
272CA4442F126795005A3F5B /* ftypes_subtypes.hpp */,
675340DB1A3F540F00A0A8C3 /* index_builder.cpp */, 675340DB1A3F540F00A0A8C3 /* index_builder.cpp */,
675340DC1A3F540F00A0A8C3 /* index_builder.hpp */, 675340DC1A3F540F00A0A8C3 /* index_builder.hpp */,
675340DF1A3F540F00A0A8C3 /* interval_index_builder.hpp */, 675340DF1A3F540F00A0A8C3 /* interval_index_builder.hpp */,
@@ -815,6 +824,7 @@
675341411A3F540F00A0A8C3 /* scales.hpp in Headers */, 675341411A3F540F00A0A8C3 /* scales.hpp in Headers */,
675341321A3F540F00A0A8C3 /* interval_index_builder.hpp in Headers */, 675341321A3F540F00A0A8C3 /* interval_index_builder.hpp in Headers */,
40009062201F5CB000963E18 /* cell_value_pair.hpp in Headers */, 40009062201F5CB000963E18 /* cell_value_pair.hpp in Headers */,
272CA4462F126795005A3F5B /* ftypes_subtypes.hpp in Headers */,
347F337C1C454242009758CC /* rank_table.hpp in Headers */, 347F337C1C454242009758CC /* rank_table.hpp in Headers */,
40D62CEF23F2E8BE009A20F5 /* dat_section_header.hpp in Headers */, 40D62CEF23F2E8BE009A20F5 /* dat_section_header.hpp in Headers */,
F61F83071E4B187500B37B7A /* road_shields_parser.hpp in Headers */, F61F83071E4B187500B37B7A /* road_shields_parser.hpp in Headers */,
@@ -935,6 +945,7 @@
3496ABA31DC1FA7200C5DDBA /* editor.config in Resources */, 3496ABA31DC1FA7200C5DDBA /* editor.config in Resources */,
3496AB9D1DC1FA5200C5DDBA /* drules_proto_clear.bin in Resources */, 3496AB9D1DC1FA5200C5DDBA /* drules_proto_clear.bin in Resources */,
3496AB9E1DC1FA5200C5DDBA /* drules_proto_dark.bin in Resources */, 3496AB9E1DC1FA5200C5DDBA /* drules_proto_dark.bin in Resources */,
272CA44D2F12723B005A3F5B /* subtypes.csv in Resources */,
FA67C84F26BB36D700B33DCA /* categories_brands.txt in Resources */, FA67C84F26BB36D700B33DCA /* categories_brands.txt in Resources */,
FA67C84626BB356800B33DCA /* categories_cuisines.txt in Resources */, FA67C84626BB356800B33DCA /* categories_cuisines.txt in Resources */,
3496ABA11DC1FA5200C5DDBA /* drules_proto.bin in Resources */, 3496ABA11DC1FA5200C5DDBA /* drules_proto.bin in Resources */,
@@ -1027,6 +1038,7 @@
4043C0B924ACBA3300545FD8 /* transliteration_loader.cpp in Sources */, 4043C0B924ACBA3300545FD8 /* transliteration_loader.cpp in Sources */,
6753411C1A3F540F00A0A8C3 /* shared_load_info.cpp in Sources */, 6753411C1A3F540F00A0A8C3 /* shared_load_info.cpp in Sources */,
67BC92F41D21476500A4A378 /* string_slice.cpp in Sources */, 67BC92F41D21476500A4A378 /* string_slice.cpp in Sources */,
272CA4472F126795005A3F5B /* ftypes_subtypes.cpp in Sources */,
BBB7060F23E46E0100A7F29A /* isolines_info.cpp in Sources */, BBB7060F23E46E0100A7F29A /* isolines_info.cpp in Sources */,
408FE47724FEB95600F5D06D /* metadata_serdes.cpp in Sources */, 408FE47724FEB95600F5D06D /* metadata_serdes.cpp in Sources */,
34583BCB1C88552100F94664 /* map_object.cpp in Sources */, 34583BCB1C88552100F94664 /* map_object.cpp in Sources */,