Compare commits

..

2 Commits

Author SHA1 Message Date
zyphlar
1c79bc5d28 remove nits
Signed-off-by: zyphlar <zyphlar@gmail.com>
2026-01-15 11:01:01 -08:00
zyphlar
6ee40d4414 [ci] Use Docker Android SDK container for builds
Signed-off-by: zyphlar <zyphlar@gmail.com>
2026-01-14 10:11:12 -08:00
24 changed files with 142 additions and 327 deletions

View File

@@ -34,28 +34,79 @@ on:
- track_generator/**
- 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:
lint:
name: Android Lint
runs-on: ubuntu-latest
container:
image: codeberg.org/comaps/docker-android-sdk:latest
options: --user root
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Parallel submodules checkout
- name: Cache world map
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
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
run: |
git submodule sync --recursive
git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Lint
shell: bash
working-directory: android
run: ./gradlew -Pandroidauto=true lint
run: |
# cd ..
# ./configure.sh
# cd android
./gradlew -Pandroidauto=true lint
android-check:
name: Build Android Debug
runs-on: ubuntu-latest
container:
image: codeberg.org/comaps/docker-android-sdk:latest
options: --user root
strategy:
fail-fast: false
matrix:
@@ -71,23 +122,32 @@ jobs:
cancel-in-progress: true
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
uses: actions/checkout@v4
with:
fetch-depth: 200 # enough to get all commits for the current day
- name: Parallel submodules checkout
- name: Cache world map
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
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
run: |
git submodule sync --recursive
git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2
uses: https://github.com/hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ matrix.flavor }}
@@ -98,13 +158,14 @@ jobs:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
run: |
cmake --version
ninja --version
cd ..
./configure.sh
cd android
./gradlew -P${{ matrix.arch }} assemble${{ matrix.flavor }}
- name: Upload ${{ matrix.flavor }} apk
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: android-${{ matrix.flavor }}
path: android/app/build/outputs/apk/**/OrganicMaps-*.apk
path: android/app/build/outputs/apk/**/*.apk
if-no-files-found: error

View File

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

View File

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

View File

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

View File

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

View File

@@ -287,13 +287,13 @@
</style>
<style name="MwmWidget.BottomSheetDialog" parent="Widget.Material3.BottomSheet.Modal">
<item name="backgroundTint">?appBackground</item>
<item name="backgroundTint">?colorSurfaceContainerLow</item>
<item name="elevationOverlayEnabled">false</item>
<item name="shapeAppearance">@style/ShapeAppearance.Material3.LargeComponent</item>
</style>
<style name="MwmWidget.BottomSheet" parent="MwmWidget.BottomSheetDialog">
<item name="android:background">?appBackground</item>
<item name="android:background">?colorSurfaceContainerLow</item>
<item name="behavior_hideable">false</item>
</style>

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,2 +0,0 @@
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

@@ -11,7 +11,6 @@
#include "indexer/classificator.hpp"
#include "indexer/feature_impl.hpp"
#include "indexer/ftypes_matcher.hpp"
#include "indexer/ftypes_subtypes.hpp"
#include "platform/platform.hpp"
@@ -352,11 +351,9 @@ private:
// - both amenity-charging_station-motorcar and amenity-charging_station-bicycle are left;
void LeaveLongestTypes(std::vector<generator::TypeStrings> & matchedTypes)
{
// 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)
auto const isChargingStation = [](auto const & lhs, auto const & rhs)
{
return subtypes.IsPathOfTypeWithSubtypesOrSubtype(lhs) || subtypes.IsPathOfTypeWithSubtypesOrSubtype(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";
};
auto const equalPrefix = [](auto const & lhs, auto const & rhs)
@@ -377,10 +374,9 @@ void LeaveLongestTypes(std::vector<generator::TypeStrings> & matchedTypes)
return lhs < 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)
auto const isEqual = [&equalPrefix, &isChargingStation](auto const & lhs, auto const & rhs)
{
if (hasSubtypeRelatedTypes(lhs, rhs))
if (isChargingStation(lhs, rhs))
return false;
if (equalPrefix(lhs, rhs))

View File

@@ -14,7 +14,6 @@
270C9C282E16AB6F00ABA688 /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 270C9C252E16AB6300ABA688 /* Profile.swift */; };
27176A862E65B0150015F25F /* Icon.icon in Resources */ = {isa = PBXBuildFile; fileRef = 27176A852E65B0150015F25F /* 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 */; };
272F1F3B2E0EE0A300FA52EF /* NoExistingProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 272F1F3A2E0EE09500FA52EF /* NoExistingProfileView.swift */; };
272F1F3D2E0EE0C800FA52EF /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 272F1F3C2E0EE0C400FA52EF /* ProfileView.swift */; };
@@ -765,7 +764,6 @@
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>"; };
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>"; };
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>"; };
@@ -3956,7 +3954,6 @@
F623DA6A1C9C2731006A3436 /* opening_hours_how_to_edit.html */,
FA85F632145DDDC20090E1A0 /* packed_polygons.bin */,
451950391B7A3E070085DA05 /* patterns.txt */,
272CA4482F127221005A3F5B /* subtypes.csv */,
FAAEA7D0161BD26600CCD661 /* synonyms.txt */,
BB25B1A51FB32767007276FA /* transit_colors.txt */,
FA64D9A813F975AD00350ECF /* types.txt */,
@@ -4284,7 +4281,6 @@
34AB66681FC5AA330078E451 /* TransportTransitPedestrian.xib in Resources */,
F6D67CDE2062BBA60032FD38 /* MWMBCCreateCategoryAlert.xib in Resources */,
3490D2E31CE9DD2500D0B838 /* MWMSideButtonsView.xib in Resources */,
272CA4492F127221005A3F5B /* subtypes.csv in Resources */,
F6E2FE2E1E097BA00083EBEC /* MWMStreetEditorEditTableViewCell.xib in Resources */,
3463BA691DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */,
F623DA6C1C9C2731006A3436 /* opening_hours_how_to_edit.html in Resources */,

View File

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

View File

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

View File

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

View File

@@ -753,6 +753,12 @@ IsDirectionalChecker::IsDirectionalChecker() : ftypes::BaseChecker(1 /* level */
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 */)
{
Classificator const & c = classif();

View File

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

View File

@@ -1,94 +0,0 @@
#include "indexer/ftypes_subtypes.hpp"
#include "base/assert.hpp"
#include "coding/csv_reader.hpp"
#include "indexer/classificator.hpp"
#include "platform/platform.hpp"
namespace ftypes
{
/// Constructor
Subtypes::Subtypes()
{
auto const & classificator = classif();
// Get the actual path to the CSV file.
Platform & platform = GetPlatform();
string const filePath = platform.ReadPathForFile("subtypes.csv");
// Load the CSV file and go through the lines of it one by one.
for (auto const & columns : coding::CSVRunner(coding::CSVReader(filePath, 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

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

View File

@@ -127,7 +127,6 @@ static std::pair<UniString, UniString> const kPreprocessReplacements[] = {
{MakeUniString("пр-д"), MakeUniString("проезд")},
{MakeUniString("пр-т"), MakeUniString("проспект")},
{MakeUniString("р"), MakeUniString("район")},
{MakeUniString("ж.к."), MakeUniString("жк")},
{MakeUniString("আ/এ"), MakeUniString("আবাসিক এলাকা")},
};

View File

@@ -89,7 +89,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"9", {"nove", "nueve", "تسع", "nueve", "novena", "noveno", "nona", "nono"}},
{"9o", {"noveno", "nono"}},
{"9th", {"ninth"}},
{"a", {"am", "auto-estrada", "aikštė", "autoroute"}},
{"a", {"am", "auto-estrada", "aikštė"}},
{"abe", {"abbaye"}},
{"accs", {"access"}},
{"aceq", {"acequia"}},
@@ -97,8 +97,6 @@ unordered_map<string, vector<string>> const kSynonyms = {
//{"a.d", {"auf der", "an der"}}, // unreachable
{"adi", {"ambodi"}},
{"adm", {"admirała", "admirał"}},
{"aerd", {"aérodrome"}},
{"aerg", {"aérogare"}},
{"afb", {"air force base"}},
{"agl", {"agglomération"}},
{"aha", {"andoha"}},
@@ -163,12 +161,9 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"awg", {"awang"}},
{"az", {"azinhaga"}},
{"ba", {"banan"}},
{"balc", {"balcon"}},
{"balnr", {"balneario"}},
{"barda", {"barriada"}},
{"barr", {"barrière"}},
{"basn", {"basin"}},
{"bass", {"bassin"}},
{"bast", {"baston"}},
{"bat", {"batalionu", "batalion", "batalionów", "bataliony"}},
{"bayer", {"bayerische", "bayerisch", "bayerischer", "bayerisches"}},
@@ -222,7 +217,6 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"brg", {"brigadeiro", "bourg", "bundesrealgymnasium"}},
{"brgy", {"barangay"}},
{"bri", {"bridge"}},
{"brg", {"barrage"}},
{"brk", {"break", "brook"}},
{"bro", {"brother"}},
{"brw", {"brow"}},
@@ -264,19 +258,17 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"care", {"carrières", "carrière"}},
{"carr", {"carré"}},
{"carref", {"carrefour"}},
{"cas", {"caserne"}},
{"cau", {"carreau"}},
{"caus", {"causeway"}},
{"cav", {"cavée"}},
{"cbtiz", {"cobertizo"}},
{"cc", {"calçada", "centro comercial"}},
{"ccal", {"centre commercial"}},
{"c", {"cesta", "carrer", "calle", "centre"}},
{"cckq", {"căn cứ không quân"}},
{"ccnh", {"calçadinha"}},
{"cct", {"circuit"}},
{"ccvcn", {"circunvalación"}},
{"cd", {"cadde", "caddesi", "chemin départemental"}},
{"cd", {"cadde", "caddesi"}},
{"", {"cao đẳng"}},
{"cds", {"cul-de-sac"}},
{"ceb", {"ciclo do ensino básico"}},
@@ -290,13 +282,12 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"cft", {"croft"}},
{"cgne", {"campagne"}},
{"ch", {"church", "chaussee", "chemin", "chairman", "chase"}},
{"chau", {"chaussée"}},
{"che", {"chemins", "chemin"}},
{"chem", {"cheminements", "cheminement"}},
{"chi", {"charmille"}},
{"chal", {"chalet"}},
{"chl", {"chalet"}},
{"chor", {"chorążego", "chorąży"}},
{"chp", {"chapelle", "champ"}},
{"chp", {"chapelle"}},
{"chs", {"chaussée", "chaussées"}},
{"cht", {"château"}},
{"chv", {"chemins vicinaux", "chemin vicinal"}},
@@ -312,7 +303,6 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"ck", {"creek"}},
{"clb", {"câu lạc bộ"}},
{"cl", {"close", "calle"}},
{"clr", {"clairiere"}},
{"cllja", {"calleja"}},
{"cllón", {"callejón"}},
{"cllzo", {"callizo"}},
@@ -356,11 +346,9 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"cpl", {"corporal"}},
{"cps", {"copse"}},
{"cpt", {"captain"}},
{"cr", {"cour"}},
{"cra", {"colexio rural agrupado", "carrera", "colegio rural agrupado"}},
{"crc", {"circus"}},
{"cr", {"creek", "crescent", "county route", "county road"}},
{"crs", {"cours"}},
{"crcs", {"circus"}},
{"crd", {"crossroad"}},
{"cres", {"crescent"}},
@@ -508,8 +496,8 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"estda", {"estrada"}},
{"est", {"estate", "estació"}},
{"estr", {"estrada"}},
{"etg", {"étang"}},
{"etang", {"étang"}},
{"étang", {"étang"}},
{"etar", {"estação de tratamento de águas residuais"}},
{"etorb", {"etorbidea"}},
{"eu", {"escola universitària"}},
@@ -525,7 +513,6 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"fac", {"facultat"}},
{"fawy", {"fairway"}},
{"fb", {"fabrik"}},
{"fbg", {"faubourg"}},
{"fbrca", {"fábrica"}},
{"fca", {"fábrica", "finca"}},
{"fc", {"futebol clube"}},
@@ -551,7 +538,6 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"fr", {"father", "frontage", "frei"}},
{"frm", {"ferme", "fermes"}},
{"frnt", {"front"}},
{"frt", {"forêt"}},
{"frtg", {"frontage"}},
{"frwy", {"freeway"}},
{"fshr", {"foreshore"}},
@@ -566,14 +552,11 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"gal", {"galerie", "general", "galeries"}},
{"garn", {"garenne"}},
{"gbd", {"grand boulevard"}},
{"gdav", {"grande avenue"}},
{"gde", {"gemeinde"}},
{"gden", {"grands ensembles", "grand ensemble"}},
{"gd", {"gasilski dom"}},
{"gdpl", {"grande place"}},
{"gdn", {"gardens", "garden"}},
{"gdns", {"gardens"}},
{"gdr", {"grande rue"}},
{"gebr", {"gebroeders"}},
{"gen", {"generaal", "generała", "generála", "general"}},
{"geo", {"george"}},
@@ -597,9 +580,8 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"gra", {"grange"}},
{"grg", {"gymnasium und realgymnasium"}},
{"gr",
{"grande rue", "grandes rues", "gracht", "grandrue", "gränd", "graben", "grovet", "gränden", "grove", "großes",
{"grande rue", "grandes rues", "gracht", "grandrue", "gränd", "graben", "grovet", "gränden", "grove", "großes",
"große", "großer"}},
{"grge", {"grange"}},
{"gri", {"grille"}},
{"grim", {"grimpette"}},
{"grnd", {"ground"}},
@@ -640,7 +622,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"hse", {"house"}},
{"hs", {"haus", "high school"}},
{"hst", {"haltestelle"}},
{"ht", {"heights", "hinteres", "hinterer", "hinter", "hintere"}},
{"ht", {"heights", "hinteres", "hinterer", "hinter", "hintere"}},
{"htl", {"höhere technische lehranstalt"}},
{"hts", {"heights"}},
{"htt", {"hütte"}},
@@ -698,12 +680,12 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"kel", {"kelurahan"}},
{"kga", {"kleingartenanlage"}},
{"kgg", {"kagalang-galang"}},
{"kg", {"katastralgemeinde", "kampong", "kogel"}},
{"kg", {"katastralgemeinde", "…kogel", "kampong", "kogel"}},
{"kgv", {"kleingartenverein"}},
{"kh", {"krankenhaus"}},
{"kj", {"kuja"}},
{"k", {"kalea", "katu", "koło", "kolo", "kort", "korte"}},
{"kl", {"konzentrationslager", "klein", "kleines", "kleiner", "kleine", "kylä"}},
{"k", {"kalea", "katu", "koło", "kolo", "kort(e)"}},
{"kl", {"konzentrationslager", "klein", "kleines", "kleiner", "kleine", "kylä"}},
{"knm", {"khu nghỉ mát"}},
{"kol", {"kolonel", "kolonia"}},
{"kon", {"koning", "koningin"}},
@@ -758,9 +740,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"mans", {"mansions"}},
{"mar", {"marche", "marches"}},
{"marsz", {"marszałka (marszałek)"}},
{"mais", {"maison"}},
{"maz", {"mazowiecka", "mazowiecki", "mazowieckie"}},
{"mch", {"marché"}},
{"md", {"mead"}},
{"mdr", {"meander"}},
{"mdw", {"meadow", "meadows"}},
@@ -789,7 +769,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"mndr", {"meander"}},
{"mn", {"mossèn"}},
{"mnr", {"manor"}},
{"mnt", {"muntele", "maantee", "montée"}},
{"mnt", {"muntele", "maantee"}},
{"mon", {"monument"}},
{"mons", {"monsenhor"}},
{"mpal", {"municipal"}},
@@ -920,7 +900,6 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"pi", {"polígon industrial"}},
{"pje", {"pasaje"}},
{"pj", {"polícia judiciária"}},
{"pk", {"point kilométrique"}},
{"pkg", {"parking"}},
{"pkld", {"parklands"}},
{"pko", {"puistikko"}},
@@ -983,7 +962,6 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"prq", {"presquîle"}},
{"prtco", {"pórtico"}},
{"prt", {"petite route"}},
{"prte", {"porte"}},
{"prv", {"parvis"}},
{"przla", {"prazuela"}},
{"psge", {"passage"}},
@@ -1043,7 +1021,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"rdge", {"ridge"}},
{"rdg", {"ridge"}},
{"rdpt", {"rond-point"}},
{"rd", {"road", "route départementale"}},
{"rd", {"road"}},
{"rdsd", {"roadside"}},
{"rds", {"roads"}},
{"rdtj", {"raudteejaam"}},
@@ -1070,7 +1048,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"rnde", {"ronde"}},
{"rnd", {"round"}},
{"rnge", {"range"}},
{"rn", {"rinne", "route nationale"}},
{"rn", {"rinne"}},
{"robt", {"robert"}},
{"roc", {"roc", "rocade"}},
{"roqt", {"roquet"}},
@@ -1221,7 +1199,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"tercera", {"3", "3a"}},
{"tercero", {"3", "3o"}},
{"term", {"terminal"}},
{"terr", {"terrace", "terrasse"}},
{"terr", {"terrace"}},
{"ter", {"terrace"}},
{"tg", {"tanjong"}},
{"thcs", {"trung học cơ sở"}},
@@ -1292,7 +1270,6 @@ unordered_map<string, vector<string>> const kSynonyms = {
{"va", {"vale"}},
{"v:a", {"västra"}},
{"vbt", {"viện bảo tàng"}},
{"vc", {"voie communale"}},
{"vche", {"vieux chemin"}},
{"vcto", {"viaducto"}},
{"vda", {"viuda"}},
@@ -1530,11 +1507,12 @@ void QueryParams::ClearStreetIndices()
AdditionalCommonTokens()
{
char const * arr[] = {
"a", "and", "s", "the", // English
"am", "an", "auf", "der", "im", "und", "zum", // German
"as", "d", "da", "das", "de", "del", "di", "do", "dos", "du", "e",
"el", "et", "la", "las", "le", "les", "los", "o", "os", "y", // French, Italian, Portuguese, Spanish
"в", "и", "за", "к", "на", "я" // Cyrillic
"a", "and", "s", "the", // English
"am", "an", "auf", "der", "im", "und", "zum", // German
"as", "d", "da", "das", "de", "del", "di", "do",
"dos", "du", "e", "el", "et", "la", "las", "le",
"les", "los", "o", "os", "y", // French, Italian, Portuguese, Spanish
"в", "и", "на", "я" // Cyrillic
};
for (char const * s : arr)
m_strings.insert(NormalizeAndSimplifyString(s));

View File

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