Compare commits

..

52 Commits

Author SHA1 Message Date
zyphlar
f8e2eb037f Fix conf path 2025-06-20 15:20:10 +00:00
zyphlar
7591e99cef Fix MwmDiff tool building 2025-06-19 12:51:08 +00:00
zyphlar
8584d6634e pastk4: s14>13 for poor 2025-06-19 12:26:02 +00:00
zyphlar
b8b529ca78 WIP Laos test gen 2025-06-19 12:21:14 +00:00
zyphlar
486babe27e Revert "Upgrade all high_f2 to high"
This reverts commit 2e7713568a.
2025-06-17 11:04:38 +00:00
zyphlar
fedbc2d57f pastk3: all > f2, poor > f4, high_f2 > s16 2025-06-17 11:04:19 +00:00
zyphlar
2e7713568a Upgrade all high_f2 to high 2025-06-16 14:18:48 +00:00
zyphlar
dfaac372ee Add all missing as poor 2025-06-16 14:17:19 +00:00
zyphlar
15fd7a0bd5 Upgrade poor to 100m f2 s14 2025-06-16 14:15:38 +00:00
zyphlar
467e97b231 Algeria Central to poor 2025-06-16 14:15:08 +00:00
zyphlar
2075b79dee Add new mwms as poor
Signed-off-by: zyphlar <zyphlar@gmail.com>
2025-06-16 14:12:41 +00:00
zyphlar
55d162f354 WIP Tune isolines profiles
Signed-off-by: zyphlar <zyphlar@gmail.com>
2025-06-16 10:18:44 +00:00
zyphlar
2fa1714575 WIP [cmake] Fix cppjansson build
Signed-off-by: zyphlar <zyphlar@gmail.com>
2025-06-16 10:06:44 +00:00
zyphlar
9a2dc676a7 Update generator scripts for docker/prod
Signed-off-by: zyphlar <zyphlar@gmail.com>
2025-06-11 01:34:00 +00:00
zyphlar
4bcf5a8f98 Add docker run script
Signed-off-by: zyphlar <zyphlar@gmail.com>
2025-06-11 01:04:21 +00:00
Konstantin Pastbin
6afa6a8476 Increase Features threads from 12 to 16
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-06-11 01:04:21 +00:00
zyphlar
b04bda4ff2 Update tools/unix/docker_maps_generator.sh
Signed-off-by: zyphlar <zyphlar@noreply.codeberg.org>
2025-06-11 01:04:21 +00:00
zyphlar
da150c87a5 Tweaks, get subway hooks proper
Signed-off-by: zyphlar <zyphlar@gmail.com>
2025-06-11 01:04:21 +00:00
Konstantin Pastbin
e17e122f0b Update subways path
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-06-11 01:04:21 +00:00
Konstantin Pastbin
96d9cbf1fa Update INI
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-06-11 01:04:21 +00:00
zyphlar
cf2fea216e Fix s3 variables
Signed-off-by: zyphlar <zyphlar@gmail.com>
2025-06-11 01:04:21 +00:00
zyphlar
2c9a85d5a3 Map generation mostly working, but slow and not doing full planet with add-ins yet
Signed-off-by: zyphlar <zyphlar@gmail.com>
2025-06-11 01:04:21 +00:00
zyphlar
42c30cb775 On-server tweaks
Signed-off-by: zyphlar <zyphlar@gmail.com>
2025-06-11 01:04:21 +00:00
zyphlar
c58f915063 Add files to automatically generate maps with Docker
Signed-off-by: zyphlar <zyphlar@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
d754bf0e0a 4 threads for Taiwan_North search indexer.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
622a5bf3bf Avoid py dependencies.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
cecb9d9200 Do not inherit "oneway" and "surface" from Relation.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
f731ff0612 Fixed hgt tile's grid traversal.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Alexander Borsuk
2524d074b4 Quotes support for CSV parser
Signed-off-by: Alexander Borsuk <me@alex.bio>
2025-06-11 01:04:21 +00:00
Viktor Govako
d56432e484 Borders 2025-06-11 01:04:21 +00:00
Viktor Govako
04b3c01816 Check default max speeds consistency.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
8dc633bfd9 Added SrtmTileManager::GetBilinearHeight.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
23f8a73ef6 Print SRTM tiles usage.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
099ecde058 Added maxspeed OSM related warnings.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
6d6140ee33 Fixed getting url bug.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
623c4ed9fe Fixed altitude tiles cache bug.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
b4cc6b140b Fixed races.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
fca2a64a80 Added SrtmTileManager::GetTriangleHeight.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
81c06f1ae7 Use pre-downloaded wiki descriptions.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
2bfcf0089b Updated scripts.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
0d08a53224 Added "tr" description language.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
980bd36d02 Stop running StageMWM when any country was failed.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
e16c8f3591 Get all URLs.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
727c0db4b0 Enable StageDescriptions.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
3b44a61f9d Set boost addr2line option for stacktrace.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:21 +00:00
Viktor Govako
3195450519 Fixed some 'double comparison' tests.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:20 +00:00
Viktor Govako
58f7c24620 Crash dump in topography_generator_tool.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:20 +00:00
Alexander Borsuk
bcf65ee2e5 Use release with debug info for easier crashlog analysis
Note: use tools/unix/build_omim.sh -R
2025-06-11 01:04:20 +00:00
vng
fc859c65d5 [tools] Build Release with Debug info with a script
TODO: Support this configuration in python generator build
2025-06-11 01:04:20 +00:00
vng
794f0f01aa Added LTO and -Ofast.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
2025-06-11 01:04:20 +00:00
Alexander Borsuk
032183414b Fixed reading SRTM from squashfs 2025-06-11 01:04:20 +00:00
vng
aab883171d Added ASTER tif into SRTM hgt converter.
Signed-off-by: vng <viktor.govako@gmail.com>
2025-06-11 01:04:20 +00:00
143 changed files with 15960 additions and 14852 deletions

1
.gitignore vendored
View File

@@ -9,6 +9,7 @@ Makefile.Release
object_script.*.Debug
object_script.*.Release
compile_commands.json
*.local.*
stxxl.errlog
stxxl.log

View File

@@ -31,6 +31,7 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY)
set(JANSSON_WITHOUT_TESTS ON)
add_subdirectory(jansson/jansson/)
target_include_directories(jansson INTERFACE "${PROJECT_BINARY_DIR}/3party/jansson/jansson/include")
add_library(jansson::jansson ALIAS jansson)
# Add gflags library.
set(GFLAGS_BUILD_TESTING OFF)

View File

@@ -94,6 +94,11 @@ if (PLATFORM_WIN)
)
endif()
# Try fast native arch.
if (PLATFORM_LINUX)
add_compile_options(-march=native)
endif()
# Built-in CMake configurations: Debug, Release, RelWithDebInfo, MinSizeRel
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_definitions(-DDEBUG)
@@ -103,12 +108,29 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel")
add_definitions(-DRELEASE)
if (NOT MSVC)
add_compile_options(-Ofast) # Also enables -ffast-math
add_compile_options(-Ofast $<$<CXX_COMPILER_ID:GNU>:-flto=auto>) # Also enables -ffast-math
endif()
else()
message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE})
endif()
if (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
add_compile_options(-fno-omit-frame-pointer)
endif()
# Linux GCC LTO plugin fix.
if (PLATFORM_LINUX AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_BUILD_TYPE MATCHES "^Rel"))
# To force errors if LTO was not enabled.
add_compile_options(-fno-fat-lto-objects)
# To fix ar and ranlib "plugin needed to handle lto object".
string(REGEX MATCH "[0-9]+" GCC_MAJOR_VERSION ${CMAKE_CXX_COMPILER_VERSION})
file(GLOB_RECURSE plugin /usr/lib/gcc/*/${GCC_MAJOR_VERSION}/liblto_plugin.so)
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>")
endif()
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
if (PLATFORM_LINUX OR PLATFORM_ANDROID)

View File

@@ -1 +0,0 @@
Gönüllüler tarafından yürütülen, OpenStreetMap harita verisini kullanan, şeffaf, mahremiyete saygılı, kamu yararına olma kararlılığıyla güçlendirilmiş bir özgür yazılım.

View File

@@ -1 +0,0 @@
Kolayca gezinin - Seyahatinizde keşfe çıkın - Gönüllüler tarafından yapıldı

View File

@@ -1 +0,0 @@
CoMaps - İnternetsiz Seyahat Edin

View File

@@ -1 +0,0 @@
Kolayca gezinin - Seyahatinizde keşfe çıkın - Gönüllüler tarafından yapıldı

View File

@@ -1 +0,0 @@
CoMaps - Mahremiyetli Seyahat

View File

@@ -34,6 +34,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StyleRes;
import androidx.annotation.UiThread;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
@@ -119,8 +120,6 @@ import app.organicmaps.widget.menu.MainMenu;
import app.organicmaps.widget.placepage.PlacePageController;
import app.organicmaps.widget.placepage.PlacePageData;
import app.organicmaps.widget.placepage.PlacePageViewModel;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
@@ -188,7 +187,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
private MapFragment mMapFragment;
private View mPointChooser;
private MaterialToolbar mPointChooserToolbar;
private Toolbar mPointChooserToolbar;
private RoutingPlanInplaceController mRoutingPlanInplaceController;

View File

@@ -15,12 +15,11 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StyleRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentFactory;
import androidx.fragment.app.FragmentManager;
import com.google.android.material.appbar.MaterialToolbar;
import app.organicmaps.MwmApplication;
import app.organicmaps.R;
import app.organicmaps.SplashActivity;
@@ -149,7 +148,7 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
onBackPressed();
}
protected MaterialToolbar getToolbar()
protected Toolbar getToolbar()
{
return findViewById(R.id.toolbar);
}

View File

@@ -10,13 +10,11 @@ import androidx.annotation.CallSuper;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.MaterialToolbar;
import app.organicmaps.R;
import app.organicmaps.util.UiUtils;
import app.organicmaps.util.Utils;
@@ -25,7 +23,7 @@ import app.organicmaps.widget.PlaceholderView;
public abstract class BaseMwmRecyclerFragment<T extends RecyclerView.Adapter> extends Fragment
{
private MaterialToolbar mToolbar;
private Toolbar mToolbar;
@SuppressWarnings("NotNullFieldNotInitialized")
@NonNull

View File

@@ -6,13 +6,11 @@ import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentFactory;
import androidx.fragment.app.FragmentManager;
import com.google.android.material.appbar.MaterialToolbar;
import app.organicmaps.R;
import app.organicmaps.util.UiUtils;
import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener;
@@ -28,7 +26,7 @@ public abstract class BaseToolbarActivity extends BaseMwmFragmentActivity
{
super.onSafeCreate(savedInstanceState);
MaterialToolbar toolbar = getToolbar();
Toolbar toolbar = getToolbar();
if (toolbar != null)
{
int title = getToolbarTitle();
@@ -44,7 +42,7 @@ public abstract class BaseToolbarActivity extends BaseMwmFragmentActivity
}
}
protected void setupHomeButton(@NonNull MaterialToolbar toolbar)
protected void setupHomeButton(@NonNull Toolbar toolbar)
{
UiUtils.showHomeUpButton(toolbar);
}
@@ -94,7 +92,7 @@ public abstract class BaseToolbarActivity extends BaseMwmFragmentActivity
if (title != null)
{
MaterialToolbar toolbar = getToolbar();
Toolbar toolbar = getToolbar();
if (toolbar != null && toolbar.getTitle() != null)
{
mLastTitle = toolbar.getTitle().toString();

View File

@@ -480,13 +480,6 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde
UiUtils.showIf(mSearchResultsMode && !TextUtils.isEmpty(found), mFoundName);
long size = getMapDisplaySize();
mSize.setText(StringUtils.getFileSizeString(mFragment.requireContext(), size));
mStatusIcon.update(mItem);
}
private long getMapDisplaySize()
{
long size;
if (mItem.status == CountryItem.STATUS_ENQUEUED ||
mItem.status == CountryItem.STATUS_PROGRESS ||
@@ -494,16 +487,13 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde
{
size = mItem.enqueuedSize;
}
else if (mItem.status == CountryItem.STATUS_FAILED ||
mItem.status == CountryItem.STATUS_DOWNLOADABLE)
{
size = mItem.totalSize;
}
else
{
size = ((!mSearchResultsMode && mMyMapsMode) ? mItem.size : mItem.totalSize);
}
return size;
mSize.setText(StringUtils.getFileSizeString(mFragment.requireContext(), size));
mStatusIcon.update(mItem);
}
}

View File

@@ -16,6 +16,7 @@ import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
@@ -46,7 +47,6 @@ import app.organicmaps.util.WindowInsetUtils;
import app.organicmaps.widget.PlaceholderView;
import app.organicmaps.widget.SearchToolbarController;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
import com.google.android.material.tabs.TabLayout;
@@ -226,7 +226,7 @@ public class SearchFragment extends BaseMwmFragment
private void updateFrames()
{
final boolean hasQuery = mToolbarController.hasQuery();
MaterialToolbar toolbar = mToolbarController.getToolbar();
Toolbar toolbar = mToolbarController.getToolbar();
AppBarLayout.LayoutParams lp = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
lp.setScrollFlags(hasQuery ? AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS
| AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL : 0);

View File

@@ -27,6 +27,7 @@ import androidx.annotation.DimenRes;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.graphics.Insets;
@@ -36,8 +37,6 @@ import androidx.core.view.WindowInsetsControllerCompat;
import androidx.recyclerview.widget.RecyclerView;
import app.organicmaps.MwmApplication;
import app.organicmaps.R;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.textfield.TextInputLayout;
import java.util.Objects;
@@ -194,7 +193,7 @@ public final class UiUtils
hide(tv);
}
public static void showHomeUpButton(MaterialToolbar toolbar)
public static void showHomeUpButton(Toolbar toolbar)
{
toolbar.setNavigationIcon(ThemeUtils.getResource(toolbar.getContext(), androidx.appcompat.R.attr.homeAsUpIndicator));
}
@@ -298,7 +297,7 @@ public final class UiUtils
systemInsets.right, view.getPaddingBottom());
}
public static void setupNavigationIcon(@NonNull MaterialToolbar toolbar,
public static void setupNavigationIcon(@NonNull Toolbar toolbar,
@NonNull View.OnClickListener listener)
{
View customNavigationButton = toolbar.findViewById(R.id.back);
@@ -312,14 +311,14 @@ public final class UiUtils
}
}
public static void setupHomeUpButtonAsNavigationIcon(@NonNull MaterialToolbar toolbar,
public static void setupHomeUpButtonAsNavigationIcon(@NonNull Toolbar toolbar,
@NonNull View.OnClickListener listener)
{
UiUtils.showHomeUpButton(toolbar);
toolbar.setNavigationOnClickListener(listener);
}
public static void clearHomeUpButton(@NonNull MaterialToolbar toolbar)
public static void clearHomeUpButton(@NonNull Toolbar toolbar)
{
toolbar.setNavigationIcon(null);
toolbar.setNavigationOnClickListener(null);

View File

@@ -9,10 +9,8 @@ import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat;
import com.google.android.material.appbar.MaterialToolbar;
import app.organicmaps.R;
import app.organicmaps.util.UiUtils;
import app.organicmaps.util.Utils;
@@ -23,7 +21,7 @@ public class ToolbarController
@Nullable
private Activity mActivity;
@NonNull
private final MaterialToolbar mToolbar;
private final Toolbar mToolbar;
@NonNull
protected final View.OnClickListener mNavigationClickListener = view -> onUpClick();
@@ -41,7 +39,7 @@ public class ToolbarController
setSupportActionBar(activity, mToolbar);
}
private void setSupportActionBar(@NonNull Activity activity, @NonNull MaterialToolbar toolbar)
private void setSupportActionBar(@NonNull Activity activity, @NonNull Toolbar toolbar)
{
AppCompatActivity appCompatActivity = (AppCompatActivity) activity;
appCompatActivity.setSupportActionBar(toolbar);
@@ -88,7 +86,7 @@ public class ToolbarController
}
@NonNull
public MaterialToolbar getToolbar()
public Toolbar getToolbar()
{
return mToolbar;
}

View File

@@ -14,6 +14,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
@@ -32,8 +33,6 @@ import app.organicmaps.util.Graphics;
import app.organicmaps.util.InputUtils;
import app.organicmaps.util.UiUtils;
import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
@@ -204,7 +203,7 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
private void initToolbar(View view)
{
MaterialToolbar toolbar = view.findViewById(R.id.toolbar);
Toolbar toolbar = view.findViewById(R.id.toolbar);
ViewCompat.setOnApplyWindowInsetsListener(toolbar, PaddingInsetsListener.excludeBottom());

View File

@@ -18,6 +18,7 @@ import android.widget.TextView;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
@@ -51,8 +52,6 @@ import app.organicmaps.widget.placepage.sections.PlacePageOpeningHoursFragment;
import app.organicmaps.widget.placepage.sections.PlacePagePhoneFragment;
import app.organicmaps.widget.placepage.sections.PlacePageProductsFragment;
import app.organicmaps.widget.placepage.sections.PlacePageWikipediaFragment;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.button.MaterialButton;
import java.util.ArrayList;
@@ -87,7 +86,7 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
private View mFrame;
// Preview.
private ViewGroup mPreview;
private MaterialToolbar mToolbar;
private Toolbar mToolbar;
private TextView mTvTitle;
private TextView mTvSecondaryTitle;
private TextView mTvSubtitle;

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/accept_btn"
style="@style/MwmWidget.Button.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/accept"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/sharing_options_img_size">
<TextView
android:id="@+id/decline_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="?attr/selectableItemBackground"
android:fontFamily="@string/robotoMedium"
android:gravity="center"
android:letterSpacing="0.01"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/text_size_body_3"
android:textStyle="normal"
android:text="@string/learn_more"
tools:ignore="UnusedAttribute"
tools:text="NOT NOW" />
</FrameLayout>
</LinearLayout>
</merge>

View File

@@ -8,7 +8,7 @@
android:gravity="center"
android:orientation="vertical">
<com.google.android.material.imageview.ShapeableImageView
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="32dp"
@@ -22,7 +22,7 @@
android:gravity="center"
android:orientation="vertical">
<com.google.android.material.textview.MaterialTextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
@@ -31,7 +31,7 @@
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline4"
android:textStyle="bold" />
<com.google.android.material.textview.MaterialTextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/car_used_on_the_car_screen"
@@ -39,7 +39,7 @@
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
</LinearLayout>
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/btn_continue"
style="@style/MwmWidget.Button.Accent"
android:layout_width="match_parent"

View File

@@ -7,13 +7,13 @@
android:gravity="center"
android:orientation="vertical">
<com.google.android.material.imageview.ShapeableImageView
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="32dp"
app:srcCompat="@drawable/ic_location_permission_request" />
<com.google.android.material.textview.MaterialTextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
@@ -23,7 +23,7 @@
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline4"
android:textStyle="bold" />
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/btn_grant_permissions"
style="@style/MwmWidget.Button.Accent"
android:layout_width="match_parent"

View File

@@ -6,7 +6,7 @@
android:background="?cardBackground"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"

View File

@@ -6,7 +6,7 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
@@ -15,7 +15,7 @@
android:gravity="end|center_vertical"
android:theme="@style/MwmWidget.ToolbarTheme"
tools:ignore="UnusedAttribute">
</com.google.android.material.appbar.MaterialToolbar>
</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:layout_marginTop="@dimen/margin_half_double_plus"
android:orientation="horizontal"

View File

@@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?windowBackgroundForced">
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
@@ -22,7 +22,7 @@
android:layout_gravity="end|center_vertical"
android:scaleType="centerInside"
android:contentDescription="@string/save" />
</com.google.android.material.appbar.MaterialToolbar>
</androidx.appcompat.widget.Toolbar>
<FrameLayout
style="@style/MwmWidget.FrameLayout.Elevation"
android:layout_width="match_parent"

View File

@@ -7,7 +7,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
@@ -43,7 +43,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.appbar.MaterialToolbar>
</androidx.appcompat.widget.Toolbar>
<FrameLayout
android:id="@+id/fragment_container"

View File

@@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
@@ -18,7 +18,7 @@
android:id="@+id/save"
style="@style/MwmWidget.Downloader.ToolbarButton"
android:text="@string/editor_report_problem_send_button"/>
</com.google.android.material.appbar.MaterialToolbar>
</androidx.appcompat.widget.Toolbar>
<ScrollView
android:id="@+id/scrollView"

View File

@@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_point_chooser"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
@@ -41,7 +41,7 @@
</LinearLayout>
</com.google.android.material.appbar.MaterialToolbar>
</androidx.appcompat.widget.Toolbar>
<TextView
android:layout_width="match_parent"

View File

@@ -11,7 +11,7 @@
<FrameLayout android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:theme="@style/MwmWidget.ToolbarTheme"
@@ -131,7 +131,7 @@
</RelativeLayout>
</com.google.android.material.appbar.MaterialToolbar>
</androidx.appcompat.widget.Toolbar>
</FrameLayout>
<FrameLayout
android:id="@+id/driving_options_btn_container"

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"

View File

@@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle.NoElevation"
@@ -11,4 +11,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>
</com.google.android.material.appbar.MaterialToolbar>
</androidx.appcompat.widget.Toolbar>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
@@ -13,4 +13,4 @@
android:orientation="vertical">
<include layout="@layout/toolbar_search_controls" />
</LinearLayout>
</com.google.android.material.appbar.MaterialToolbar>
</androidx.appcompat.widget.Toolbar>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.MaterialToolbar
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle.NoElevation"
@@ -12,4 +12,4 @@
android:orientation="vertical">
<include layout="@layout/toolbar_search_controls" />
</LinearLayout>
</com.google.android.material.appbar.MaterialToolbar>
</androidx.appcompat.widget.Toolbar>

View File

@@ -45,7 +45,7 @@
<string name="type.amenity.charging_station">محطة شحن</string>
<string name="type.amenity.charging_station.bicycle">محطة شحن الدراجات</string>
<string name="type.amenity.charging_station.motorcar">محطة شحن السيارات</string>
<string name="type.amenity.childcare">حضّانة</string>
<string name="type.amenity.childcare">حضانة</string>
<string name="type.amenity.cinema">سينما</string>
<string name="type.leisure.bowling_alley">صالة بولينج</string>
<string name="type.amenity.clinic">عيادة</string>
@@ -62,7 +62,7 @@
<string name="type.amenity.exhibition_centre">مركز المعرض</string>
<string name="type.amenity.money_transfer">تحويل المال</string>
<string name="type.amenity.music_school">مدرسة موسيقى</string>
<string name="type.amenity.language_school">مدرسة لغات</string>
<string name="type.amenity.language_school">مدرسة لغة</string>
<string name="type.office.diplomatic">سفارة</string>
<string name="type.amenity.fast_food">وجبات سريعة</string>
<string name="type.amenity.ferry_terminal">محطة عبّارات</string>
@@ -1278,7 +1278,4 @@
<string name="type.amenity.dojo">دوجو</string>
<!-- https://wiki.openstreetmap.org/wiki/Tag:leisure=sports_hall -->
<string name="type.leisure.sports_hall">الصالة الرياضية</string>
<string name="type.aerialway.mixed_lift">رفع مختلط</string>
<string name="type.amenity.love_hotel">فندق جب</string>
<string name="type.amenity.studio">معرض</string>
</resources>

View File

@@ -1332,8 +1332,4 @@
<string name="type.organic.only">有機</string>
<string name="type.organic.yes">有機</string>
<string name="type.power.pole">電柱</string>
<string name="type.amenity.shelter.lean_to">三壁の避難所</string>
<string name="type.amenity.vending_machine.excrement_bags">うんち袋の自販機</string>
<string name="type.amenity.parcel_locker">宅配ロッカー</string>
<string name="type.amenity.waste_transfer_station">ゴミ処理場</string>
</resources>

View File

@@ -179,7 +179,7 @@
<string name="type.amenity.veterinary">獸醫</string>
<string name="type.amenity.waste_basket">垃圾箱</string>
<string name="type.amenity.waste_disposal">垃圾</string>
<string name="type.amenity.waste_transfer_station">廢物轉運站</string>
<string name="type.amenity.waste_transfer_station">垃圾轉運站</string>
<string name="type.amenity.water_point">飲水站</string>
<string name="type.amenity.water_point.drinking_water_no">飲水站</string>
<string name="type.barrier">障礙物</string>
@@ -1281,5 +1281,4 @@
<!-- https://wiki.openstreetmap.org/wiki/Tag:leisure=sports_hall -->
<string name="type.leisure.sports_hall">體育館</string>
<string name="type.attraction.bumper_car">碰碰車</string>
<string name="type.leisure.track">賽道</string>
</resources>

View File

@@ -32,7 +32,4 @@
<string name="type.organic.yes">有機</string>
<string name="type.power.pole">電線桿</string>
<string name="type.amenity.shelter.lean_to">三面避難所</string>
<string name="type.amenity.waste_transfer_station">垃圾轉運站</string>
<string name="type.amenity.vending_machine.excrement_bags">撿便袋販賣機</string>
<string name="type.amenity.parcel_locker">智取櫃</string>
</resources>

View File

@@ -67,7 +67,11 @@ UNIT_TEST(AlmostEqualULPs_double)
TEST(!base::AlmostEqualULPs(1.0, -1.0), ());
TEST(!base::AlmostEqualULPs(2.0, -2.0), ());
TEST(!base::AlmostEqualULPs(dmax, -dmax), ());
// That's why AlmostEqualULPs is a strange function, IMHO.
TEST(!base::AlmostEqualULPs(0.0, eps), ());
TEST(!base::AlmostEqualULPs(-eps, 0.0), ());
TEST(!base::AlmostEqualULPs(eps, 2.0*eps), ());
}
UNIT_TEST(AlmostEqualULPs_float)
@@ -91,7 +95,11 @@ UNIT_TEST(AlmostEqualULPs_float)
TEST(!base::AlmostEqualULPs(1.0f, -1.0f), ());
TEST(!base::AlmostEqualULPs(2.0f, -2.0f), ());
TEST(!base::AlmostEqualULPs(dmax, -dmax), ());
// That's why AlmostEqualULPs is a strange function, IMHO.
TEST(!base::AlmostEqualULPs(0.0f, eps), ());
TEST(!base::AlmostEqualULPs(-eps, 0.0f), ());
TEST(!base::AlmostEqualULPs(eps, 2.0f*eps), ());
}
UNIT_TEST(AlmostEqual_Smoke)

View File

@@ -34,6 +34,8 @@ public:
}
size_t size() const { return m_map.size(); }
auto begin() const { return m_map.begin(); }
auto end() const { return m_map.end(); }
protected:
/// @todo buffer_vector is not suitable now, because Key/Value is not default constructible.

View File

@@ -440,15 +440,66 @@ bool AlmostEqual(std::string const & str1, std::string const & str2, size_t mism
return false;
}
void ParseCSVRow(std::string const & s, char const delimiter, std::vector<std::string> & target)
namespace
{
// Trim, unquote the string, and unescape two double quotes.
std::string & UnescapeCSVColumn(std::string & s)
{
Trim(s);
if (s.size() < 2)
return s;
if (*s.begin() == '"' && *s.rbegin() == '"')
s = s.substr(1, s.size() - 2);
for (size_t i = 1; i < s.size(); ++i)
if (s[i] == '"' && s[i - 1] == '"')
s.erase(i, 1);
return s;
}
} // namespace
void ParseCSVRow(std::string const & row, char const delimiter, std::vector<std::string> & target)
{
target.clear();
TokenizeIterator<SimpleDelimiter, std::string::const_iterator, true /* KeepEmptyTokens */> it(s.begin(), s.end(), delimiter);
for (; it; ++it)
std::string prevColumns;
for (TokenizeIterator<SimpleDelimiter, std::string::const_iterator, true /* KeepEmptyTokens */> it {row.begin(), row.end(), delimiter}; it; ++it)
{
std::string column(*it);
Trim(column);
target.push_back(std::move(column));
std::string_view column = *it;
size_t const quotesCount = std::count(column.begin(), column.end(), '"');
bool const evenQuotes = quotesCount % 2 == 0;
if (prevColumns.empty())
{
if (evenQuotes)
{
if (quotesCount == 0)
target.emplace_back(column);
else
{
std::string strColumn {column};
target.push_back(UnescapeCSVColumn(strColumn));
}
}
else
{
prevColumns = column;
prevColumns.push_back(',');
}
}
else
{
prevColumns.append(column);
if (evenQuotes)
prevColumns.push_back(',');
else
{
target.push_back(UnescapeCSVColumn(prevColumns));
prevColumns.clear();
}
}
}
// Special case: if the string is empty, return an empty array instead of {""}.

View File

@@ -8,6 +8,8 @@
#include <string>
#include <vector>
namespace csv_reader_test
{
using platform::tests_support::ScopedFile;
using Row = coding::CSVReader::Row;
@@ -179,3 +181,41 @@ UNIT_TEST(CSVReaderIterator)
TEST_EQUAL(index, answer.size(), ());
}
}
UNIT_TEST(CSVReaderEmptyColumns)
{
auto const kContentWithEmptyColumns = ",,2,,4,\n,,,,,";
auto const fileName = "test.csv";
ScopedFile sf(fileName, kContentWithEmptyColumns);
Rows const answer = {{"", "", "2", "", "4", ""}, {"", "", "", "", "", ""}};
coding::CSVReader reader(sf.GetFullPath());
size_t index = 0;
while (auto const optionalRow = reader.ReadRow())
{
TEST_EQUAL(*optionalRow, answer[index], ());
++index;
}
TEST_EQUAL(index, answer.size(), ());
TEST(!reader.ReadRow(), ());
TEST(!reader.ReadRow(), ());
}
UNIT_TEST(CSVReaderQuotes)
{
auto const kContentWithQuotes = R"(noquotes, "" , "with space","with, comma","""double"" quotes","""double,"", commas", """""",)";
auto const fileName = "test.csv";
ScopedFile sf(fileName, kContentWithQuotes);
Rows const answer = {{"noquotes", "", "with space", "with, comma", "\"double\" quotes", "\"double,\", commas","\"\"", ""}};
coding::CSVReader reader(sf.GetFullPath());
size_t index = 0;
while (auto const optionalRow = reader.ReadRow())
{
TEST_EQUAL(*optionalRow, answer[index], ());
++index;
}
TEST_EQUAL(index, answer.size(), ());
TEST(!reader.ReadRow(), ());
TEST(!reader.ReadRow(), ());
}
} // namespace csv_reader_test

View File

@@ -1,14 +1,11 @@
#include "testing/testing.hpp"
#include "coding/internal/file_data.hpp"
#include "coding/writer.hpp"
#include "base/logging.hpp"
#include <cstring> // strlen
#include <fstream>
#include <string>
#include <vector>
namespace file_data_test
{
@@ -220,6 +217,35 @@ UNIT_TEST(EmptyFile)
TEST(DeleteFileX(copy), ());
}
UNIT_TEST(RenameOnExistingFile)
{
using namespace base;
std::string const name = "test.empty";
std::string const copy = "test.empty.copy";
{
FileData f(name, FileData::Op::WRITE_TRUNCATE);
uint8_t const x = 1;
f.Write(&x, 1);
}
{
FileData f(copy, FileData::Op::WRITE_TRUNCATE);
uint8_t const x = 2;
f.Write(&x, 1);
}
TEST(RenameFileX(name, copy), ());
{
FileData f(copy, FileData::Op::READ);
uint8_t x;
f.Read(0, &x, 1);
TEST_EQUAL(x, 1, ());
}
TEST(DeleteFileX(copy), ());
}
// Made this 'obvious' test for getline. I had (or not?) behaviour when 'while (getline)' loop
// didn't get last string in file without trailing '\n'.
UNIT_TEST(File_StdGetLine)

View File

@@ -59,7 +59,6 @@
2236962
2301728
2302755
2364429
2367520
2374579
2399474
@@ -67,7 +66,6 @@
2498323
2499106
2500128
2592674
2631706
2695475
2706568
@@ -89,6 +87,7 @@
3434779
3542630
3552308
3584191
3629602
3677972
3681605
@@ -96,7 +95,6 @@
3684408
3773998
3832097
3874837
3881273
3881787
3968060
@@ -146,7 +144,6 @@
6164237
6173981
6247213
6272197
6291544
6381914
6381921
@@ -163,7 +160,6 @@
6967599
7105644
7224647
7302655
7353344
7434609
7542806
@@ -193,15 +189,12 @@
8550167
8916559
8947848
9099495
9163744
9211020
9326109
9404166
9682745
9718290
9815480
9868939
9868678
9868950
10066329
10167040
@@ -212,164 +205,142 @@
10340289
10395294
10426903
10506258
10592406
10790054
11053224
11057133
11058780
11112295
11184810
11190117
11250586
11387999
11579812
11585379
11453035
11584112
11710882
11711154
11716458
11720246
11720952
11770767
11781233
11836942
11841150
11898395
11979115
12000284
12039862
12105912
12504182
12372094
12517551
12699589
12837073
12700809
12763315
12895428
12896712
12898689
13028554
13029267
13031851
13161612
13155550
13163437
13224123
13229526
13357519
13407549
13420474
13484259
13538264
13554898
13555607
13685196
13615592
13620648
13746411
13749671
13942770
13947850
13952918
14014162
14144428
14209512
14275263
14539184
14802147
14934482
14951168
14999725
14999213
15000299
15014691
15022389
15037299
15062700
15066325
15086900
15094016
15128239
15214341
15260347
15263452
15263457
15263939
15591638
15592411
15592899
15656370
15658734
15690752
15754290
15763456
15790320
15898392
15900208
15902016
15920858
15921852
15921870
16027569
16056407
16064048
16087552
16088855
16103246
16115926
16117459
16118756
16119285
16169823
16173957
16180686
16182236
16183529
16248287
16311234
16372627
16308697
16311482
16316664
16391736
16431936
16433750
16557154
16575614
16579778
16579836
16728450
16733986
16740096
16741158
16742950
16746278
16746306
16747109
16748864
16749632
16750080
16750592
16752972
16756055
16757286
16760320
16760658
16762880
16763432
16763913
16764506
16765952
16766323
16767702
16770999
16774560
16775925
16776958
16777215
223300167
234881023
436602368
437326080
438572045
439885588
441002267
441140803
441199131
441272132
441403975
441925171
442905727
443115881
443432263
443510271
446405263
451800027
452107824
452109632
452377439
452524280
452764770
452983541
452984574
452968274
452984831
575358531
587201269
609045837
654706176
655629312
658186261
659106075
659244611
659375940
659507783
660157219
666290539
670074880
670398976
670414670
671088382
666683518
670628088
671054374
671057702
671061056
671088639
856032768
856756480
@@ -378,7 +349,6 @@
857223704
857282841
857551774
858002445
858401316
858466343
858532890
@@ -387,13 +357,12 @@
859519803
859645463
860111940
860432667
860571203
860629531
860834375
861027891
861097451
861483811
861295871
861355571
861690961
861690972
861885229
@@ -401,33 +370,28 @@
862148400
862348902
862862663
862940671
863203947
863664762
863850275
864585864
864835622
864964125
864925824
865356306
865445970
865871792
866144274
868514559
868862139
869387687
869585866
869590934
869652178
870704341
871230427
871536408
871540032
871741262
871807839
871811973
871954680
872195170
872215006
872413941
872414974
872395302
872415231
1074136576
1078675011
1090058488
1090519039
1216522952
1291845632
@@ -442,7 +406,6 @@
1293490457
1293753629
1294082594
1294210061
1294608932
1294673959
1294738992
@@ -451,13 +414,14 @@
1295200561
1295201075
1295397940
1295429823
1295523604
1295527997
1295658816
1295720469
1295727419
1295853079
1295855912
1296187970
1296316234
1296319556
1296381741
@@ -468,6 +432,7 @@
1296845900
1296910148
1296977469
1297041991
1297109072
1297235507
1297305067
@@ -478,9 +443,7 @@
1297898588
1298019613
1298092845
1298117829
1298131758
1298227553
1298283903
1298356016
1298359132
@@ -494,46 +457,38 @@
1300793480
1301043238
1301056384
1301171741
1301133440
1301433013
1301563922
1301653586
1301661112
1301714310
1301714571
1302101349
1302438038
1303425444
1302185921
1302351890
1303556514
1304148906
1304535147
1304608947
1304722175
1304938175
1305069755
1305595303
1305793482
1305798550
1305859794
1306645694
1306647779
1306780114
1307438043
1307504366
1307744024
1307747648
1307933184
1307948878
1307961558
1307964388
1308015455
1308019589
1308218259
1308422622
1308162296
1308402786
1308425468
1308576652
1308586790
1308588582
1308591910
1308594496
1308595264
1308601687
1308604747
1308622590
1308606290
1308622847
1511594265
1523897290
@@ -553,33 +508,29 @@
1715283479
1715287582
1715749956
1716070683
1715771835
1716276300
1716665907
1716868437
1716933887
1717150383
1717328977
1717523245
1717714303
1717786416
1717789532
1718500679
1718578687
1719302778
1719488291
1720223880
1720473638
1720486784
1720602141
1720994322
1721144710
1721782290
1724152575
1724368575
1724437644
1725290194
1727174424
1724500155
1724896680
1728053247
1931024665
1943327690
@@ -594,7 +545,9 @@
2149720610
2150377008
2150839091
2151067839
2151296832
2151365435
2151493928
2151825986
2151957572
@@ -603,13 +556,12 @@
2152483916
2152615485
2153076053
2153141503
2153536593
2153755845
2153769774
2153921919
2153997148
2154708295
2154786303
2154984050
2155510394
2155695907
@@ -618,19 +570,20 @@
2156431496
2156681254
2156694400
2157291602
2156771456
2157352326
2157739365
2159194530
2159483932
2160246963
2160360191
2161168844
2160707771
2162418130
2162506037
2163123456
2163800312
2164002331
2164214668
2164260606
2164260863
2370396489
2371253590
@@ -648,20 +601,22 @@
2571387972
2571723081
2571847235
2572571903
2572580182
2573200174
2573352319
2574138695
2575126307
2575861896
2576111654
2576722002
2576201856
2576782726
2579790591
2580006591
2580075660
2580534696
2582553856
2583230712
2583432731
2583691006
2583691263
2787649562
2789826889
@@ -678,13 +633,17 @@
3006477107
3006694172
3007595588
3007916315
3008113177
3008779519
3009559935
3010346311
3012069512
3015998207
3016153515
3018761472
3019640347
3019862822
3019870528
3019898879
3226034505
@@ -696,7 +655,6 @@
3427361097
3428218198
3428990335
3430649653
3431500856
3432785840
3435428607
@@ -709,7 +667,7 @@
3645464905
3646322006
3647094143
3649755367
3649819616
3653532415
3657174555
3942645760

View File

@@ -19,7 +19,7 @@ with open('countries-to-generate.json') as f1:
entry = {
"key": c,
"value": {
"profileName": "normal",
"profileName": "poor",
"tileCoordsSubset": list(),
"tilesAreBanned": False
}

View File

@@ -27,7 +27,7 @@
{
"key": "Algeria_Central",
"value": {
"profileName": "extra_small",
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
@@ -9691,6 +9691,262 @@
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Angola",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Australia_Northern Territory",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Australia_Queensland",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Australia_Western Australia",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Brazil_Mato Grosso",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Brazil_North Region_East",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Brazil_North Region_West",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Cameroon_Central",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Canada_Nunavut_North",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Canada_Nunavut_South",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "China_Gansu",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "China_Sichuan",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Colombia_East",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Congo-Kinshasa_West",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Indonesia_Central",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Indonesia_West",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Iran_East",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Kenya",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Libya",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Madagascar",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Malaysia",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Mali",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Mongolia",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Mozambique",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Myanmar",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Vietnam",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Nigeria_South",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Russia_Krasnoyarsk Krai_North",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Russia_Sakha Republic",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Tanzania",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Zambia",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
},
{
"key": "Zimbabwe",
"value": {
"profileName": "poor",
"tileCoordsSubset": [],
"tilesAreBanned": false
}
}
]
}
}

View File

@@ -63,13 +63,13 @@
{
"key": "poor",
"value": {
"alitudesStep": 500,
"alitudesStep": 100,
"gaussianFilterRFactor": 1.0,
"gaussianFilterStDev": 2.0,
"latLonStepFactor": 2,
"latLonStepFactor": 4,
"maxIsolinesLength": 500,
"medianFilterR": 1,
"simplificationZoom": 14
"simplificationZoom": 13
}
},
{

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -24,35 +24,29 @@
10.8 4.5
13.5 5.4
18.0 6.2
5.0 1.5
6.0 1.8
8.0 2.3
10.0 2.7
6.0 9.0
8.0 10.0
10.0 11.0
15.0 15.0
20.0 20.0
4.0 1.0
6.0 1.3
8.0 1.5
9.0 1.8
11.0 2.3
13.0 2.7
5.0 2.0
6.0 2.5
8.0 3.0
10.0 3.5
5.0 3.0
6.0 4.2
8.0 5.5
10.0 6.7
2.0 1.0
3.6 1.6
5.0 2.2
5.4 2.7
7.0 3.0
16.2 8.1
5.0 5.0
4.0 4.0
3.5 2.0
4.0 2.5
6.0 3.5
8.0 4.5
7.0 9.6
3.5 2.7
7.5 9.5
4.0 3.2
8.0 9.4
8.5 9.3
6.0 4.7
9.0 9.2
8.0 6.2
1.0 2.0
1.8 2.5
@@ -65,8 +59,6 @@
2.5 2.2
3.2 2.8
4.0 3.5
6.0 2.5
7.0 3.0
9.0 3.5
12.0 3.5
4.0 2.0 2.0 1.5
@@ -86,16 +78,12 @@
10.0 10.0
13.0 13.0
16.0 16.0
5.4 2.7
2.7 2.7
4.95 4.95
6.0 1.0
7.0 1.2
9.0 1.7
12.0 2.2
2.0 6.0
3.0 7.0
4.0 8.0
3.5 2.5
4.0 3.0
6.0 4.5
@@ -114,7 +102,6 @@
2.5 7.0
5.2 5.2
3.5 3.5
5.0 2.0
10.1 10.1
0.8 12.0
1.15 14.0

View File

@@ -50,7 +50,6 @@
/*3.2 Vegetation*/
@forest: #141C00;
@heath: #0F1400;
@green0: #0F1400;
@green1: #131900;
@green1b: #141C00;
@@ -102,8 +101,6 @@
/* 5.ROADS */
/* 5.1 All roads */
@motorway0: #3B2015;
@motorway1: #3B2015;
@trunk0: #49291B;
@trunk1: #49291B;
@primary0: #593323;
@@ -129,8 +126,6 @@
/* 5.3 Tunnels */
@motorway_tunnel: #24140D;
@motorway_tunnel_casing: #000000;
@trunk_tunnel: #381F14;
@trunk_tunnel_casing: #000000;
@primary_tunnel: #4C2A1B;

View File

@@ -91,11 +91,11 @@ line|z10-[boundary=administrative][admin_level=4]
area|z10-[landuse=forest],
area|z10-[leisure=park],
area|z12-[natural=heath],
area|z12-[leisure=garden],
area|z12-[landuse=grass],
area|z12-[natural=grassland],
area|z12-[leisure=golf_course],
area|z12-[natural=heath],
area|z12-[landuse=allotments],
area|z12-[natural=bare_rock],
area|z12-[natural=shingle],
@@ -131,6 +131,7 @@ area|z16-[landuse=grass],
area|z14-15[natural=grassland],
area|z14-[leisure=golf_course],
area|z14-[leisure=miniature_golf],
area|z14-[natural=heath],
area|z14-[landuse=allotments],
area|z14-[landuse=orchard],
area|z14-[landuse=plant_nursery],
@@ -140,11 +141,10 @@ area|z14-[landuse=recreation_ground],
area|z14-[landuse=village_green],
area|z14-[landuse=field],
{fill-color: @green1;}
area|z11[landuse=forest],
area|z16-[natural=grassland],
area|z16-[landuse=meadow],
{fill-color: @green1b;}
area|z12[landuse=forest],
area|z11-12[landuse=forest],
area|z12[leisure=garden],
{fill-color: @green2;}
area|z13[landuse=forest],
@@ -167,11 +167,10 @@ area|z16-[leisure=garden][garden:type=residential],
area|z17-[leisure=garden][garden:type=residential],
{fill-color: @green2;}
area|z12-[natural=heath],
{fill-color: @heath;}
area|z12-13[landuse=grass],
area|z12-13[natural=grassland],
area|z12-13[leisure=golf_course],
area|z12-13[natural=heath],
area|z12-13[landuse=allotments],
area|z12-13[landuse=orchard],
area|z12-13[landuse=plant_nursery],
@@ -549,11 +548,11 @@ line|z19-[man_made=cutline],
area|z14[building],
area|z14[waterway=dam],
{fill-color: @building0;fill-opacity: 0.6;}
{fill-color: @building0;fill-opacity: 0.5;}
area|z15[building],
area|z15[waterway=dam],
{fill-color: @building0;fill-opacity: 0.7;}
{fill-color: @building0;fill-opacity: 0.6;}
area|z14-15[aeroway=terminal],
area|z16[building],
@@ -606,13 +605,13 @@ line|z19-[barrier=hedge],
line|z14-[barrier=city_wall],
line|z14-[historic=citywalls],
{color: @building_border1; width: 2; opacity: 0.9;}
{color: @building1; width: 2; opacity: 0.7;}
line|z15[barrier=city_wall],
line|z15[historic=citywalls],
{width: 2.8;}
line|z16-[barrier=city_wall],
line|z16-[historic=citywalls],
{width: 4.5; dashes: 3,3,1.5,3;}
{color: @building0; width: 4.5; dashes: 3,3,1.5,3;}
line|z17[barrier=city_wall],
line|z17[historic=citywalls],
{width: 5.9; dashes: 4,4,1.9,4;}
@@ -657,7 +656,7 @@ line|z18-[barrier=retaining_wall],
line|z16-[man_made=embankment],
{color: @building_border0; width: 3.5; dashes: 4,2,2,1.5; opacity: 0.7;}
{color: @building1; width: 3.5; dashes: 4,2,2,1.5; opacity: 0.7;}
line|z17[man_made=embankment],
{width: 5; dashes: 6,3,3,2;}
line|z18-[man_made=embankment],

View File

@@ -53,7 +53,7 @@
line|z6-9[highway=world_towns_level],
line|z4-9[highway=world_level],
{color: @motorway1;opacity: 1;}
{color: @trunk1;opacity: 1;}
line|z4[highway=world_level]
{width: 0.5;}
@@ -73,23 +73,20 @@ line|z9[highway=world_level]
/* 3.TRUNK & MOTORWAY 6-22 ZOOM */
line|z6[highway=motorway],
{color: @motorway0; opacity: 1;}
line|z6[highway=trunk],
{color: @trunk0; opacity: 0.6;}
line|z7-13[highway=motorway],
{color: @motorway0; opacity: 1;}
line|z6[highway=motorway],
{color: @trunk0; opacity: 0.3;}
line|z7-9[highway=trunk],
{color: @trunk0; opacity: 0.8;}
line|z10-13[highway=trunk],
{color: @trunk1; opacity: 1;}
line|z14-[highway=motorway],
{color: @motorway1;}
line|z14-[highway=trunk],
{color: @trunk1; opacity: 0.9;}
line|z7-9[highway=motorway],
{color: @trunk0; opacity: 0.7;}
line|z10-[highway=trunk],
line|z10-[highway=motorway],
{color: @trunk1; opacity: 0.7;}
line|z10-[highway=motorway_link],
line|z10-[highway=trunk_link],
{color: @primary0; opacity: 0.7;}
line|z13-14[highway=trunk],
line|z13-14[highway=motorway],
line|z14-15[highway=motorway_link],
line|z14-15[highway=trunk_link],
@@ -113,112 +110,85 @@ line|z14-[highway=trunk_link][bridge?]::bridgeblack,
/* 3.1 Trunk & Motorway 6-22 ZOOM */
line|z6[highway=motorway],
{width: 1.7;}
line|z7[highway=motorway]
{width: 1.8;}
line|z8[highway=motorway]
{width: 1.9;}
line|z9[highway=motorway]
{width: 2.0;}
line|z10[highway=motorway]
{width: 2.2;}
line|z11[highway=motorway]
{width: 2.4;}
line|z12[highway=motorway]
{width: 2.7;}
line|z13[highway=motorway],
{width: 3.6;}
line|z14[highway=motorway],
{width: 4.4;}
line|z15[highway=motorway],
{width: 5.6;}
line|z16[highway=motorway],
{width: 7.8;}
line|z17[highway=motorway],
{width: 9.0;}
line|z18[highway=motorway],
{width: 12.0;}
line|z19-[highway=motorway],
{width: 16.0;}
line|z6[highway=trunk],
line|z6[highway=motorway],
{width: 0.8;}
line|z7[highway=trunk],
line|z7[highway=motorway]
{width: 0.9;}
line|z8[highway=trunk],
{width: 1.2;}
line|z8[highway=motorway]
{width: 1.1;}
line|z9[highway=trunk],
{width: 1.3;}
line|z9[highway=motorway]
{width: 1.2;}
line|z10[highway=trunk],
{width: 1.9;}
line|z10[highway=motorway]
{width: 1.5;}
line|z11[highway=trunk],
{width: 2.1;}
line|z11[highway=motorway]
{width: 1.7;}
line|z12[highway=trunk],
{width: 2.4;}
line|z12[highway=motorway]
{width: 1.9;}
line|z13[highway=trunk],
{width: 3.2;}
line|z13[highway=motorway],
{width: 2.8;}
line|z14[highway=trunk],
{width: 4.0;}
line|z14[highway=motorway],
{width: 3.8;}
line|z15[highway=trunk],
{width: 4.8;}
line|z15[highway=motorway],
{width: 4.4;}
line|z16[highway=trunk],
{width: 6.2;}
line|z16[highway=motorway],
{width: 6;}
line|z17[highway=trunk],
line|z17[highway=motorway],
{width: 8.2;}
line|z18[highway=trunk],
line|z18[highway=motorway],
{width: 11;}
line|z19-[highway=trunk],
line|z19-[highway=motorway],
{width: 13.5;}
line|z10[highway=motorway_link],
{width: 0.9;}
line|z11[highway=motorway_link],
{width: 1.1;}
line|z12[highway=motorway_link],
{width: 1.4;}
line|z13[highway=motorway_link],
{width: 1.9;}
line|z14[highway=motorway_link],
{width: 2.7;}
line|z15[highway=motorway_link],
{width: 3.7;}
line|z16[highway=motorway_link],
{width: 5.1;}
line|z17[highway=motorway_link],
{width: 6.7;}
line|z18[highway=motorway_link],
{width: 9.5;}
line|z19-[highway=motorway_link],
{width: 11.7;}
line|z10[highway=trunk_link]
{width: 0.8;}
line|z11[highway=motorway_link],
line|z11[highway=trunk_link]
{width: 1.0;}
line|z12[highway=motorway_link],
line|z12[highway=trunk_link]
{width: 1.3;}
line|z13[highway=motorway_link],
line|z13[highway=trunk_link]
{width: 1.8;}
line|z14[highway=motorway_link],
line|z14[highway=trunk_link]
{width: 2.6;}
line|z15[highway=motorway_link],
line|z15[highway=trunk_link]
{width: 3.6;}
line|z16[highway=motorway_link],
line|z16[highway=trunk_link]
{width: 5;}
line|z17[highway=motorway_link],
line|z17[highway=trunk_link]
{width: 6.6;}
line|z18[highway=motorway_link],
line|z18[highway=trunk_link]
{width: 9.4;}
line|z19-[highway=motorway_link],
line|z19-[highway=trunk_link]
{width: 11.6;}
/* 3.2 Trunk & Motorway tunnel 12-22 ZOOM */
line|z12-[highway=motorway][tunnel?],
line|z13-[highway=motorway_link][tunnel?],
{color: @motorway_tunnel; casing-linecap: butt; casing-color: @motorway_tunnel_casing; casing-opacity: 0.7;}
line|z12-[highway=trunk][tunnel?],
line|z13-[highway=motorway_link][tunnel?],
line|z13-[highway=trunk_link][tunnel?],
{color: @trunk_tunnel; casing-linecap: butt; casing-color: @trunk_tunnel_casing; casing-opacity: 0.7;}
@@ -276,12 +246,16 @@ line|z18-[highway=trunk_link][bridge?]::bridgeblack
/* 4.PRIMARY 8-22 ZOOM */
line|z8-10[highway=primary],
{color: @primary0; opacity: 0.8;}
line|z11-13[highway=primary],
line|z11-13[highway=primary_link]
{color: @primary1; opacity: 1;}
line|z14-[highway=primary],
line|z14-[highway=primary_link],
{color: @primary0; opacity: 0.7;}
line|z11-12[highway=primary],
line|z11-12[highway=primary_link]
{color: @primary1; opacity: 0.7;}
line|z13-14[highway=primary],
line|z13-14[highway=primary_link],
{color: @primary1; opacity: 0.85;}
line|z15-[highway=primary],
line|z15-[highway=primary_link],
{color: @primary2; opacity: 1;}
line|z14-[highway=primary][bridge?]::bridgewhite,
@@ -298,26 +272,25 @@ line|z8[highway=primary],
line|z9[highway=primary],
{width: 0.8;}
line|z10[highway=primary],
{width: 1.6;}
{width: 1.2;}
line|z11[highway=primary],
{width: 2.0;}
{width: 1.5;}
line|z12[highway=primary],
{width: 2.2;}
{width: 1.7;}
line|z13[highway=primary],
{width: 2.6;}
{width: 2.3;}
line|z14[highway=primary],
{width: 3.8;}
{width: 3.2;}
line|z15[highway=primary],
{width: 4.4;}
{width: 3.8;}
line|z16[highway=primary],
{width: 5.4;}
{width: 5;}
line|z17[highway=primary],
{width: 7;}
{width: 6.6;}
line|z18[highway=primary],
{width: 10;}
{width: 9.4;}
line|z19-[highway=primary],
{width: 12;}
{width: 11.6;}
line|z11[highway=primary_link],
{width: 0.8;}
@@ -375,10 +348,13 @@ line|z18-[highway=primary_link][bridge?]::bridgeblack,
/* 5.SECONDARY 10-22 ZOOM */
line|z10-13[highway=secondary],
{color: @secondary0; opacity: 1;}
line|z14-[highway=secondary],
line|z14-[highway=secondary_link],
line|z10-12[highway=secondary],
{color: @secondary0; opacity: 0.8;}
line|z13-14[highway=secondary],
line|z13-14[highway=secondary_link],
{color: @secondary1; opacity: 0.9;}
line|z15-[highway=secondary],
line|z15-[highway=secondary_link],
{color: @secondary1; opacity: 1;}
line|z14-[highway=secondary][bridge?]::bridgewhite,
@@ -391,13 +367,13 @@ line|z14-[highway=secondary_link][bridge?]::bridgeblack,
/* 5.1 Secondary 10-22 ZOOM */
line|z10[highway=secondary],
{width: 1.4;}
{width: 1.2;}
line|z11[highway=secondary],
{width: 1.8;}
{width: 1.5;}
line|z12[highway=secondary],
{width: 2.0;}
{width: 1.7;}
line|z13[highway=secondary],
{width: 2.4;}
{width: 2.3;}
line|z14[highway=secondary],
{width: 3.2;}
line|z15[highway=secondary],
@@ -456,28 +432,18 @@ line|z18-[highway=secondary_link][bridge?]::bridgeblack
/* 6.TERTIARY & UNCLASSIFIED 11-22 ZOOM */
line|z11-[highway=tertiary]
{color: @tertiary; opacity: 1;}
line|z12-13[highway=tertiary],
{opacity: 0.95;}
line|z11-[highway=tertiary],
line|z11-[highway=unclassified],
line|z14-[highway=tertiary_link],
{color: @tertiary;}
line|z11-[highway=unclassified]
{color: @tertiary; opacity: 0.95;}
line|z12[highway=unclassified]
{opacity: 0.8;}
line|z13[highway=unclassified]
{opacity: 0.58;}
{color: @tertiary; opacity: 0.7;}
line|z14-15[highway=tertiary],
line|z14-15[highway=unclassified],
line|z15-16[highway=tertiary_link],
{color: @tertiary; opacity: 0.9;}
line|z13-15[highway=unclassified]
{opacity: 0.8;}
{opacity: 0.85;}
line|z16-[highway=tertiary],
line|z16-[highway=unclassified],
line|z17-[highway=tertiary_link],
{opacity: 1;}
line|z16-[highway=unclassified],
{opacity: 0.9;}
line|z14-[highway=tertiary][bridge?]::bridgewhite,
line|z14-[highway=tertiary_link][bridge?]::bridgewhite
@@ -491,22 +457,31 @@ line|z14-[highway=unclassified][bridge?]::bridgeblack,
/* 6.1 Tertiary & Unclassified 11-22 ZOOM */
line|z11[highway=tertiary],
{width: 1.2;}
line|z11[highway=unclassified],
{width: 0.8;}
line|z12[highway=tertiary],
{width: 1.6;}
line|z12[highway=unclassified],
{width: 1.3;}
line|z13[highway=tertiary],
line|z13[highway=unclassified],
{width: 1.8;}
line|z14[highway=tertiary],
line|z14[highway=unclassified],
{width: 2.7;}
line|z15[highway=tertiary],
line|z15[highway=unclassified],
{width: 3.8;}
line|z16[highway=tertiary],
line|z16[highway=unclassified],
{width: 5;}
line|z17[highway=tertiary],
line|z17[highway=unclassified],
{width: 6.6;}
line|z18[highway=tertiary],
line|z18[highway=unclassified],
{width: 9.4;}
line|z19-[highway=tertiary],
line|z19-[highway=unclassified],
{width: 11.6;}
line|z14[highway=tertiary_link],
@@ -522,25 +497,6 @@ line|z18[highway=tertiary_link],
line|z19-[highway=tertiary_link],
{width: 8.2;}
line|z11[highway=unclassified],
{width: 0.6;}
line|z12[highway=unclassified],
{width: 1.0;}
line|z13[highway=unclassified],
{width: 1.4;}
line|z14[highway=unclassified],
{width: 2.3;}
line|z15[highway=unclassified],
{width: 3.2;}
line|z16[highway=unclassified],
{width: 4.2;}
line|z17[highway=unclassified],
{width: 6;}
line|z18[highway=unclassified],
{width: 8;}
line|z19-[highway=unclassified],
{width: 10;}
/* 6.2 Tertiary & Unclassified tunnel 16-22 ZOOM */
line|z16-[highway=tertiary][tunnel?],
@@ -581,10 +537,10 @@ line|z18-[highway=unclassified][bridge?]::bridgeblack,
line|z12-[highway=residential],
line|z12-[highway=road],
line|z12-[highway=living_street],
{color: @residential; opacity: 0.8;}
line|z13-16[highway=residential],
line|z13-16[highway=road],
line|z13-16[highway=living_street],
{color: @residential; opacity: 0.7;}
line|z14-16[highway=residential],
line|z14-16[highway=road],
line|z14-16[highway=living_street],
{opacity: 0.85;}
line|z17-[highway=residential],
line|z17-[highway=road],
@@ -658,7 +614,7 @@ line|z18-[highway=residential][bridge?]::bridgeblack,
line|z15-[highway=service],
line|z15-[highway=service][service=busway],
line|z15-[highway=busway],
{color: @residential; opacity: 0.9;}
{color: @residential; opacity: 0.8;}
line|z15[highway=service],
line|z15[highway=service][service=busway],
@@ -687,25 +643,11 @@ line|z19-[highway=busway],
line|z13-[highway=pedestrian],
line|z13-[highway=ford]
{color: @pedestrian;opacity: 0.9;}
{color: @pedestrian;opacity: 0.85;}
line|z13-[highway=cycleway],
line|z14-[highway=path][bicycle=designated]::cycleline,
line|z15-[highway=footway][bicycle=designated]::cycleline,
{color: @cycleway;}
line|z14-[highway=path][bicycle=designated]::cycleline,
{dashes: 7,9.6;}
line|z16[highway=path][bicycle=designated]::cycleline,
{dashes: 7.5,9.5;}
line|z17[highway=path][bicycle=designated]::cycleline,
{dashes: 8,9.4;}
line|z18[highway=path][bicycle=designated]::cycleline,
{dashes: 8.5,9.3;}
line|z19-[highway=path][bicycle=designated]::cycleline,
{dashes: 9,9.2;}
line|z13-[highway=construction],
{color: @construction;opacity: 0.7;}
line|z13-[highway=pedestrian][bridge?]::bridgewhite,
@@ -737,9 +679,9 @@ line|z15-[leisure=track][!area],
line|z14-[highway=bridleway]
{color: @bridleway;opacity: 0.6;}
line|z15-[highway=footway],
{color: @footway;opacity: 0.87;}
{color: @footway;opacity: 0.75;}
line|z15-[highway=steps],
{color: @footway;opacity: 0.9;}
{color: @footway;opacity: 0.85;}
line|z14-[highway=path],
{color: @path;opacity: 0.6;}
line|z14-[highway=path][_path_grade=expert],
@@ -769,25 +711,25 @@ line|z17-[highway=steps][tunnel?]::tunnelCasing,
line|z13[highway=pedestrian],
line|z13[highway=ford]
{width: 1;dashes: 4,1;}
{width: 1;dashes: 2,1;}
line|z14[highway=pedestrian],
line|z14[highway=ford]
{width: 1.6;dashes: 6,1.3;}
{width: 1.6;dashes: 3.6,1.6;}
line|z15[highway=pedestrian],
line|z15[highway=ford]
{width: 2;dashes: 8,1.5;}
{width: 2;dashes: 5,2.2;}
line|z16[highway=pedestrian],
line|z16[highway=ford]
{width: 2.4;dashes: 8,1.5;}
{width: 2.4;dashes: 5.4,2.7;}
line|z17[highway=pedestrian],
line|z17[highway=ford]
{width: 3;dashes: 9,1.8;}
{width: 3;dashes: 5,2;}
line|z18[highway=pedestrian],
line|z18[highway=ford]
{width: 4;dashes: 11,2.3;opacity: 1;}
{width: 4;dashes: 7,3;opacity: 1;}
line|z19-[highway=pedestrian],
line|z19-[highway=ford]
{width: 5;dashes: 13,2.7;opacity: 1;}
{width: 5;dashes: 16.2,8.1;opacity: 1;}
/* 8.2 Pedestrian & ford tunnel 16-22 ZOOM */
@@ -815,54 +757,50 @@ line|z16-[highway=pedestrian][bridge?]::bridgeblack,
/* 8.4 Cycleway 13-22 ZOOM */
line|z13[highway=cycleway],
{opacity: 0.5;}
{opacity: 0.3;}
line|z14[highway=cycleway],
line|z14[highway=path][bicycle=designated]::cycleline,
{opacity: 0.6;}
{opacity: 0.4;}
line|z15[highway=cycleway],
line|z15[highway=path][bicycle=designated]::cycleline,
{opacity: 0.8;}
{opacity: 0.5;}
line|z16-17[highway=cycleway],
line|z16-17[highway=path][bicycle=designated]::cycleline,
{opacity: 0.9;}
{opacity: 0.6;}
line|z18-[highway=cycleway],
line|z18-[highway=path][bicycle=designated]::cycleline,
{opacity: 1;}
{opacity: 0.8;}
line|z15-[highway=footway][bicycle=designated]::cycleline,
{opacity: 1;}
line|z15-16[highway=footway][bicycle=designated]::cycleline,
{opacity: 0.4;}
line|z17-[highway=footway][bicycle=designated]::cycleline,
{opacity: 0.5;}
line|z13[highway=cycleway]
{width: 1.0;}
{width: 0.9;}
line|z14[highway=cycleway],
line|z14[highway=path][bicycle=designated]::cycleline,
{width: 1.2;}
line|z15[highway=cycleway],
line|z15[highway=path][bicycle=designated]::cycleline,
{width: 1.5;}
line|z16[highway=cycleway],
line|z16[highway=path][bicycle=designated]::cycleline,
{width: 2;}
line|z17[highway=cycleway],
line|z17[highway=path][bicycle=designated]::cycleline,
{width: 2.4;}
line|z18[highway=cycleway],
line|z18[highway=path][bicycle=designated]::cycleline,
{width: 3.2;}
line|z19-[highway=cycleway],
line|z19-[highway=path][bicycle=designated]::cycleline,
{width: 4.2;}
line|z15[highway=footway][bicycle=designated]::cycleline,
{width: 0.7;}
line|z16[highway=footway][bicycle=designated]::cycleline,
{width: 0.8;}
line|z17[highway=footway][bicycle=designated]::cycleline,
{width: 1.1;}
line|z18[highway=footway][bicycle=designated]::cycleline,
line|z15[highway=cycleway]
line|z15[highway=footway][bicycle=designated]::cycleline,
line|z15[highway=path][bicycle=designated]::cycleline,
{width: 1.2;}
line|z16[highway=cycleway],
line|z16[highway=footway][bicycle=designated]::cycleline,
line|z16[highway=path][bicycle=designated]::cycleline,
{width: 1.3;}
line|z17[highway=cycleway],
line|z17[highway=footway][bicycle=designated]::cycleline,
line|z17[highway=path][bicycle=designated]::cycleline,
{width: 1.4;}
line|z18[highway=cycleway],
line|z18[highway=footway][bicycle=designated]::cycleline,
line|z18[highway=path][bicycle=designated]::cycleline,
{width: 1.6;}
line|z19-[highway=cycleway],
line|z19-[highway=footway][bicycle=designated]::cycleline,
{width: 2.0;}
line|z19-[highway=path][bicycle=designated]::cycleline,
{width: 1.8;}
line|z17[highway=cycleway][tunnel?]::tunnelBackground
{casing-width-add: 1;}
@@ -1015,26 +953,26 @@ line|z17-[highway=track][bridge?]::bridgeblack
/* 8.7 Footway 15-22 ZOOM */
line|z15[highway=footway]
{width: 1.5; dashes: 5,1.5;}
{width: 1.5; dashes: 5,2;}
line|z16[highway=footway]
{width: 2; dashes: 5,1.5;}
{width: 2; dashes: 5,2;}
line|z17[highway=footway]
{width: 2.4; dashes: 6,1.8;}
{width: 2.4; dashes: 6,2.5;}
line|z18[highway=footway]
{width: 3.2; dashes: 8,2.3; opacity: 1;}
{width: 3.2; dashes: 8,3; opacity: 1;}
line|z19-[highway=footway],
{width: 4.2; dashes: 10,2.7;opacity: 1;}
{width: 4.2; dashes: 10,3.5; opacity: 1;}
line|z15[highway=footway][bicycle=designated],
{width: 1.5; dashes: 6,9; opacity: 0.8;}
{width: 1.5; dashes: 5,3;}
line|z16[highway=footway][bicycle=designated],
{width: 2; dashes: 8,10; opacity: 0.9;}
{width: 2; dashes: 5,3;}
line|z17[highway=footway][bicycle=designated],
{width: 2.4; dashes: 10,11; opacity: 1;}
{width: 2.4; dashes: 6,4.2; opacity: 0.9;}
line|z18[highway=footway][bicycle=designated],
{width: 3.2; dashes: 15,15; opacity: 1;}
{width: 3.2; dashes: 8,5.5; opacity: 1;}
line|z19-[highway=footway][bicycle=designated],
{width: 4.2; dashes: 20,20; opacity: 1;}
{width: 4.2; dashes: 10,6.7; opacity: 1;}
/* Don't display sidewalks and pedestrian crossings on z15. */
line|z15[highway=footway][footway=sidewalk],

View File

@@ -45,6 +45,10 @@ power-line # line z19- (also has line::
power-line::dash # line::dash z19- (also has line z19-)
=== 340
highway-cycleway # line z13- (also has pathtext z15-)
highway-cycleway-bridge # line z13- (also has line::bridgeblack z17-, line::bridgewhite z15-, pathtext z15-)
highway-cycleway-tunnel # line z13- (also has line::tunnelBackground z17-, line::tunnelCasing z17-, pathtext z15-)
highway-footway-crossing # line z16-
highway-steps # line z15- (also has pathtext z16-)
highway-steps-bridge # line z15- (also has line::bridgeblack z17-, line::bridgewhite z15-, pathtext z16-)
highway-steps-tunnel # line z15- (also has line::tunnelBackground z17-, line::tunnelCasing z17-, pathtext z16-)
@@ -188,23 +192,16 @@ highway-secondary_link-tunnel # line z13- (also has line(c
=== 224
# highway-secondary_link-tunnel # line(casing) z16- (also has line z13-, pathtext z16-)
# === 223
highway-tertiary_link # line z14- (also has pathtext z18-)
highway-tertiary_link-bridge # line z14- (also has line::bridgeblack z14-, line::bridgewhite z14-, pathtext z18-)
highway-tertiary_link-tunnel # line z14- (also has line(casing) z16-, pathtext z18-)
=== 223
highway-busway # line z15- (also has pathtext z16-)
highway-busway-bridge # line z15- (also has pathtext z16-)
highway-busway-tunnel # line z15- (also has pathtext z16-)
highway-service # line z15- (also has pathtext z16-)
highway-service-area # line z15- (also has pathtext z16-)
highway-service-bridge # line z15- (also has line::bridgeblack z16-, line::bridgewhite z16-, pathtext z16-)
highway-service-driveway # line z16- (also has pathtext z16-)
highway-service-parking_aisle # line z15- (also has pathtext z16-)
highway-service-tunnel # line z15- (also has pathtext z16-)
# highway-tertiary_link-tunnel # line(casing) z16- (also has line z14-, pathtext z18-)
=== 222
# highway-tertiary_link-tunnel # line(casing) z16- (also has line z14-, pathtext z18-)
# === 221
railway-light_rail::dash # line::dash z16- (also has line z13-)
railway-light_rail-bridge::dash # line::dash z16- (also has line z13-, line::bridgeblack z16-, line::bridgewhite z13-)
railway-rail::dash # line::dash z16- (also has line z11-)
@@ -221,19 +218,8 @@ railway-rail-utility-bridge::dash # line::dash z17- (also has
railway-rail-utility-tunnel::dash # line::dash z17- (also has line z13-, line(casing) z14-)
railway-subway::dash # line::dash z16- (also has line z13-)
railway-subway-bridge::dash # line::dash z16- (also has line z13-, line::bridgeblack z16-, line::bridgewhite z13-)
=== 221
highway-footway-bicycle # line z15- (also has line::cycleline z15-, pathtext z15-)
=== 220
highway-footway-bicycle::cycleline # line::cycleline z15- (also has line z15-, pathtext z15-)
=== 219
highway-cycleway # line z13- (also has pathtext z15-)
highway-cycleway-bridge # line z13- (also has line::bridgeblack z17-, line::bridgewhite z15-, pathtext z15-)
highway-cycleway-tunnel # line z13- (also has line::tunnelBackground z17-, line::tunnelCasing z17-, pathtext z15-)
=== 218
railway-light_rail # line z13- (also has line::dash z16-)
railway-light_rail-bridge # line z13- (also has line::bridgeblack z16-, line::bridgewhite z13-, line::dash z16-)
railway-rail # line z11- (also has line::dash z16-)
@@ -268,7 +254,15 @@ highway-pedestrian-tunnel # line z13- (also has line(c
# highway-pedestrian-tunnel # line(casing) z16- (also has line z13-, pathtext z14-)
# === 199
highway-path-bicycle::cycleline # line::cycleline z14- (also has line z14-, pathtext z15-)
highway-busway # line z15- (also has pathtext z16-)
highway-busway-bridge # line z15- (also has pathtext z16-)
highway-busway-tunnel # line z15- (also has pathtext z16-)
highway-service # line z15- (also has pathtext z16-)
highway-service-area # line z15- (also has pathtext z16-)
highway-service-bridge # line z15- (also has line::bridgeblack z16-, line::bridgewhite z16-, pathtext z16-)
highway-service-driveway # line z16- (also has pathtext z16-)
highway-service-parking_aisle # line z15- (also has pathtext z16-)
highway-service-tunnel # line z15- (also has pathtext z16-)
=== 190
highway-bridleway # line z14- (also has pathtext z15-)
@@ -276,7 +270,7 @@ highway-bridleway-bridge # line z14- (also has line::
highway-bridleway-tunnel # line z14- (also has line::tunnelBackground z17-, line::tunnelCasing z17-, pathtext z15-)
highway-footway # line z15- (also has pathtext z15-)
highway-footway-area # line z15- and area z14- (also has pathtext z15-)
highway-footway-crossing # line z16-
highway-footway-bicycle # line z15- (also has line::cycleline z15-, pathtext z15-)
highway-path # line z14- (also has pathtext z15-)
highway-path-bicycle # line z14- (also has line::cycleline z14-, pathtext z15-)
highway-path-difficult # line z14- (also has pathtext z15-)
@@ -289,6 +283,10 @@ highway-track-no-access # line z14- (also has pathte
highway-track-tunnel # line z14- (also has line::tunnelBackground z17-, line::tunnelCasing z17-, pathtext z15-)
=== 180
highway-footway-bicycle::cycleline # line::cycleline z15- (also has line z15-, pathtext z15-)
highway-path-bicycle::cycleline # line::cycleline z14- (also has line z14-, pathtext z15-)
=== 170
highway-construction # line z13- (also has pathtext z15-)
leisure-track # line z15- (also has caption z16-)
railway-abandoned # line z16-

View File

@@ -668,9 +668,6 @@ highway-residential-bridge::shield # shield::shield z15- (also
highway-residential-tunnel::shield # shield::shield z15- (also has pathtext z13-, line z12-, line(casing) z16-)
=== 2955
highway-footway-bicycle # pathtext z15- (also has line z15-, line::cycleline z15-)
=== 2954
highway-cycleway # pathtext z15- (also has line z13-)
highway-cycleway-bridge # pathtext z15- (also has line z13-, line::bridgeblack z17-, line::bridgewhite z15-)
highway-cycleway-tunnel # pathtext z15- (also has line z13-, line::tunnelBackground z17-, line::tunnelCasing z17-)
@@ -679,6 +676,7 @@ highway-cycleway-tunnel # pathtext z15- (also has li
area:highway-footway # caption z15- (also has area z14-)
highway-footway # pathtext z15- (also has line z15-)
highway-footway-area # pathtext z15- (also has line z15-, area z14-)
highway-footway-bicycle # pathtext z15- (also has line z15-, line::cycleline z15-)
highway-footway-bridge # pathtext z15- (also has line z15-, line::bridgeblack z17-, line::bridgewhite z15-)
highway-footway-tunnel # pathtext z15- (also has line z15-, line::tunnelBackground z17-, line::tunnelCasing z17-)
highway-tertiary_link # pathtext z18- (also has line z14-)

View File

@@ -3,16 +3,16 @@
1.BASEMAP
2.BOUNDARY
3.NATURAL
3.1 Main natural
3.2 Vegetation
3.1 Main natural
3.2 Vegetation
4.LANDUSE
4.1 Main landuse
4.2 Aerodrome
4.1 Main landuse
4.2 Aerodrome
4.3 Barriers
4.4 Buildings
5.ROADS
5.1 All roads
5.2 Bridges
5.2 Bridges
5.3 Tunnels
5.4 Piste
5.5 Transport
@@ -26,7 +26,7 @@
/* 1.BASEMAP */
@background: #F5E8D6;
@background: #E3E1D2;
/* 2.BOUNDARY */
@@ -38,108 +38,103 @@
/* 3.1 Main natural */
@glacier: #FFFFFF;
@water: #8AD8E7;
@water_bad: #95C5B8;
@river: #5FB4C5;
@wetland: #C3E0D1;
@beach: #FFE7B7;
@water: #8BD3E0;
@water_bad: #9dc7c1;
@river: #36B0BF;
@wetland: #c9ddd6;
@beach: #FCEC7E;
@barerock: #D9D2BF;
@scree: #CCC7BA;
@desert: #F6E5CE;
@desert: #EEE5B2;
/*3.2 Vegetation*/
@heath: #CED797;
@green0: #C8D48C;
@green1: #C4D181;
@green1b: #BECC76;
@green2: #B6C96B;
@green3: #B0C763;
@green4: #B2C76A;
@green5: #ADC45F;
@forest: #A8BE5C;
@green6: #7B8F35;
@flowers: #B6C96B;
@green0: #CFD5A8;
@green1: #C6CF93;
@green1b: #C1CC89;
@green2: #BCC87E;
@green3: #B3C471;
@green4: #AEC26B;
@green5: #B0C270;
@forest: #AABF65;
@green6: #888C38;
@flowers: #B3C471;
/* 4.LANDUSE */
/*4.1 Main landuse*/
@pedestrian_area: #F6EBDC;
@pedestrian_area_light: #F7EDDF;
@university: #F8E3C2;
@hospital: #FFDAD6;
@industrial: #E8E6E1;
@sport0: #F5EED3;
@sport1: #E8E8C3;
@sport2: #D4E796;
@parking: #F6F0E9;
@pedestrian_area: #EDE8D6;
@pedestrian_area_light: #F2EEDA;
@university: #F8E4BA;
@hospital: #F8D9D9;
@industrial: #E4E2EB;
@sport0: #DDD9B0;
@sport1: #D7D3AC;
@sport2: #D1CDA7;
@parking: #F2F2BC;
@military: #E53935;
@prison: #727272;
@farmland: #E4E0AD;
@farmyard: #E6D6AF;
@farmland: #E4DEAD;
@farmyard: #E5D6AC;
/*4.2 Aerodrome*/
@aerodrome0: #CED4D2;
@aerodrome1: #CED4D2;
@aerodrome2: #CBD1CF;
@aerodrome3: #C6CCCA;
@aerodrome4: #C4C9C8;
@aerodrome5: #C1C7C5;
@aerodrome0: #D4BFF2;
@aerodrome1: #D4BFF2;
@aerodrome2: #D1C0EB;
@aerodrome3: #CFC1E8;
@aerodrome4: #CDC0E3;
@aerodrome5: #C8BCDE;
/* 4.3 Barriers */
@fence: #888888;
@hedge: #95A852;
@hedge: #8DB880;
@cliff: #8C5826;
/* 4.4 Buildings */
@building0: #D5D6D2;
@building1: #D0D1CC;
@building0: #C9C8BB;
@building1: #C2C0B3;
@building_border0: #A1A096;
@building_border1: #9B9A8F;
/* 5.ROADS */
/* 5.1 All roads */
@motorway0: #F57A00;
@motorway1: #F08800;
@trunk0: #F29718;
@trunk1: #F29E30;
@primary0: #F5B74E;
@primary1: #FABB40;
@primary2: #FAC256;
@secondary0: #FFCE5A;
@secondary1: #FFD573;
@trunk0: #FF7326;
@trunk1: #FF7A26;
@primary0: #FF8726;
@primary1: #FF9440;
@primary2: #FFA14C;
@secondary0: #FFB226;
@secondary1: #FFBF52;
@tertiary: #FFFFFF;
@residential: #FFFEFE;
@pedestrian: #FFFAF5;
@footway: #FFFAF5;
@cycleway: #6F6DFF;
@construction: #C1A06B;
@residential: #F8F8F8;
@pedestrian: #F8F8F8;
@footway: #F8F8F8;
@cycleway: #5654FF;
@construction: #BBBBAA;
@track: #635730;
@path: #8E4E1D;
@path: #A05012;
@path_expert: #3D2617;
@bridleway: #3D361E;
/* 5.2 Bridges */
@bridge_background: #FCF1DE;
@bridge_casing: #E1D4BE;
@bridge_background: #EDEBDB;
@bridge_casing: #808080;
/* 5.3 Tunnels */
@motorway_tunnel: #F2A540;
@motorway_tunnel_casing: #808080;
@trunk_tunnel: #F6BB5F;
@trunk_tunnel: #FCA462;
@trunk_tunnel_casing: #808080;
@primary_tunnel: #F6CB85;
@primary_tunnel: #FCA462;
@primary_tunnel_casing: #808080;
@secondary_tunnel: #F9D393;
@secondary_tunnel: #FFBF52;
@secondary_tunnel_casing: #808080;
@tertiary_tunnel: #FFFFFF;
@tertiary_tunnel_casing: #808080;
@residential_tunnel: #FFFEFE;
@residential_tunnel: #FFFFFF;
@residential_tunnel_casing: #808080;
/* 5.4 Piste */
@@ -154,15 +149,15 @@
/* 5.5 Transport */
@railway_light: #B0B1A4;
@railway: #96968B;
@railway_light: #B2B1A2;
@railway: #969586;
@railway_tourism: #9C7D65;
@railway_dash: #EEEEEE;
@railway_tunnel: #808080;
@aerialway: #444444;
@powerline: #969586;
@tram: #7A7A7A;
@ferry: #59A2AF;
@ferry: #4499Bb;
/* 6.LABELS COLORS */
/* 6.1 Main labels */
@@ -174,7 +169,7 @@
/* 6.2 Natural labels */
@water_label: #278FA2;
@water_label: #4499Bb;
@park_label: #3A7921;
@halo_park_label: #FFFFFF;

View File

@@ -3,7 +3,7 @@
<g fill="none" fill-rule="evenodd">
<g id="bar-m" fill-rule="nonzero">
<circle id="Oval" cx="12" cy="12" r="12" fill="#fff" opacity=".6"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#EC955E"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#BB9342"/>
<path id="🔹-Icon-Color" d="m18 6.9667c0-0.53333-0.43333-0.96667-0.96667-0.96667h-10.067c-0.53333 0-0.96667 0.43333-0.96667 0.96667 0 0.23333 0.086667 0.46667 0.24667 0.64l5.0867 5.7267v3.3333h-2.6667c-0.36667 0-0.66667 0.3-0.66667 0.66667 0 0.36667 0.3 0.66667 0.66667 0.66667h6.6667c0.36667 0 0.66667-0.3 0.66667-0.66667 0-0.36667-0.3-0.66667-0.66667-0.66667h-2.6667v-3.3333l5.0867-5.7267c0.16-0.17333 0.24667-0.40667 0.24667-0.64zm-9.0467 1.7-1.18-1.3333h8.46l-1.1867 1.3333h-6.0933z" fill="#fff"/>
</g>
</g>

Before

Width:  |  Height:  |  Size: 853 B

After

Width:  |  Height:  |  Size: 853 B

View File

@@ -3,7 +3,7 @@
<g fill="none" fill-rule="evenodd">
<g id="cafe-m" fill-rule="nonzero">
<circle id="Oval" cx="12" cy="12" r="12" fill="#fff" opacity=".6"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#EC955E"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#BB9342"/>
<path id="Shape" d="m15.889 7h-8.8889v5.5556c0 1.2278 0.99444 2.2222 2.2222 2.2222h3.3333c1.2278 0 2.2222-0.99444 2.2222-2.2222v-1.6667h1.1111c0.61667 0 1.1111-0.5 1.1111-1.1111v-1.6667c0-0.61667-0.49444-1.1111-1.1111-1.1111zm0 2.7778h-1.1111v-1.6667h1.1111v1.6667zm-8.8889 6.1111h8.8889v1.1111h-8.8889v-1.1111z" fill="#fff"/>
</g>
</g>

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 678 B

View File

@@ -3,7 +3,7 @@
<g fill="none" fill-rule="evenodd">
<g id="fastfood-m" fill-rule="nonzero">
<circle id="Oval" cx="12" cy="12" r="12" fill="#fff" opacity=".6"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#EC955E"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#BB9342"/>
<g id="Group" transform="translate(5 6)" fill="#fff">
<path id="Path" d="m0.959 7.896c0.553-0.203 0.819-0.546 1.393-0.546 0.833 0 0.994 0.7 2.331 0.7 1.365 0 1.463-0.7 2.331-0.7 0.833 0 0.994 0.7 2.331 0.7 1.365 0 1.463-0.7 2.331-0.7 0.567 0 0.819 0.322 1.351 0.532 0.469 0.182 0.973-0.175 0.973-0.672 0-0.301-0.196-0.567-0.483-0.672-0.679-0.245-0.854-0.581-1.855-0.581-1.365 0-1.463 0.7-2.331 0.7-0.833 0-0.994-0.7-2.331-0.7-1.365 0-1.463 0.7-2.331 0.7-0.833 0-0.994-0.7-2.331-0.7-1.085 0-1.372 0.441-1.876 0.623-0.273 0.098-0.455 0.364-0.455 0.658 0 0.483 0.49 0.826 0.952 0.658z"/>
<path id="Path" d="m0 11.2c0 0.77 0.63 1.4 1.4 1.4h11.2c0.77 0 1.4-0.63 1.4-1.4v-0.7c0-0.77-0.63-1.4-1.4-1.4h-11.2c-0.77 0-1.4 0.63-1.4 1.4v0.7z"/>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="12" fill="#fff" opacity=".6"/>
<circle cx="12" cy="12" r="11" fill="#EC955E"/>
<circle cx="12" cy="12" r="11" fill="#bb9342"/>
<path d="m12.049 5.3147c-1.902 0-3.5057 1.3566-3.8631 3.1738-0.93283 0.34526-1.5879 1.2414-1.5879 2.2772 0 1.3386 1.0851 2.4218 2.4238 2.4218 0.60736 0.0071 1.0136-0.18667 1.4042-0.3496 0.50275 0.22412 1.0536 0.3496 1.623 0.3496 0.57544 0 1.1396-0.12704 1.6484-0.36327 0.32914 0.16064 0.82873 0.36216 1.3808 0.36327 1.3386 0 2.4238-1.0831 2.4238-2.4218 0-1.0358-0.65506-1.932-1.5879-2.2772-0.35738-1.8172-1.9631-3.1738-3.8651-3.1738zm1.707 8.7282c-0.52703 0.30792-1.109 0.47264-1.705 0.47264-0.58984 0-1.1609-0.16489-1.6816-0.45702-0.37309 0.19579-0.78848 0.34937-1.3437 0.36522l2.3906 4.7831c0.11234 0.22468 0.33902 0.36522 0.59177 0.36522 0.25276 0 0.47944-0.14054 0.59178-0.36522l2.4257-4.8514c-0.48744-0.03354-0.98887-0.14016-1.2695-0.31249z" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 1014 B

After

Width:  |  Height:  |  Size: 1014 B

View File

@@ -1,5 +1,5 @@
<svg version="1.1" viewBox="0 0 24 24" width="18" height="18" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<circle id="Oval" cx="12" cy="12" r="12" fill="#fff" opacity=".6"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#EC955E"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#BB9342"/>
<path d="m18.289 5.5406c0.20956 0.15523 0.33374 0.40359 0.33374 0.6649v8.6928c0 1.1435-1.1125 2.0697-2.4837 2.0697s-2.4837-0.9262-2.4837-2.0697 1.1125-2.0697 2.4837-2.0697c0.28976 0 0.56917 0.04136 0.82789 0.11901v-3.7669l-6.6231 1.9869v5.3864c0 1.1435-1.1125 2.0697-2.4837 2.0697s-2.4837-0.9262-2.4837-2.0697 1.1125-2.0697 2.4837-2.0697c0.28976 0 0.56917 0.04136 0.82789 0.11901v-5.9142c0-0.36479 0.2406-0.68818 0.58987-0.79426l8.2789-2.4837c0.25095-0.075029 0.5226-0.02848 0.73216 0.12936z" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 767 B

After

Width:  |  Height:  |  Size: 767 B

View File

@@ -3,7 +3,7 @@
<g fill="none" fill-rule="evenodd">
<g id="beer-m" fill-rule="nonzero">
<circle id="Oval" cx="12" cy="12" r="12" fill="#fff" opacity=".6"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#EC955E"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#BB9342"/>
<path id="Shape" d="m16.116 10.413h-0.9863c0.22129-0.37302 0.35406-0.80295 0.35406-1.2645 0-1.3973-1.1317-2.529-2.529-2.529-0.21496 0-0.41728 0.031612-0.6196 0.082192-0.51844-0.42993-1.176-0.70179-1.9094-0.70179-1.1949 0-2.2192 0.70179-2.6997 1.7134-0.99895 0.33509-1.726 1.2708-1.726 2.3836 0 1.176 0.80927 2.156 1.8967 2.4405v5.4626h6.9547v-1.2645h1.2645c0.69547 0 1.2645-0.56902 1.2645-1.2645v-3.7935c0-0.69547-0.56902-1.2645-1.2645-1.2645zm-7.5869 0.94837c-0.69547 0-1.2645-0.56902-1.2645-1.2645 0-0.53741 0.34773-1.0116 0.86617-1.1886l0.5058-0.17071 0.22761-0.48051c0.29715-0.61328 0.89146-0.99262 1.5616-0.99262 0.49947 0 0.87882 0.22129 1.1001 0.41096l0.49315 0.41096s0.40464-0.20232 0.9294-0.20232c0.69547 0 1.2645 0.56902 1.2645 1.2645h-1.8967c-2.0991 0-2.4278 2.2129-3.7871 2.2129zm7.5869 4.1096h-1.2645v-3.7935h1.2645v3.7935z" fill="#fff"/>
</g>
</g>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -3,7 +3,7 @@
<g fill="none" fill-rule="evenodd">
<g id="restaurant-m" fill-rule="nonzero">
<circle id="Oval" cx="12" cy="12" r="12" fill="#fff" opacity=".6"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#EC955E"/>
<circle id="Oval" cx="12" cy="12" r="11" fill="#BB9342"/>
<path id="Shape" d="m10.75 9.55v-2.9478c0-0.33259-0.26509-0.60221-0.59571-0.60221h-0.058575c-0.329 0-0.59571 0.27856-0.59571 0.60221v2.9478h-1.25v-2.9478c0-0.33259-0.26509-0.60221-0.59571-0.60221h-0.058575c-0.329 0-0.59571 0.27856-0.59571 0.60221v2.9478c0 1.378 1.25 2.45 2.4375 2.45l-0.16221 5.1908c-0.013966 0.4469 0.32885 0.80919 0.76779 0.80919h0.16385c0.438 0 0.77819-0.35736 0.75936-0.80919l-0.21628-5.1908c1.25 0 2.75-1.072 2.5-2.45v-2.9478c0-0.33259-0.26509-0.60221-0.59571-0.60221h-0.058575c-0.329 0-0.59571 0.27856-0.59571 0.60221v2.9478h-1.25zm3.25 3.25h1.5v4.455c0 0.41147 0.3329 0.74503 0.75 0.74503 0.41421 0 0.75-0.33347 0.75-0.75065v-11.249c-2.094 0-3.05 1.456-3 2.6v4.2z" fill="#fff"/>
</g>
</g>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 24 24" width="18" height="18" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<circle id="Oval" cx="12" cy="12" r="12" fill="#fff" opacity=".6"/>
<circle cx="12" cy="12" r="11" fill="#EC955E"/>
<circle cx="12" cy="12" r="11" fill="#BB9342"/>
<path d="m2.0024 15.579 2.4463-3.7354-2.2168-3.4229h1.6895l1.4355 2.2998 1.4062-2.2998h1.6748l-2.2266 3.4766 2.4463 3.6816h-1.7432l-1.5869-2.4756-1.5918 2.4756zm6.6699 0 2.4463-3.7354-2.2168-3.4229h1.6895l1.4355 2.2998 1.4062-2.2998h1.6748l-2.2266 3.4766 2.4463 3.6816h-1.7432l-1.5869-2.4756-1.5918 2.4756zm6.6699 0 2.4463-3.7354-2.2168-3.4229h1.6895l1.4355 2.2998 1.4062-2.2998h1.6748l-2.2266 3.4766 2.4463 3.6816h-1.7432l-1.5869-2.4756-1.5918 2.4756z" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 752 B

After

Width:  |  Height:  |  Size: 752 B

View File

@@ -103,9 +103,10 @@ line|z11-[highway=bridleway],
{color: @path; opacity: 1;}
line|z11-[highway=cycleway],
line|z13-[highway=footway][bicycle=designated]::cycleline,
line|z12-[highway=path][bicycle=designated]::cycleline,
{color: @cycleway; opacity: 1;}
line|z13-[highway=footway][bicycle=designated]::cycleline,
{color: @cycleway; opacity: 0.8;}
line|z11[highway=track],
{width: 1.1; dashes: 6,2.5; opacity: 0.6;}
@@ -167,37 +168,27 @@ line|z13-[highway=footway][bicycle=designated],
{opacity: 0.8;}
line|z12[highway=path][bicycle=designated],
line|z12[highway=footway][bicycle=designated],
{width: 1.1; dashes: 3.5,2.5; opacity: 0.7;}
line|z13[highway=path][bicycle=designated],
line|z13[highway=footway][bicycle=designated],
{width: 1.3; dashes: 4,3;}
line|z14[highway=path][bicycle=designated],
line|z14[highway=footway][bicycle=designated],
{width: 1.6; dashes: 4,3;}
line|z15[highway=path][bicycle=designated],
line|z15[highway=footway][bicycle=designated],
{width: 2; dashes: 6,4.5;}
line|z16[highway=path][bicycle=designated],
line|z16[highway=footway][bicycle=designated],
{width: 2.6; dashes: 6,4.5;}
line|z17[highway=path][bicycle=designated],
line|z17[highway=footway][bicycle=designated],
{width: 3.3; dashes: 8,6;}
line|z18-[highway=path][bicycle=designated],
line|z18-[highway=footway][bicycle=designated],
{width: 4; dashes: 8,6; opacity: 1;}
line|z12[highway=footway][bicycle=designated],
{width: 1.1; dashes: 2,6; opacity: 0.7;}
line|z13[highway=footway][bicycle=designated],
{width: 1.3; dashes: 3,7;}
line|z14[highway=footway][bicycle=designated],
{width: 1.6; dashes: 4,8;}
line|z15[highway=footway][bicycle=designated],
{width: 2; dashes: 6,9; opacity: 0.8;}
line|z16[highway=footway][bicycle=designated],
{width: 2.6; dashes: 8,10; opacity: 0.9;}
line|z17[highway=footway][bicycle=designated],
{width: 3.3; dashes: 10,11; opacity: 1;}
line|z18[highway=footway][bicycle=designated],
{width: 4; dashes: 15,15; opacity: 1;}
line|z19-[highway=footway][bicycle=designated],
{width: 4; dashes: 20,20; opacity: 1;}
line|z11[highway=path][_path_grade=difficult],
line|z11[highway=path][_path_grade=expert],
{width: 1; dashes: 1,2; opacity: 0.7;}
@@ -256,42 +247,32 @@ line|z18-[highway=bridleway],
line|z11[highway=cycleway],
{width: 0.9; opacity: 0.7;}
line|z12[highway=cycleway],
{width: 1.1; opacity: 0.7;}
line|z12[highway=path][bicycle=designated]::cycleline,
{width: 1; opacity: 0.7;}
line|z13[highway=cycleway],
line|z13[highway=path][bicycle=designated]::cycleline,
{width: 1.3; opacity: 0.8;}
line|z14[highway=cycleway],
line|z14[highway=path][bicycle=designated]::cycleline,
{width: 1.6;}
line|z15[highway=cycleway],
line|z15[highway=path][bicycle=designated]::cycleline,
{width: 2;}
line|z16[highway=cycleway],
line|z16[highway=path][bicycle=designated]::cycleline,
{width: 2.6;}
line|z17[highway=cycleway],
line|z17[highway=path][bicycle=designated]::cycleline,
{width: 3.3;}
line|z18-[highway=cycleway],
line|z18-[highway=path][bicycle=designated]::cycleline,
{width: 4;}
line|z13-[highway=footway][bicycle=designated]::cycleline,
{opacity: 1;}
line|z13[highway=footway][bicycle=designated]::cycleline,
{width: 0.5;}
line|z13[highway=path][bicycle=designated]::cycleline,
{width: 1.1; opacity: 0.8;}
line|z14[highway=cycleway],
line|z14[highway=footway][bicycle=designated]::cycleline,
{width: 0.6;}
line|z14[highway=path][bicycle=designated]::cycleline,
{width: 1.3;}
line|z15[highway=cycleway],
line|z15[highway=footway][bicycle=designated]::cycleline,
{width: 0.7;}
line|z15[highway=path][bicycle=designated]::cycleline,
{width: 1.5;}
line|z16[highway=cycleway],
line|z16[highway=footway][bicycle=designated]::cycleline,
{width: 0.8;}
line|z16[highway=path][bicycle=designated]::cycleline,
{width: 1.7;}
line|z17[highway=cycleway],
line|z17[highway=footway][bicycle=designated]::cycleline,
{width: 1.1;}
line|z18[highway=footway][bicycle=designated]::cycleline,
{width: 1.4;}
line|z19-[highway=footway][bicycle=designated]::cycleline,
{width: 2.0;}
line|z17[highway=path][bicycle=designated]::cycleline,
{width: 2;}
line|z18-[highway=cycleway],
line|z18-[highway=footway][bicycle=designated]::cycleline,
line|z18-[highway=path][bicycle=designated]::cycleline,
{width: 2.4;}
/* Ski pistes */

View File

@@ -47,12 +47,6 @@ power-line::dash # line::dash z13- (also has
power-minor_line::dash # line::dash z15- (also has line z15-)
=== 340
highway-footway-bicycle # line z11- (also has line::cycleline z13-, pathtext z13-)
=== 332
highway-footway-bicycle::cycleline # line::cycleline z13- (also has line z11-, pathtext z13-)
=== 331
highway-cycleway # line z11- (also has pathtext z13-)
highway-cycleway-bridge # line z11- (also has line::bridgeblack z17-, line::bridgewhite z15-, pathtext z13-)
highway-cycleway-tunnel # line z11- (also has line::tunnelBackground z17-, line::tunnelCasing z17-, pathtext z13-)
@@ -278,8 +272,9 @@ highway-bridleway-bridge # line z11- (also has line::
highway-bridleway-tunnel # line z11- (also has line::tunnelBackground z17-, line::tunnelCasing z17-, pathtext z13-)
highway-footway # line z11- (also has pathtext z13-)
highway-footway-area # line z11- and area z14- (also has pathtext z13-)
highway-footway-bicycle # line z11- (also has line::cycleline z13-, pathtext z13-)
highway-path # line z11- (also has pathtext z13-)
highway-path-bicycle # line z11- (also has line::cycleline z13-, pathtext z13-)
highway-path-bicycle # line z11- (also has line::cycleline z12-, pathtext z13-)
highway-path-difficult # line z11- (also has pathtext z13-)
highway-path-expert # line z11- (also has pathtext z13-)
highway-raceway # line z14- (also has pathtext z16-)
@@ -290,7 +285,8 @@ highway-track-no-access # line z11- (also has pathte
highway-track-tunnel # line z11- (also has line::tunnelBackground z17-, line::tunnelCasing z17-, pathtext z13-)
=== 180
highway-path-bicycle::cycleline # line::cycleline z13- (also has line z11-, pathtext z13-)
highway-footway-bicycle::cycleline # line::cycleline z13- (also has line z11-, pathtext z13-)
highway-path-bicycle::cycleline # line::cycleline z12- (also has line z11-, pathtext z13-)
=== 170
highway-construction # line z11- (also has pathtext z15-)

View File

@@ -668,9 +668,6 @@ highway-residential-bridge::shield # shield::shield z15- (also
highway-residential-tunnel::shield # shield::shield z15- (also has pathtext z13-, line z12-, line(casing) z16-)
=== 2955
highway-footway-bicycle # pathtext z13- (also has line z11-, line::cycleline z13-)
=== 2954
highway-cycleway # pathtext z13- (also has line z11-)
highway-cycleway-bridge # pathtext z13- (also has line z11-, line::bridgeblack z17-, line::bridgewhite z15-)
highway-cycleway-tunnel # pathtext z13- (also has line z11-, line::tunnelBackground z17-, line::tunnelCasing z17-)
@@ -679,6 +676,7 @@ highway-cycleway-tunnel # pathtext z13- (also has li
area:highway-footway # caption z15- (also has area z14-)
highway-footway # pathtext z13- (also has line z11-)
highway-footway-area # pathtext z13- (also has line z11-, area z14-)
highway-footway-bicycle # pathtext z13- (also has line z11-, line::cycleline z13-)
highway-footway-bridge # pathtext z13- (also has line z11-, line::bridgeblack z17-, line::bridgewhite z15-)
highway-footway-tunnel # pathtext z13- (also has line z11-, line::tunnelBackground z17-, line::tunnelCasing z17-)
highway-tertiary_link # pathtext z18- (also has line z14-)
@@ -708,7 +706,7 @@ highway-bridleway # pathtext z13- (also has li
highway-bridleway-bridge # pathtext z13- (also has line z11-, line::bridgeblack z17-, line::bridgewhite z15-)
highway-bridleway-tunnel # pathtext z13- (also has line z11-, line::tunnelBackground z17-, line::tunnelCasing z17-)
highway-path # pathtext z13- (also has line z11-)
highway-path-bicycle # pathtext z13- (also has line z11-, line::cycleline z13-)
highway-path-bicycle # pathtext z13- (also has line z11-, line::cycleline z12-)
highway-path-bridge # pathtext z13- (also has line z11-, line::bridgeblack z17-, line::bridgewhite z15-)
highway-path-difficult # pathtext z13- (also has line z11-)
highway-path-expert # pathtext z13- (also has line z11-)

View File

@@ -34,9 +34,6 @@
@cycleway: #534DEB; /* slightly darker than in main */
@pedestrian: #FFFFFF; /* slightly lighter than in main */
@footway: #FFFFFF; /* slightly lighter than in main */
@construction: #ABAB9A;
/* 5.5 Transport */

View File

@@ -11,18 +11,27 @@
To build and run CoMaps you'll need a machine with at least 4Gb of RAM and 20-30Gb of disk space depending on your target platform. Expect to download 2-5Gb of files.
For _Windows_ you need to have [Git for Windows](https://git-scm.com/download/win) installed and Git bash available in the PATH.
## Getting sources
First of all get the source code. The full CoMaps sources repository is ~3Gb in size, there are various [clone options](#special-cases-options) to reduce the download size to suit your needs.
Clone the repository including all submodules (see [Special cases options](#special-cases-options) below)
For _Windows_, it's necessary to enable symlink support:
1. Activate _Windows Development Mode_ to enable symlinks globally:
- Windows 10: _Settings_ -> _Update and Security_ -> _For Developers_ -> _Activate Developer Mode_
- Windows 11: _Settings_ -> _Privacy and Security_ -> _For Developers_ -> _Activate Developer Mode_
- Press Win + R, run `ms-settings:developers` and _Activate Developer Mode_
2. Enable [symlinks](https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks) support in git. The easiest way is to reinstall the latest [Git for Windows](https://git-scm.com/download/win) with the "Enable Symlinks" checkbox checked. If you don't want to reinstall Git, then you can add `-c core.symlinks=true` parameter to the clone command below to enable symlinks for the repository.
```bash
git config --global core.symlinks true
```
Clone the repository including all submodules (see [Special cases options](#special-cases-options) below):
(if you plan to contribute and propose pull requests then use a web interface at https://codeberg.org/comaps/comaps to fork the repository first and use your fork's URL in the command below)
Follow the instructions for your OS, and afterwards the repository is prepared to build a CoMaps app!
### Linux
Clone the repository
```bash
git clone --recurse-submodules --shallow-submodules https://codeberg.org/comaps/comaps.git
```
@@ -45,25 +54,6 @@ Configure the repository (make sure you have a working C++ build environment):
bash ./configure.sh
```
### Windows
You need to have [Git for Windows](https://git-scm.com/download/win) installed and Git bash available in the PATH.
It's necessary to enable symlink support:
1. Activate _Windows Development Mode_ to enable symlinks globally:
- Windows 10: _Settings_ -> _Update and Security_ -> _For Developers_ -> _Activate Developer Mode_
- Windows 11: _Settings_ -> _Privacy and Security_ -> _For Developers_ -> _Activate Developer Mode_
- Press Win + R, run `ms-settings:developers` and _Activate Developer Mode_
2. Enable [symlinks](https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks) support in git. The easiest way is to reinstall the latest [Git for Windows](https://git-scm.com/download/win) with the "Enable Symlinks" checkbox checked. If you don't want to reinstall Git, then you can add `-c core.symlinks=true` parameter to the clone command below to enable symlinks for the repository.
```bash
git config --global core.symlinks true
```
Clone the repository
```bash
git clone --recurse-submodules --shallow-submodules https://codeberg.org/comaps/comaps.git
```
For _Windows 10_: You should be able to build the project by following either of these setup methods:
**Setup 1: Using WSL**
@@ -79,30 +69,7 @@ For _Windows 10_: You should be able to build the project by following either o
"C:\Program Files\Git\bin\bash.exe" configure.sh # execute the script by using Developer Command Prompt
```
### macOS
Install required build dependencies and Xcode
1. Install Xcode Command Line Tools
2. Install [Xcode](https://apps.apple.com/app/xcode/id497799835?mt=12) from the App Store
3. Install [Homebrew](https://brew.sh) and required dependencies
4. Clone and configure the repository to be able to build the iOS app later
#### Xcode Command Line Tools
```bash
xcode-select --install
```
#### Homebrew packages
```bash
brew install wget optipng
```
#### Clone and configure repository
Clone the repository
```bash
git clone --recurse-submodules --shallow-submodules https://codeberg.org/comaps/comaps.git
cd comaps
bash ./configure.sh
```
Now the repository is prepared to build a CoMaps app!
### Special cases options
@@ -368,7 +335,13 @@ Building CoMaps for iOS requires a Mac.
Ensure that you have at least 20GB of free space.
Perform the steps in [getting all sources](#getting-sources), including configuring the repository
After [getting all sources](#getting-sources), please make sure that Command Line Tools are installed:
```bash
xcode-select --install
```
Then, install [Xcode](https://apps.apple.com/app/xcode/id497799835?mt=12) from the App Store.
Enroll in the [Apple Developer Program](https://developer.apple.com/programs/) (you can run CoMaps in Simulator without this step).

View File

@@ -1,6 +1,7 @@
#include "testing/testing.hpp"
#include "drape_frontend/path_text_handle.hpp"
#include "drape_frontend/visual_params.hpp"
#include "base/logging.hpp"
@@ -15,10 +16,12 @@ bool IsSmooth(m2::SplineEx const & spline)
}
return true;
}
}
} // namespace
UNIT_TEST(Rounding_Spline)
{
df::VisualParams::Init(1.0, 1024);
m2::SplineEx spline1;
df::AddPointAndRound(spline1, m2::PointD(0, 200));
df::AddPointAndRound(spline1, m2::PointD(0, 0));

View File

@@ -3,54 +3,47 @@
#include "routing/routing_helpers.hpp"
#include "indexer/altitude_loader.hpp"
#include "indexer/feature.hpp"
#include "indexer/feature_altitude.hpp"
#include "indexer/feature_data.hpp"
#include "indexer/feature_processor.hpp"
#include "coding/files_container.hpp"
#include "coding/internal/file_data.hpp"
#include "coding/read_write_utils.hpp"
#include "coding/reader.hpp"
#include "coding/succinct_mapper.hpp"
#include "coding/varint.hpp"
#include "geometry/latlon.hpp"
#include "base/assert.hpp"
#include "base/checked_cast.hpp"
#include "base/file_name_utils.hpp"
#include "base/logging.hpp"
#include "base/scope_guard.hpp"
#include "base/stl_helpers.hpp"
#include "base/string_utils.hpp"
#include "defines.hpp"
#include <algorithm>
#include <type_traits>
#include <utility>
#include <vector>
#include "3party/succinct/elias_fano.hpp"
#include "3party/succinct/mapper.hpp"
#include "3party/succinct/rs_bit_vector.hpp"
namespace routing
{
using namespace feature;
using namespace geometry;
namespace
{
using namespace routing;
class SrtmGetter : public AltitudeGetter
{
public:
explicit SrtmGetter(std::string const & srtmDir) : m_srtmManager(srtmDir) {}
// AltitudeGetter overrides:
geometry::Altitude GetAltitude(m2::PointD const & p) override
Altitude GetAltitude(m2::PointD const & p) override
{
return m_srtmManager.GetHeight(mercator::ToLatLon(p));
return m_srtmManager.GetAltitude(mercator::ToLatLon(p));
}
void PrintStatsAndPurge() override
{
LOG(LINFO, ("Srtm tiles number (x26Mb):", m_srtmManager.GeTilesNumber()));
m_srtmManager.Purge();
}
private:
@@ -62,39 +55,24 @@ class Processor
public:
struct FeatureAltitude
{
FeatureAltitude() : m_featureId(0) {}
FeatureAltitude(uint32_t featureId, Altitudes const & altitudes)
: m_featureId(featureId), m_altitudes(altitudes)
FeatureAltitude(uint32_t featureId, geometry::Altitudes && altitudes)
: m_featureId(featureId), m_altitudes(std::move(altitudes))
{
}
uint32_t m_featureId;
Altitudes m_altitudes;
feature::Altitudes m_altitudes;
};
using TFeatureAltitudes = std::vector<FeatureAltitude>;
explicit Processor(AltitudeGetter & altitudeGetter)
: m_altitudeGetter(altitudeGetter), m_minAltitude(geometry::kInvalidAltitude)
: m_minAltitude(geometry::kInvalidAltitude), m_altitudeGetter(altitudeGetter)
{
}
TFeatureAltitudes const & GetFeatureAltitudes() const { return m_featureAltitudes; }
succinct::bit_vector_builder & GetAltitudeAvailabilityBuilder()
void operator()(FeatureType & f, uint32_t id)
{
return m_altitudeAvailabilityBuilder;
}
geometry::Altitude GetMinAltitude() const { return m_minAltitude; }
void operator()(FeatureType & f, uint32_t const & id)
{
if (id != m_altitudeAvailabilityBuilder.size())
{
LOG(LERROR, ("There's a gap in feature id order."));
return;
}
CHECK_EQUAL(f.GetID().m_index, id, ());
CHECK_EQUAL(id, m_altitudeAvailabilityBuilder.size(), ());
bool hasAltitude = false;
SCOPE_GUARD(altitudeAvailabilityBuilding,
@@ -109,12 +87,19 @@ public:
return;
geometry::Altitudes altitudes;
geometry::Altitude minFeatureAltitude = geometry::kInvalidAltitude;
altitudes.reserve(pointsCount);
Altitude minFeatureAltitude = geometry::kInvalidAltitude;
for (size_t i = 0; i < pointsCount; ++i)
{
geometry::Altitude const a = m_altitudeGetter.GetAltitude(f.GetPoint(i));
auto const & pt = f.GetPoint(i);
Altitude const a = m_altitudeGetter.GetAltitude(pt);
if (a == geometry::kInvalidAltitude)
{
// Print warning for missing altitude point (if not a ferry or so).
auto const type = CarModel::AllLimitsInstance().GetHighwayType(feature::TypesHolder(f));
if (type && *type != HighwayType::RouteFerry && *type != HighwayType::RouteShuttleTrain)
LOG(LWARNING, ("Invalid altitude at:", mercator::ToLatLon(pt)));
// One invalid point invalidates the whole feature.
return;
}
@@ -128,7 +113,7 @@ public:
}
hasAltitude = true;
m_featureAltitudes.emplace_back(id, Altitudes(std::move(altitudes)));
m_featureAltitudes.emplace_back(id, std::move(altitudes));
if (m_minAltitude == geometry::kInvalidAltitude)
m_minAltitude = minFeatureAltitude;
@@ -138,22 +123,15 @@ public:
bool HasAltitudeInfo() const { return !m_featureAltitudes.empty(); }
bool IsFeatureAltitudesSorted()
{
return std::is_sorted(m_featureAltitudes.begin(), m_featureAltitudes.end(),
base::LessBy(&Processor::FeatureAltitude::m_featureId));
}
private:
AltitudeGetter & m_altitudeGetter;
TFeatureAltitudes m_featureAltitudes;
public:
std::vector<FeatureAltitude> m_featureAltitudes;
succinct::bit_vector_builder m_altitudeAvailabilityBuilder;
geometry::Altitude m_minAltitude;
Altitude m_minAltitude;
AltitudeGetter & m_altitudeGetter;
};
} // namespace
namespace routing
{
void BuildRoadAltitudes(std::string const & mwmPath, AltitudeGetter & altitudeGetter)
{
try
@@ -161,28 +139,27 @@ void BuildRoadAltitudes(std::string const & mwmPath, AltitudeGetter & altitudeGe
// Preparing altitude information.
Processor processor(altitudeGetter);
feature::ForEachFeature(mwmPath, processor);
processor.m_altitudeGetter.PrintStatsAndPurge();
if (!processor.HasAltitudeInfo())
{
LOG(LINFO, ("No altitude information for road features of mwm:", mwmPath));
// Possible for small islands like Bouvet or Willis.
LOG(LWARNING, ("No altitude information for road features of mwm:", mwmPath));
return;
}
CHECK(processor.IsFeatureAltitudesSorted(), ());
FilesContainerW cont(mwmPath, FileWriter::OP_WRITE_EXISTING);
auto w = cont.GetWriter(ALTITUDES_FILE_TAG);
AltitudeHeader header;
header.m_minAltitude = processor.GetMinAltitude();
header.m_minAltitude = processor.m_minAltitude;
auto const startOffset = w->Pos();
header.Serialize(*w);
{
// Altitude availability serialization.
coding::FreezeVisitor<Writer> visitor(*w);
succinct::bit_vector_builder & builder = processor.GetAltitudeAvailabilityBuilder();
succinct::rs_bit_vector(&builder).map(visitor);
succinct::rs_bit_vector(&processor.m_altitudeAvailabilityBuilder).map(visitor);
}
header.m_featureTableOffset = base::checked_cast<uint32_t>(w->Pos() - startOffset);
@@ -191,8 +168,7 @@ void BuildRoadAltitudes(std::string const & mwmPath, AltitudeGetter & altitudeGe
{
// Altitude info serialization to memory.
MemWriter<std::vector<uint8_t>> writer(deltas);
Processor::TFeatureAltitudes const & featureAltitudes = processor.GetFeatureAltitudes();
for (auto const & a : featureAltitudes)
for (auto const & a : processor.m_featureAltitudes)
{
offsets.push_back(base::checked_cast<uint32_t>(writer.Pos()));
a.m_altitudes.Serialize(header.m_minAltitude, writer);
@@ -200,8 +176,7 @@ void BuildRoadAltitudes(std::string const & mwmPath, AltitudeGetter & altitudeGe
}
{
// Altitude offsets serialization.
CHECK(std::is_sorted(offsets.begin(), offsets.end()), ());
CHECK(adjacent_find(offsets.begin(), offsets.end()) == offsets.end(), ());
CHECK(base::IsSortedAndUnique(offsets.begin(), offsets.end()), ());
succinct::elias_fano::elias_fano_builder builder(offsets.back(), offsets.size());
for (uint32_t offset : offsets)
@@ -221,9 +196,10 @@ void BuildRoadAltitudes(std::string const & mwmPath, AltitudeGetter & altitudeGe
w->Seek(startOffset);
header.Serialize(w);
w->Seek(endOffset);
LOG(LINFO, (ALTITUDES_FILE_TAG, "section is ready. The size is", header.m_endOffset));
if (processor.HasAltitudeInfo())
LOG(LINFO, ("Min altitude is", processor.GetMinAltitude()));
LOG(LINFO, ("Min altitude is", processor.m_minAltitude));
else
LOG(LINFO, ("Min altitude isn't defined."));
}

View File

@@ -3,8 +3,6 @@
#include "geometry/point2d.hpp"
#include "geometry/point_with_altitude.hpp"
#include "indexer/feature_altitude.hpp"
#include <string>
namespace routing
@@ -13,6 +11,7 @@ class AltitudeGetter
{
public:
virtual geometry::Altitude GetAltitude(m2::PointD const & p) = 0;
virtual void PrintStatsAndPurge() {}
};
/// \brief Adds altitude section to mwm. It has the following format:

View File

@@ -13,7 +13,6 @@
#include "coding/varint.hpp"
#include "geometry/mercator.hpp"
#include "geometry/parametrized_segment.hpp"
#include "geometry/simplification.hpp"
#include "base/assert.hpp"
@@ -24,20 +23,18 @@
#include <cmath>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <mutex>
#include <vector>
#include "base/assert.hpp"
#include "base/string_utils.hpp"
#include "defines.hpp"
namespace borders
{
namespace
{
template <class ToDo>
void ForEachCountry(std::string const & baseDir, ToDo && toDo)
{
@@ -49,11 +46,11 @@ void ForEachCountry(std::string const & baseDir, ToDo && toDo)
Platform::GetFilesByExt(bordersDir, BORDERS_EXTENSION, files);
for (std::string file : files)
{
std::vector<m2::RegionD> polygons;
PolygonsList polygons;
if (LoadBorders(bordersDir + file, polygons))
{
base::GetNameWithoutExt(file);
toDo(file, polygons);
toDo(std::move(file), std::move(polygons));
}
}
}
@@ -65,7 +62,7 @@ public:
{
}
void operator()(std::string const & name, std::vector<m2::RegionD> const & borders)
void operator()(std::string name, PolygonsList && borders)
{
// use index in vector as tag
auto w = m_writer.GetWriter(strings::to_string(m_polys.size()));
@@ -105,7 +102,7 @@ private:
std::vector<storage::CountryDef> m_polys;
};
bool ReadPolygon(std::istream & stream, m2::RegionD & region, std::string const & filename)
bool ReadPolygon(std::istream & stream, Polygon & poly, std::string const & filename)
{
std::string line, name;
double lon, lat;
@@ -130,7 +127,7 @@ bool ReadPolygon(std::istream & stream, m2::RegionD & region, std::string const
iss >> lon >> lat;
CHECK(!iss.fail(), ("Incorrect data in", filename));
region.AddPoint(mercator::FromLatLon(lat, lon));
poly.AddPoint(mercator::FromLatLon(lat, lon));
}
// drop inner rings
@@ -146,7 +143,7 @@ bool CountryPolygons::Contains(m2::PointD const & point) const
});
}
bool LoadBorders(std::string const & borderFile, std::vector<m2::RegionD> & outBorders)
bool LoadBorders(std::string const & borderFile, PolygonsList & outBorders)
{
std::ifstream stream(borderFile);
std::string line;
@@ -156,12 +153,12 @@ bool LoadBorders(std::string const & borderFile, std::vector<m2::RegionD> & outB
return false;
}
m2::RegionD currentPolygon;
Polygon currentPolygon;
while (ReadPolygon(stream, currentPolygon, borderFile))
{
CHECK(currentPolygon.IsValid(), ("Invalid region in", borderFile));
outBorders.emplace_back(std::move(currentPolygon));
currentPolygon = m2::RegionD();
currentPolygon = {};
}
CHECK(!outBorders.empty(), ("No borders were loaded from", borderFile));
@@ -178,7 +175,7 @@ bool GetBordersRect(std::string const & baseDir, std::string const & country,
return false;
}
std::vector<m2::RegionD> borders;
PolygonsList borders;
CHECK(LoadBorders(bordersFile, borders), ());
bordersRect.MakeEmpty();
for (auto const & border : borders)
@@ -192,13 +189,16 @@ CountryPolygonsCollection LoadCountriesList(std::string const & baseDir)
LOG(LINFO, ("Loading countries in", BORDERS_DIR, "folder in", baseDir));
CountryPolygonsCollection countryPolygonsCollection;
ForEachCountry(baseDir, [&](auto const & name, auto const & borders)
ForEachCountry(baseDir, [&](std::string name, PolygonsList && borders)
{
PolygonsTree polygons;
for (m2::RegionD const & border : borders)
polygons.Add(border, border.GetRect());
for (Polygon & border : borders)
{
auto const rect = border.GetRect();
polygons.Add(std::move(border), rect);
}
countryPolygonsCollection.Add(CountryPolygons(name, polygons));
countryPolygonsCollection.Add(CountryPolygons(std::move(name), std::move(polygons)));
});
LOG(LINFO, ("Countries loaded:", countryPolygonsCollection.GetSize()));
@@ -214,7 +214,7 @@ void GeneratePackedBorders(std::string const & baseDir)
}
void DumpBorderToPolyFile(std::string const & targetDir, storage::CountryId const & mwmName,
std::vector<m2::RegionD> const & polygons)
PolygonsList const & polygons)
{
CHECK(!polygons.empty(), ());
@@ -222,7 +222,8 @@ void DumpBorderToPolyFile(std::string const & targetDir, storage::CountryId cons
std::ofstream poly(filePath);
CHECK(poly.good(), ());
poly << std::setprecision(20) << std::fixed;
// Used to have fixed precicion with 6 digits. And Alaska has 4 digits after comma :) Strange, but as is.
poly << std::setprecision(6) << std::fixed;
poly << mwmName << std::endl;
size_t polygonId = 1;

View File

@@ -1,7 +1,5 @@
#pragma once
#include "generator/feature_builder.hpp"
#include "storage/storage_defines.hpp"
#include "coding/geometry_coding.hpp"
@@ -11,12 +9,9 @@
#include "geometry/region2d.hpp"
#include "geometry/tree4d.hpp"
#include <memory>
#include <mutex>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define BORDERS_DIR "borders/"
@@ -48,9 +43,8 @@ class CountryPolygons
{
public:
CountryPolygons() = default;
explicit CountryPolygons(std::string const & name, PolygonsTree const & regions)
: m_name(name)
, m_polygons(regions)
explicit CountryPolygons(std::string && name, PolygonsTree && regions)
: m_name(std::move(name)), m_polygons(std::move(regions))
{
}
@@ -97,6 +91,8 @@ public:
private:
std::string m_name;
/// @todo Is it an overkill to store Tree4D for each country's polygon?
PolygonsTree m_polygons;
};
@@ -105,11 +101,15 @@ class CountryPolygonsCollection
public:
CountryPolygonsCollection() = default;
void Add(CountryPolygons const & countryPolygons)
void Add(CountryPolygons && countryPolygons)
{
auto const it = m_countryPolygonsMap.emplace(countryPolygons.GetName(), countryPolygons);
countryPolygons.ForEachPolygon([&](auto const & polygon) {
m_regionsTree.Add(it.first->second, polygon.GetRect());
auto const res = m_countryPolygonsMap.emplace(countryPolygons.GetName(), std::move(countryPolygons));
CHECK(res.second, ());
auto const & inserted = res.first->second;
inserted.ForEachPolygon([&inserted, this](Polygon const & polygon)
{
m_regionsTree.Add(inserted, polygon.GetRect());
});
}
@@ -119,9 +119,10 @@ public:
void ForEachCountryInRect(m2::RectD const & rect, ToDo && toDo) const
{
std::unordered_set<CountryPolygons const *> uniq;
m_regionsTree.ForEachInRect(rect, [&](auto const & countryPolygons) {
if (uniq.emplace(&countryPolygons.get()).second)
toDo(countryPolygons);
m_regionsTree.ForEachInRect(rect, [&](CountryPolygons const & cp)
{
if (uniq.insert(&cp).second)
toDo(cp);
});
}
@@ -142,8 +143,10 @@ private:
std::unordered_map<std::string, CountryPolygons> m_countryPolygonsMap;
};
using PolygonsList = std::vector<Polygon>;
/// @return false if borderFile can't be opened
bool LoadBorders(std::string const & borderFile, std::vector<m2::RegionD> & outBorders);
bool LoadBorders(std::string const & borderFile, PolygonsList & outBorders);
bool GetBordersRect(std::string const & baseDir, std::string const & country,
m2::RectD & bordersRect);
@@ -153,10 +156,10 @@ bool LoadCountriesList(std::string const & baseDir, CountryPolygonsCollection &
void GeneratePackedBorders(std::string const & baseDir);
template <typename Source>
std::vector<m2::RegionD> ReadPolygonsOfOneBorder(Source & src)
PolygonsList ReadPolygonsOfOneBorder(Source & src)
{
auto const count = ReadVarUint<uint32_t>(src);
std::vector<m2::RegionD> result(count);
PolygonsList result(count);
for (size_t i = 0; i < count; ++i)
{
std::vector<m2::PointD> points;
@@ -168,7 +171,7 @@ std::vector<m2::RegionD> ReadPolygonsOfOneBorder(Source & src)
}
void DumpBorderToPolyFile(std::string const & filePath, storage::CountryId const & mwmName,
std::vector<m2::RegionD> const & polygons);
PolygonsList const & polygons);
void UnpackBorders(std::string const & baseDir, std::string const & targetDir);
CountryPolygonsCollection const & GetOrCreateCountryPolygonsTree(std::string const & baseDir);

View File

@@ -2,7 +2,6 @@
#include "generator/utils.hpp"
#include "indexer/feature.hpp"
#include "indexer/ftypes_matcher.hpp"
#include "indexer/feature_processor.hpp"
#include "platform/platform.hpp"
@@ -88,45 +87,38 @@ std::string DescriptionsCollectionBuilderStat::LangStatisticsToString() const
void DescriptionsCollector::operator() (FeatureType & ft, uint32_t featureId)
{
auto const & attractionsChecker = ftypes::AttractionsChecker::Instance();
if (!attractionsChecker(ft))
return;
// auto const & attractionsChecker = ftypes::AttractionsChecker::Instance();
// if (!attractionsChecker(ft))
// return;
(*this)(ft.GetMetadata().GetWikiURL(), featureId);
}
void DescriptionsCollector::operator() (std::string const & wikiUrl, uint32_t featureId)
{
std::string path;
descriptions::LangMeta langsMeta;
size_t size = 0;
// First try to get wikipedia url.
bool const isWikiUrl = !wikiUrl.empty();
if (isWikiUrl)
if (!wikiUrl.empty())
size = FindPageAndFill(MakePathForWikipedia(m_wikipediaDir, wikiUrl), langsMeta);
// Second try to get wikidata id.
bool const isWikiUrl = !langsMeta.empty();
if (!isWikiUrl)
{
path = MakePathForWikipedia(m_wikipediaDir, wikiUrl);
}
else
{
// Second try to get wikidata id.
auto const wikidataId = m_wikidataHelper.GetWikidataId(featureId);
if (wikidataId)
path = MakePathForWikidata(m_wikipediaDir, *wikidataId);
size = FindPageAndFill(MakePathForWikidata(m_wikipediaDir, *wikidataId), langsMeta);
}
if (path.empty())
if (langsMeta.empty())
return;
descriptions::LangMeta langsMeta;
int const sz = FindPageAndFill(path, langsMeta);
if (sz < 0)
{
LOG(LWARNING, ("Page", path, "not found."));
return;
}
else if (sz > 0)
if (size > 0)
{
// Add only new loaded pages (not from cache).
m_stat.AddSize(sz);
m_stat.AddSize(size);
m_stat.IncPage();
}
@@ -166,10 +158,10 @@ std::string DescriptionsCollector::FillStringFromFile(std::string const & fullPa
return std::string(std::istreambuf_iterator<char>(stream), std::istreambuf_iterator<char>());
}
int DescriptionsCollector::FindPageAndFill(std::string const & path, descriptions::LangMeta & meta)
size_t DescriptionsCollector::FindPageAndFill(std::string const & path, descriptions::LangMeta & meta)
{
int size = -1;
if (!IsValidDir(path))
size_t size = 0;
if (path.empty() || !IsValidDir(path))
return size;
Platform::FilesList filelist;
@@ -184,24 +176,27 @@ int DescriptionsCollector::FindPageAndFill(std::string const & path, description
continue;
}
if (size < 0)
size = 0;
m_stat.IncCode(code);
auto res = m_path2Index.try_emplace(base::JoinPath(path, filename), 0);
if (res.second)
{
auto const & filePath = res.first->first;
auto content = FillStringFromFile(filePath);
size_t const sz = content.size();
if (sz == 0)
{
LOG(LWARNING, ("Empty descriptions file:", filePath));
m_path2Index.erase(res.first);
continue;
}
auto & strings = m_collection.m_strings;
res.first->second = strings.size();
strings.push_back(FillStringFromFile(filePath));
strings.push_back(std::move(content));
size_t const sz = strings.back().size();
CHECK(sz > 0, ("Empty file:", filePath));
size += sz;
}
m_stat.IncCode(code);
meta.emplace_back(code, res.first->second);
}

View File

@@ -78,8 +78,8 @@ public:
static std::string FillStringFromFile(std::string const & fullPath);
/// @return -1 If page not found. 0 if page from cache. Size > 0 if page was loaded from disk.
int FindPageAndFill(std::string const & wikipediaUrl, descriptions::LangMeta & meta);
/// @return Aggregated loaded from disk page's size.
size_t FindPageAndFill(std::string const & wikipediaUrl, descriptions::LangMeta & meta);
public:
DescriptionsCollectionBuilderStat m_stat;

View File

@@ -188,7 +188,7 @@ public:
for (uint32_t i = 0; i < numPoints; ++i)
{
// Feature segment altitude.
geometry::Altitude altitude = m_srtmManager.GetHeight(mercator::ToLatLon(f.GetPoint(i)));
geometry::Altitude altitude = m_srtmManager.GetAltitude(mercator::ToLatLon(f.GetPoint(i)));
pointAltitudes[i] = altitude == geometry::kInvalidAltitude ? 0 : altitude;
if (i == 0)
{

View File

@@ -113,8 +113,10 @@ public:
StringUtf8Multilang str;
std::string const badUrl = "https://en.wikipedia.org/wiki/Not_exists";
auto const path = DescriptionsCollector::MakePathForWikipedia(m_wikiDir, badUrl);
descriptions::LangMeta meta;
TEST_EQUAL(collector.FindPageAndFill(path, meta), -1, ());
TEST_EQUAL(collector.FindPageAndFill(path, meta), 0, ());
TEST(meta.empty(), ());
}
}

View File

@@ -2,13 +2,26 @@
#include "generator/srtm_parser.hpp"
using namespace generator;
#include "coding/endianness.hpp"
namespace
#include <iostream>
namespace srtm_parser_test
{
inline std::string GetBase(ms::LatLon const & coord) { return SrtmTile::GetBase(coord); }
using namespace generator;
using namespace geometry;
UNIT_TEST(FilenameTests)
inline std::string GetBase(ms::LatLon const & coord)
{
return SrtmTile::GetBase(coord);
}
inline SrtmTile::LatLonKey GetKey(ms::LatLon const & coord)
{
return SrtmTile::GetKey(coord);
}
UNIT_TEST(SRTM_FilenameTest)
{
auto name = GetBase({56.4566, 37.3467});
TEST_EQUAL(name, "N56E037", ());
@@ -16,13 +29,110 @@ UNIT_TEST(FilenameTests)
name = GetBase({34.077433, -118.304569});
TEST_EQUAL(name, "N34W119", ());
name = GetBase({1.0, 1.0});
TEST_EQUAL(name, "N01E001", ());
name = GetBase({0.1, 0.1});
TEST_EQUAL(name, "N00E000", ());
TEST_NOT_EQUAL(GetKey({0.1, 0.1}), GetKey({1.0, 1.0}), ());
name = GetBase({-0.1, -0.1});
TEST_EQUAL(name, "S01W001", ());
TEST_NOT_EQUAL(GetKey({0.1, 0.1}), GetKey({-0.1, -0.1}), ());
name = GetBase({-0.9, -0.9});
TEST_EQUAL(name, "S01W001", ());
TEST_EQUAL(GetKey({-0.9, -0.9}), GetKey({-0.1, -0.1}), ());
name = GetBase({-1.0, -1.0});
TEST_EQUAL(name, "S01W001", ());
TEST_EQUAL(GetKey({-0.9, -0.9}), GetKey({-1.0, -1.0}), ());
name = GetBase({-1.9, -1.1});
TEST_EQUAL(name, "S02W002", ());
TEST_NOT_EQUAL(GetKey({-1.1, -1.1}), GetKey({-1.0, -1.0}), ());
name = GetBase({-35.35, -12.1});
TEST_EQUAL(name, "S36W013", ());
name = GetBase({-34.622358, -58.383654});
TEST_EQUAL(name, "S35W059", ());
}
} // namespace
UNIT_TEST(SRTM_TileTest)
{
SrtmTile tile;
size_t sz;
Altitude * data = tile.DataForTests(sz);
// Fill 5 last rows:
// -4 -4 -4
// -2 -2 -2
// 0 0 0
// 2 2 2
// 4 4 4
size_t row = sz - 1;
for (Altitude a = 4; a >= -4; a -= 2)
{
for (size_t i = row * sz; i < (row + 1) * sz; ++i)
data[i] = ReverseByteOrder(a);
--row;
}
double const len = 1.0 / (sz - 1);
TEST_EQUAL(tile.GetHeight({0, 0}), 4, ());
TEST_ALMOST_EQUAL_ULPS(tile.GetTriangleHeight({0, 0}), 4.0, ());
TEST_ALMOST_EQUAL_ULPS(tile.GetBilinearHeight({0, 0}), 4.0, ());
TEST_EQUAL(tile.GetHeight({len, len}), 2, ());
TEST_ALMOST_EQUAL_ULPS(tile.GetTriangleHeight({len, len}), 2.0, ());
TEST_ALMOST_EQUAL_ULPS(tile.GetBilinearHeight({len, len}), 2.0, ());
double l = len / 2;
Altitude h = tile.GetHeight({l, l});
TEST(h == 4 || h == 2, (h));
TEST_ALMOST_EQUAL_ULPS(tile.GetTriangleHeight({l, l}), 3.0, ());
TEST_ALMOST_EQUAL_ULPS(tile.GetBilinearHeight({l, l}), 3.0, ());
l = 3 * len + len / 2;
h = tile.GetHeight({l, l});
TEST(h == -4 || h == -2, (h));
TEST_ALMOST_EQUAL_ULPS(tile.GetTriangleHeight({l, l}), -3.0, ());
TEST_ALMOST_EQUAL_ULPS(tile.GetBilinearHeight({l, l}), -3.0, ());
}
/*
UNIT_TEST(SRTM_SamplesTest)
{
SrtmTileManager manager("/Users/vng/SRTM");
std::initializer_list<ms::LatLon> arr[] = {
{{ 41.899802800880578957, 12.498703841110341273}, { 41.899748897914214751, 12.498642150302543996}, { 41.899315676124750496, 12.498172763721441925}, { 41.899207869324136766, 12.498057428732948893 }},
{{ 41.900315874986389986, 12.499267105007675127}, { 41.900234022973513959, 12.499175909900486658}, { 41.899802800880578957, 12.498703841110341273 }},
{{ 41.899317672545265623, 12.499556783583443575}, { 41.899704976945002954, 12.498910371206022774}, { 41.899716955394147533, 12.49888623132471821}, { 41.899730930248637151, 12.498862091443413647}, { 41.899744905100071435, 12.49882990493497914}, { 41.899760876355117034, 12.498797718426573056}, { 41.899772854793766896, 12.498768214127181864}, { 41.899788826041820755, 12.498736027618775779}, { 41.899802800880578957, 12.498703841110341273 }},
{{ 41.900297907480371862, 12.497869674100513748}, { 41.900259976062137923, 12.497931364908311025}, { 41.899866685818835776, 12.498593870539906447}, { 41.899834743357700972, 12.498647514720602203}, { 41.899818772121129484, 12.498674336810950081}, { 41.899802800880578957, 12.498703841110341273 }},
{{ 41.899728933841061007, 12.497309092412223208}, { 41.900224041013551357, 12.497850898637267392}, { 41.90023202658165502, 12.49786430968242712}, { 41.900224041013551357, 12.497888449563731683}, { 41.899826757739916161, 12.498548272986312213}, { 41.899808790096251698, 12.498556319613442156}, { 41.899802800880578957, 12.498550955195355527}, { 41.89979281885320006, 12.498545590777297321}, { 41.899307690442057606, 12.498009148970311344}, { 41.899301701179375357, 12.497995737925151616}, { 41.899309686862821422, 12.497976962461905259}, { 41.899716955394147533, 12.497311774621238101}, { 41.899728933841061007, 12.497309092412223208 }},
{{ 41.899802800880578957, 12.498550955195355527}, { 41.899748897914214751, 12.498642150302543996}, { 41.899681020039992063, 12.498754803082022136 }},
{{ 41.899912603078725226, 12.498650196929645517}, { 41.899866685818835776, 12.498593870539906447}, { 41.899826757739916161, 12.498548272986312213 }},
{{ 41.899994455503602353, 12.498516086477906128}, { 41.899912603078725226, 12.498650196929645517}, { 41.899912603078725226, 12.498685065647094916}, { 41.900285929140210328, 12.499090079211356397}, { 41.90030589303923847, 12.499111536883646068}, { 41.90070516970908443, 12.498435620206862495}, { 41.900711158840110215, 12.49842489137071766}, { 41.900715151593857399, 12.498408798116514618}, { 41.900713155217019334, 12.498398069280369782}, { 41.90056342677709722, 12.498237136738282516}, { 41.900327853320931126, 12.497979644670920152}, { 41.900317871375655443, 12.497976962461905259}, { 41.900307889428788144, 12.497982326879963466}, { 41.899994455503602353, 12.498516086477906128 }},
{{ 44.759886801735603967, 34.316046940654871378 }, { 44.759500178870737841, 34.315553414192436321 }, { 44.759132599068138347, 34.315443443622029918 }, { 44.758765016927078761, 34.315430032576841768 }, { 44.758071746835689453, 34.315253006780551459 }, { 44.758037464032938146, 34.315255688989566352 }, { 44.757483222565575431, 34.315306650961247215 }, { 44.756708037437867631, 34.315676795808059296 }, { 44.756323297960172169, 34.315652655926726311 }, { 44.755963316624225001, 34.315430032576841768 }, { 44.755833798981250027, 34.315153765046261469 }, { 44.755789991477485046, 34.314949917159594861 }},
{{ 44.759886801735603967, 34.316046940654871378 }, { 44.760006787615907342, 34.315175222718522718 }, { 44.760048687388419353, 34.315011607967392138 }, { 44.760260090322724125, 34.314772891363304552 }, { 44.760437211104594724, 34.314665603001913041 }, { 44.760572431981174191, 34.314383971053246114 }, { 44.760701939002856875, 34.314300822573159166 }, { 44.761223773178279828, 34.314088928059419459 }, { 44.761292334982400121, 34.314091610268434351 }, { 44.761376132632506142, 34.314011143997390718 }, { 44.761667518969709079, 34.313895809008897686 }, { 44.761739889204726239, 34.31379924948365101 }, { 44.761739889204726239, 34.313705372167419227 }, { 44.76183130410882427, 34.313568579506636524 }, { 44.761930336758403826, 34.313549804043390168 }, { 44.761981757490261202, 34.313442515681998657 }, { 44.762050318394869919, 34.313396918128404423 }, { 44.762176013175370315, 34.313391553710346216 }, { 44.762316943361625476, 34.313359367201911709 }, { 44.762610229403847484, 34.313332545111563832 }, { 44.762627369451166714, 34.313343273947708667 }, { 44.762663553978839559, 34.313313769648317475 }, { 44.762673076219179791, 34.313278900930868076 }, { 44.762678789562635018, 34.313233303377273842 }, { 44.762692120695184883, 34.31320379907788265 }, { 44.762720687397411723, 34.313182341405621401 }, { 44.762734018520298207, 34.313107239552635974 }, { 44.762747349640086725, 34.313091146298432932 }, { 44.7628063874193316, 34.313101875134577767 }, { 44.76292065391750441, 34.313123332806839016 }, { 44.762977787081830172, 34.313056277580983533 }, { 44.763063486722373341, 34.313107239552635974 }, { 44.763282496337311045, 34.313088464089389618 }},
{{ 44.756521381971580809, 34.332137512655094724 }, { 44.756469956380023234, 34.331619846311355104 }, { 44.756412816780184016, 34.331308710063325407 }, { 44.756359486436011252, 34.331040489159818208 }, { 44.75633282124546497, 34.330965387306861203 }, { 44.756294728094793811, 34.330860781154484584 }, { 44.756264253556160781, 34.330694484194339111 }, { 44.756294728094793811, 34.330608653505208849 }, { 44.756323297960172169, 34.330533551652223423 }, { 44.756433767973362592, 34.330359208064976428 }, { 44.756555665673857902, 34.330109762624715586 }, { 44.756641374840555159, 34.329940783455526798 }, { 44.756755653531747896, 34.329755711032106547 }, { 44.757010875126020721, 34.329463350247323206 }, { 44.757180387352946127, 34.329117345281815687 }, { 44.757266095593031707, 34.32893495506743875 }, { 44.757448939413642108, 34.328564810220626669 }, { 44.757591785745901802, 34.328301953735206098 }, { 44.757746059388104243, 34.327797698436654628 }, { 44.757807006886359602, 34.327470468934393466 }, { 44.75787366813893442, 34.327239798957407402 }, { 44.757986039790637278, 34.327089595251464971 }, { 44.758026036427494887, 34.326995717935233188 }, { 44.758113648011466523, 34.326907205037088033 }, { 44.75817078592944398, 34.326783823421465058 }, { 44.758237446762365153, 34.326400267529493249 }, { 44.758264111073970071, 34.3263519877668557 }, { 44.758357436067782942, 34.326177644179608706 }, { 44.758412669156371066, 34.325909423276101506 }, { 44.758505993910240761, 34.325775312824362118 }, { 44.758526944344453113, 34.325598287028071809 }, { 44.758479329710219474, 34.325461494367289106 }, { 44.758391718680712756, 34.325370299260100637 }, { 44.758429810449001707, 34.32524423543546277 }, { 44.75854789477109108, 34.325085985102390396 }, { 44.758637410144764601, 34.324914323724158294 }, { 44.758685024648755757, 34.324734615718824671 }, { 44.758707879596705936, 34.324613916312273432 }, { 44.758766921503791991, 34.324568318758679197 }, { 44.758749780311177346, 34.32444225493404133 }, { 44.758799299298182461, 34.324206220538968637 }, { 44.75882786792522694, 34.323988961607142301 }, { 44.758825963350531651, 34.323667096522939346 }, { 44.758843104520543932, 34.323423015500765132 }, { 44.758862150259034252, 34.323181616687634232 }, { 44.758915478293424428, 34.322983133219054253 }, { 44.758944046863021526, 34.322875844857662742 }, { 44.759084984933011242, 34.322862433812474592 }, { 44.758966901708539865, 34.32266126813487972 }, { 44.758865959405987667, 34.32256202640058973 }, { 44.758753589465527511, 34.322331356423575244 }, { 44.75867359717138072, 34.322089957610444344 }, { 44.758690738386590624, 34.321875380887661322 }, { 44.758690738386590624, 34.321754681481081661 }, { 44.758698356702829813, 34.321642028701631943 }, { 44.758643123887310367, 34.321379172216211373 }, { 44.758641219306547043, 34.321231650719283834 }, { 44.758665978851873035, 34.321027802832645648 }, { 44.758732639113461005, 34.320837365991167189 }, { 44.75867359717138072, 34.320502089861804507 }, { 44.75867931091034535, 34.320392119291369681 }, { 44.758808822175438991, 34.320268737675775128 }, { 44.758793585571083895, 34.320099758506557919 }, { 44.758978329127899087, 34.319783257840441593 }, { 44.759109744288181787, 34.319584774371861613 }, { 44.75926782299799811, 34.31950430810081798 }, { 44.759357337256332698, 34.319305824632238 }, { 44.759387810163708821, 34.319016146056469552 }, { 44.759481133342561066, 34.318686234345193498 }, { 44.75951351073673834, 34.318530666221164438 }, { 44.759524938047988485, 34.318332182752584458 }, { 44.759637306488322395, 34.317903029306989993 }, { 44.759671588341880977, 34.317436324934931235 }, { 44.759871565415501493, 34.317044722415829483 }, { 44.759902038051663453, 34.316647755478669524 }, { 44.759915369824923914, 34.316167640061422617 }, { 44.759886801735603967, 34.316046940654871378 }},
};
using namespace std;
for (auto const & points : arr)
{
for (auto const & p : points)
cout << manager.GetTriangleHeight(p) << ", ";
cout << endl;
}
}
*/
} // namespace srtm_parser_test

View File

@@ -7,6 +7,7 @@
#include "routing/maxspeeds_serialization.hpp"
#include "routing/routing_helpers.hpp"
#include "routing_common/car_model_coefs.hpp"
#include "routing_common/maxspeed_conversion.hpp"
#include "indexer/feature.hpp"
@@ -37,6 +38,10 @@ using namespace routing;
using std::string;
char constexpr kDelim[] = ", \t\r\n";
double constexpr kMinDefSpeedRoadsLengthKm = 5.0;
double constexpr kMaxPossibleDefSpeedKmH = 400.0;
// This factor should be greater than sqrt(2) / 2 - prefer diagonal link to square path.
double constexpr kLinkToMainSpeedFactor = 0.85;
template <class TokenizerT> bool ParseOneSpeedValue(TokenizerT & iter, MaxspeedType & value)
{
@@ -68,11 +73,21 @@ class MaxspeedsMwmCollector
{
double m_lengthKM = 0;
double m_timeH = 0;
double m_speed = -1; // invalid initial value
friend std::string DebugPrint(AvgInfo const & i)
{
std::ostringstream ss;
ss << "AvgInfo{ " << i.m_speed << ", " << i.m_lengthKM << ", " << i.m_timeH << " }";
return ss.str();
}
};
static int constexpr SPEEDS_COUNT = MaxspeedsSerializer::DEFAULT_SPEEDS_COUNT;
static int constexpr kSpeedsCount = MaxspeedsSerializer::DEFAULT_SPEEDS_COUNT;
static int constexpr kOutsideCityIdx = 0;
// 0 - outside a city; 1 - inside a city.
std::unordered_map<HighwayType, AvgInfo> m_avgSpeeds[SPEEDS_COUNT];
std::unordered_map<HighwayType, AvgInfo> m_avgSpeeds[kSpeedsCount];
base::GeoObjectId GetOsmID(uint32_t fid) const
{
@@ -87,10 +102,14 @@ class MaxspeedsMwmCollector
return m_graph->GetRoadGeometry(fid);
}
// OSM data related warning tag for convenient grep.
std::string m_logTag;
public:
MaxspeedsMwmCollector(string const & dataPath, FeatureIdToOsmId const & ft2osm, IndexGraph * graph)
: m_dataPath(dataPath), m_ft2osm(ft2osm), m_graph(graph)
, m_converter(MaxspeedConverter::Instance())
, m_logTag("SpeedsBuilder")
{
}
@@ -146,9 +165,8 @@ public:
(*parentHwType == HighwayType::HighwayTertiary && hwType == HighwayType::HighwayTertiaryLink))
{
// Reduce factor from parent road. See DontUseLinksWhenRidingOnMotorway test.
// 0.85, this factor should be greater than sqrt(2) / 2 - prefer diagonal link to square path.
return converter.ClosestValidMacro(
{ base::asserted_cast<MaxspeedType>(std::lround(s.GetForward() * 0.85)), s.GetUnits() });
{ base::asserted_cast<MaxspeedType>(std::lround(s.GetForward() * kLinkToMainSpeedFactor)), s.GetUnits() });
}
return {};
@@ -265,8 +283,16 @@ public:
});
}
private:
void AddSpeed(uint32_t featureID, uint64_t osmID, Maxspeed const & speed)
{
MaxspeedType constexpr kMaxReasonableSpeed = 280;
if ((speed.GetSpeedKmPH(true) >= kMaxReasonableSpeed) ||
(speed.IsBidirectional() && speed.GetSpeedKmPH(false) >= kMaxReasonableSpeed))
{
LOG(LWARNING, (m_logTag, "Very big speed", speed, "for way", osmID));
}
// Add converted macro speed.
SpeedInUnits const forward(speed.GetForward(), speed.GetUnits());
CHECK(forward.IsValid(), ());
@@ -278,12 +304,12 @@ public:
if (ftSpeed.m_forward == SpeedMacro::Undefined)
{
LOG(LWARNING, ("Undefined forward speed macro", forward, "for way", osmID));
LOG(LWARNING, (m_logTag, "Undefined forward speed macro", forward, "for way", osmID));
return;
}
if (backward.IsValid() && backwardMacro == SpeedMacro::Undefined)
{
LOG(LWARNING, ("Undefined backward speed macro", backward, "for way", osmID));
LOG(LWARNING, (m_logTag, "Undefined backward speed macro", backward, "for way", osmID));
}
m_maxspeeds.push_back(ftSpeed);
@@ -311,36 +337,167 @@ public:
}
}
else
LOG(LWARNING, ("Undefined HighwayType for way", osmID));
LOG(LWARNING, (m_logTag, "Undefined HighwayType for way", osmID));
}
void SerializeMaxspeeds() const
public:
void CalculateDefaultTypeSpeeds(MaxspeedsSerializer::HW2SpeedMap typeSpeeds[])
{
if (m_maxspeeds.empty())
return;
MaxspeedsSerializer::HW2SpeedMap typeSpeeds[SPEEDS_COUNT];
for (int ind = 0; ind < SPEEDS_COUNT; ++ind)
std::vector<std::pair<HighwayType, InOutCitySpeedKMpH>> baseSpeeds(
kHighwayBasedSpeeds.begin(), kHighwayBasedSpeeds.end());
// Remove links, because they don't conform speed consistency.
baseSpeeds.erase(std::remove_if(baseSpeeds.begin(), baseSpeeds.end(), [](auto const & e)
{
LOG(LINFO, ("Average speeds", ind == 0 ? "outside" : "inside", "a city:"));
return (e.first == HighwayType::HighwayMotorwayLink ||
e.first == HighwayType::HighwayTrunkLink ||
e.first == HighwayType::HighwayPrimaryLink ||
e.first == HighwayType::HighwaySecondaryLink ||
e.first == HighwayType::HighwayTertiaryLink);
}), baseSpeeds.end());
for (int ind = 0; ind < kSpeedsCount; ++ind)
{
// Calculate average speed.
for (auto & e : m_avgSpeeds[ind])
{
// Check some reasonable conditions when assigning average speed.
if (e.second.m_lengthKM > kMinDefSpeedRoadsLengthKm)
{
auto const speed = e.second.m_lengthKM / e.second.m_timeH;
if (speed < kMaxPossibleDefSpeedKmH)
e.second.m_speed = speed;
}
}
// Prepare ethalon vector.
bool const inCity = ind != kOutsideCityIdx;
std::sort(baseSpeeds.begin(), baseSpeeds.end(), [inCity](auto const & l, auto const & r)
{
// Sort from biggest to smallest.
return r.second.GetSpeed(inCity).m_weight < l.second.GetSpeed(inCity).m_weight;
});
// First of all check that calculated speed and base speed difference is less than 2x.
for (auto const & e : baseSpeeds)
{
auto & l = m_avgSpeeds[ind][e.first];
if (l.m_speed > 0)
{
double const base = e.second.GetSpeed(inCity).m_weight;
double const factor = l.m_speed / base;
if (factor > 2 || factor < 0.5)
{
LOG(LWARNING, (m_logTag, "More than 2x diff:", e.first, l.m_speed, base));
l.m_speed = -1;
}
}
}
// Check speed's pairs consistency.
// Constraints from the previous iteration can be broken if we modify l-speed on the next iteration.
for (size_t il = 0, ir = 1; ir < baseSpeeds.size(); ++ir)
{
auto & l = m_avgSpeeds[ind][baseSpeeds[il].first];
if (l.m_speed < 0)
{
++il;
continue;
}
auto & r = m_avgSpeeds[ind][baseSpeeds[ir].first];
if (r.m_speed < 0)
continue;
// |l| should be greater than |r|
if (l.m_speed < r.m_speed)
{
LOG(LWARNING, (m_logTag, "Bad def speeds pair:", baseSpeeds[il].first, baseSpeeds[ir].first, l, r));
if (l.m_lengthKM >= r.m_lengthKM)
r.m_speed = l.m_speed;
else
l.m_speed = r.m_speed;
}
il = ir;
}
auto const getSpeed = [this, ind, inCity](HighwayType type)
{
auto const s = m_avgSpeeds[ind][type].m_speed;
if (s > 0)
return s;
auto const * p = kHighwayBasedSpeeds.Find(type);
CHECK(p, ());
return p->GetSpeed(inCity).m_weight;
};
// These speeds: Primary, Secondary, Tertiary, Residential have the biggest routing quality impact.
{
double const primaryS = getSpeed(HighwayType::HighwayPrimary);
double const secondaryS = getSpeed(HighwayType::HighwaySecondary);
double const tertiaryS = getSpeed(HighwayType::HighwayTertiary);
double const residentialS = getSpeed(HighwayType::HighwayResidential);
double constexpr eps = 1.0;
if (primaryS + eps < secondaryS || secondaryS + eps < tertiaryS || tertiaryS + eps < residentialS)
{
LOG(LWARNING, (m_logTag, "Ignore primary, secondary, tertiary, residential speeds:",
primaryS, secondaryS, tertiaryS, residentialS));
m_avgSpeeds[ind][HighwayType::HighwayPrimary].m_speed = -1;
m_avgSpeeds[ind][HighwayType::HighwaySecondary].m_speed = -1;
m_avgSpeeds[ind][HighwayType::HighwayTertiary].m_speed = -1;
m_avgSpeeds[ind][HighwayType::HighwayResidential].m_speed = -1;
}
}
// Update links.
std::pair<HighwayType, HighwayType> arrLinks[] = {
{HighwayType::HighwayMotorway, HighwayType::HighwayMotorwayLink},
{HighwayType::HighwayTrunk, HighwayType::HighwayTrunkLink},
{HighwayType::HighwayPrimary, HighwayType::HighwayPrimaryLink},
{HighwayType::HighwaySecondary, HighwayType::HighwaySecondaryLink},
{HighwayType::HighwayTertiary, HighwayType::HighwayTertiaryLink},
};
for (auto const & e : arrLinks)
{
auto const main = m_avgSpeeds[ind][e.first].m_speed;
auto & link = m_avgSpeeds[ind][e.second].m_speed;
if (main > 0)
link = kLinkToMainSpeedFactor * main;
else
link = -1;
}
// Fill type-speed map.
LOG(LINFO, ("Average speeds", ind == kOutsideCityIdx ? "outside" : "inside", "a city:"));
for (auto const & e : m_avgSpeeds[ind])
{
long const speed = std::lround(e.second.m_lengthKM / e.second.m_timeH);
if (speed < routing::kInvalidSpeed)
if (e.second.m_speed > 0)
{
// Store type speeds in Metric system, like VehicleModel profiles.
auto const speedInUnits = m_converter.ClosestValidMacro(
{ static_cast<MaxspeedType>(speed), measurement_utils::Units::Metric });
{ static_cast<MaxspeedType>(e.second.m_speed), measurement_utils::Units::Metric });
LOG(LINFO, ("*", e.first, "=", speedInUnits));
typeSpeeds[ind][e.first] = m_converter.SpeedToMacro(speedInUnits);
}
else
LOG(LWARNING, ("Large average speed for", e.first, "=", speed));
}
}
}
void SerializeMaxspeeds()
{
if (m_maxspeeds.empty())
return;
MaxspeedsSerializer::HW2SpeedMap typeSpeeds[kSpeedsCount];
/// @todo There are too many claims/bugs with Turkey calculated defaults.
/// And yes, now this dummy country check :)
if (m_dataPath.find("Turkey_") == std::string::npos)
CalculateDefaultTypeSpeeds(typeSpeeds);
// Serialize speeds.
FilesContainerW cont(m_dataPath, FileWriter::OP_WRITE_EXISTING);
auto writer = cont.GetWriter(MAXSPEEDS_FILE_TAG);
MaxspeedsSerializer::Serialize(m_maxspeeds, typeSpeeds, *writer);

View File

@@ -4,14 +4,10 @@
#include "routing_common/maxspeed_conversion.hpp"
#include "platform/measurement_utils.hpp"
#include "base/geo_object_id.hpp"
#include <cstdint>
#include <map>
#include <string>
#include <vector>
namespace routing
{

View File

@@ -209,7 +209,11 @@ void RelationTagsWay::Process(RelationElement const & e)
continue;
// Do not pass "ref" tags from boundaries and other, non-route relations to highways.
if (p.first == "ref" && isHighway)
if (isHighway && p.first == "ref")
continue;
// https://github.com/organicmaps/organicmaps/issues/8246
if (type == "route" && (p.first == "oneway" || p.first == "surface"))
continue;
Base::AddCustomTag(p);

View File

@@ -2,72 +2,116 @@
#include "routing/routing_helpers.hpp"
#include "indexer/classificator.hpp"
#include "indexer/classificator_loader.hpp"
#include "indexer/feature.hpp"
#include "indexer/feature_altitude.hpp"
#include "indexer/feature_data.hpp"
#include "indexer/feature_processor.hpp"
#include "geometry/distance_on_sphere.hpp"
#include "geometry/mercator.hpp"
#include "geometry/point_with_altitude.hpp"
#include "platform/country_file.hpp"
#include "platform/local_country_file.hpp"
#include "platform/local_country_file_utils.hpp"
#include "platform/platform.hpp"
#include "base/logging.hpp"
#include <cstddef>
#include <cstdint>
#include <limits>
#include <iostream>
#include <mutex>
#include <vector>
#include <gflags/gflags.h>
DEFINE_string(srtm_path, "", "Path to directory with SRTM files");
DEFINE_string(mwm_path, "", "Path to mwm files (writable dir)");
DEFINE_bool(check_dist, false, "Check feature sections distance");
int main(int argc, char * argv[])
class SafeTileManager
{
gflags::SetUsageMessage("SRTM coverage checker.");
gflags::ParseCommandLineFlags(&argc, &argv, true);
generator::SrtmTileManager m_manager;
std::mutex m_mutex;
Platform & platform = GetPlatform();
if (!FLAGS_mwm_path.empty())
platform.SetWritableDirForTests(FLAGS_mwm_path);
uint32_t m_ferry;
if (FLAGS_srtm_path.empty())
public:
explicit SafeTileManager(std::string const & dir) : m_manager(dir)
{
LOG(LERROR, ("SRTM files directory is not specified."));
return -1;
m_ferry = classif().GetTypeByPath({"route", "ferry"});
CHECK(m_ferry != Classificator::INVALID_TYPE, ());
}
LOG(LINFO, ("writable dir =", platform.WritableDir()));
LOG(LINFO, ("srtm dir =", FLAGS_srtm_path));
bool IsAltitudeRoad(FeatureType & ft) const
{
feature::TypesHolder types(ft);
return (routing::IsRoad(types) && !types.Has(m_ferry));
}
geometry::Altitude GetAltitude(ms::LatLon const & coord)
{
std::lock_guard guard(m_mutex);
return m_manager.GetAltitude(coord);
}
void Purge()
{
std::lock_guard guard(m_mutex);
m_manager.Purge();
}
};
template <class FnT> void ForEachMWM(SafeTileManager & manager, FnT && fn)
{
std::vector<platform::LocalCountryFile> localFiles;
FindAllLocalMapsAndCleanup(std::numeric_limits<int64_t>::max() /* latestVersion */, localFiles);
generator::SrtmTileManager manager(FLAGS_srtm_path);
classificator::Load();
// Better use ComputationalThreadPool, but we want to call SafeTileManager::Purge after each batch.
size_t constexpr kThreadsCount = 24;
std::vector<std::thread> pool;
size_t workers = 0;
for (auto & file : localFiles)
{
// Skip worlds.
if (file.GetDirectory().empty() || file.GetCountryName().starts_with("World"))
continue;
file.SyncWithDisk();
if (!file.OnDisk(MapFileType::Map))
{
LOG(LINFO, ("Warning! Routing file not found for:", file.GetCountryName()));
LOG_SHORT(LWARNING, ("Map file not found for:", file.GetCountryName()));
continue;
}
auto const path = file.GetPath(MapFileType::Map);
LOG(LINFO, ("Mwm", path, "is being processed."));
LOG_SHORT(LINFO, ("Processing", file.GetCountryName()));
pool.emplace_back([&fn, &file]() { fn(file); });
if (++workers == kThreadsCount)
{
for (auto & t : pool)
t.join();
pool.clear();
manager.Purge();
workers = 0;
}
}
for (auto & t : pool)
t.join();
}
void CheckCoverage(SafeTileManager & manager)
{
ForEachMWM(manager, [&](platform::LocalCountryFile const & file)
{
size_t all = 0;
size_t good = 0;
feature::ForEachFeature(path, [&](FeatureType & ft, uint32_t fid) {
if (!routing::IsRoad(feature::TypesHolder(ft)))
feature::ForEachFeature(file.GetPath(MapFileType::Map), [&](FeatureType & ft, uint32_t)
{
if (!manager.IsAltitudeRoad(ft))
return;
ft.ParseGeometry(FeatureType::BEST_GEOMETRY);
@@ -75,16 +119,136 @@ int main(int argc, char * argv[])
for (size_t i = 0; i < ft.GetPointsCount(); ++i)
{
auto const height = manager.GetHeight(mercator::ToLatLon(ft.GetPoint(i)));
auto const height = manager.GetAltitude(mercator::ToLatLon(ft.GetPoint(i)));
if (height != geometry::kInvalidAltitude)
good++;
}
});
auto const bad = all - good;
auto const percent = all == 0 ? 0.0 : bad * 100.0 / all;
LOG(LINFO, (percent > 10.0 ? "Huge" : "Low", "error rate in:", file.GetCountryName(),
"good:", good, "bad:", bad, "all:", all, "%:", percent));
auto const percent = (all == 0) ? 0.0 : bad * 100.0 / all;
LOG_SHORT(LINFO, (percent > 10.0 ? "Huge" : "Low", "error rate in:", file.GetCountryName(),
"good:", good, "bad:", bad, "all:", all, "%:", percent));
});
}
void CheckDistance(SafeTileManager & manager)
{
ForEachMWM(manager, [&](platform::LocalCountryFile const & file)
{
size_t all = 0;
size_t added = 0;
size_t invalid = 0;
feature::ForEachFeature(file.GetPath(MapFileType::Map), [&](FeatureType & ft, uint32_t)
{
if (!manager.IsAltitudeRoad(ft))
return;
ft.ParseGeometry(FeatureType::BEST_GEOMETRY);
all += ft.GetPointsCount();
for (size_t i = 1; i < ft.GetPointsCount(); ++i)
{
auto const ll1 = mercator::ToLatLon(ft.GetPoint(i-1));
auto const alt1 = manager.GetAltitude(ll1);
auto const ll2 = mercator::ToLatLon(ft.GetPoint(i));
auto const alt2 = manager.GetAltitude(ll2);
if (alt1 == geometry::kInvalidAltitude || alt2 == geometry::kInvalidAltitude)
{
++invalid;
continue;
}
// Divide by 1 second sections.
size_t const sections = std::round(ms::DistanceOnSphere(ll1.m_lat, ll1.m_lon, ll2.m_lat, ll2.m_lon) * 3600);
if (sections < 2)
continue;
for (size_t j = 1; j < sections; ++j)
{
double const a = j / double(sections);
ms::LatLon const ll(ll2.m_lat * a + ll1.m_lat * (1 - a), ll2.m_lon * a + ll1.m_lon * (1 - a));
// Get diff between approx altitude and real one.
auto const alt = manager.GetAltitude(ll);
if (alt == geometry::kInvalidAltitude)
{
LOG_SHORT(LWARNING, ("Invalid altitude for the middle point:", ll));
++added;
}
else
{
auto const approxAlt = static_cast<geometry::Altitude>(std::round(alt2 * a + alt1 * (1 - a)));
if (abs(alt - approxAlt) >= std::max(1, abs(alt)/10)) // 10%
++added;
}
}
}
});
auto const percent = added * 100.0 / all;
std::string prefix = "Low";
if (percent >= 1)
prefix = "Huge";
else if (added >= 1000)
prefix = "Medium";
LOG_SHORT(LINFO, (prefix, file.GetCountryName(), "all:", all, "invalid:", invalid, "added:", added, "%:", percent));
});
}
int main(int argc, char * argv[])
{
gflags::SetUsageMessage("SRTM coverage checker.");
gflags::ParseCommandLineFlags(&argc, &argv, true);
if (FLAGS_srtm_path.empty())
{
LOG_SHORT(LERROR, ("SRTM files directory is not specified."));
return -1;
}
classificator::Load();
if (!FLAGS_mwm_path.empty())
{
SafeTileManager manager(FLAGS_srtm_path);
Platform & platform = GetPlatform();
platform.SetWritableDirForTests(FLAGS_mwm_path);
if (FLAGS_check_dist)
CheckDistance(manager);
else
CheckCoverage(manager);
}
else
{
generator::SrtmTileManager manager(FLAGS_srtm_path);
using namespace std;
cout << "Enter lat lon. Or Ctrl + C to exit." << endl;
while (true)
{
double lat, lon;
cin >> lat >> lon;
if (!cin)
{
cout << "Invalid lat lon." << endl;
cin.clear();
cin.ignore(10000, '\n');
}
else
{
auto const & tile = manager.GetTile({lat, lon});
cout << "H = " << tile.GetHeight({lat, lon}) <<
"; Trg = " << tile.GetTriangleHeight({lat, lon}) <<
"; Bilinear = " << tile.GetBilinearHeight({lat, lon});
cout << endl;
}
}
}
return 0;

View File

@@ -16,15 +16,21 @@ namespace generator
{
namespace
{
size_t constexpr kArcSecondsInDegree = 60 * 60;
int constexpr kArcSecondsInDegree = 60 * 60;
size_t constexpr kSrtmTileSize = (kArcSecondsInDegree + 1) * (kArcSecondsInDegree + 1) * 2;
struct UnzipMemDelegate : public ZipFileReader::Delegate
{
explicit UnzipMemDelegate(std::string & buffer) : m_buffer(buffer), m_completed(false) {}
explicit UnzipMemDelegate(std::vector<uint8_t> & buffer) : m_buffer(buffer), m_completed(false)
{
m_buffer.reserve(kSrtmTileSize);
}
// ZipFileReader::Delegate overrides:
void OnBlockUnzipped(size_t size, char const * data) override { m_buffer.append(data, size); }
void OnBlockUnzipped(size_t size, char const * data) override
{
m_buffer.insert(m_buffer.end(), data, data + size);
}
void OnStarted() override
{
@@ -34,7 +40,7 @@ struct UnzipMemDelegate : public ZipFileReader::Delegate
void OnCompleted() override { m_completed = true; }
std::string & m_buffer;
std::vector<uint8_t> & m_buffer;
bool m_completed;
};
@@ -45,11 +51,6 @@ std::string GetSrtmContFileName(std::string const & dir, std::string const & bas
} // namespace
// SrtmTile ----------------------------------------------------------------------------------------
SrtmTile::SrtmTile()
{
Invalidate();
}
SrtmTile::SrtmTile(SrtmTile && rhs) : m_data(std::move(rhs.m_data)), m_valid(rhs.m_valid)
{
rhs.Invalidate();
@@ -90,7 +91,7 @@ void SrtmTile::Init(std::string const & dir, ms::LatLon const & coord)
}
else
{
GetPlatform().GetReader(file)->ReadAsString(m_data);
m_data = base::ReadFile(base::JoinPath(dir, file));
}
if (m_data.size() != kSrtmTileSize)
@@ -103,11 +104,9 @@ void SrtmTile::Init(std::string const & dir, ms::LatLon const & coord)
m_valid = true;
}
geometry::Altitude SrtmTile::GetHeight(ms::LatLon const & coord) const
// static
ms::LatLon SrtmTile::GetCoordInSeconds(ms::LatLon const & coord)
{
if (!IsValid())
return geometry::kInvalidAltitude;
double ln = coord.m_lon - static_cast<int>(coord.m_lon);
if (ln < 0)
ln += 1;
@@ -116,15 +115,98 @@ geometry::Altitude SrtmTile::GetHeight(ms::LatLon const & coord) const
lt += 1;
lt = 1 - lt; // from North to South
auto const row = static_cast<size_t>(std::round(kArcSecondsInDegree * lt));
auto const col = static_cast<size_t>(std::round(kArcSecondsInDegree * ln));
return { kArcSecondsInDegree * lt, kArcSecondsInDegree * ln };
}
geometry::Altitude SrtmTile::GetHeight(ms::LatLon const & coord) const
{
if (!IsValid())
return geometry::kInvalidAltitude;
auto const ll = GetCoordInSeconds(coord);
return GetHeightRC(static_cast<size_t>(std::round(ll.m_lat)), static_cast<size_t>(std::round(ll.m_lon)));
}
geometry::Altitude SrtmTile::GetHeightRC(size_t row, size_t col) const
{
size_t const ix = row * (kArcSecondsInDegree + 1) + col;
CHECK_LESS(ix, Size(), (coord));
CHECK_LESS(ix, Size(), (row, col));
return ReverseByteOrder(Data()[ix]);
}
double SrtmTile::GetTriangleHeight(ms::LatLon const & coord) const
{
if (!IsValid())
return geometry::kInvalidAltitude;
auto const ll = GetCoordInSeconds(coord);
m2::Point<int> const p1(static_cast<int>(std::round(ll.m_lon)), static_cast<int>(std::round(ll.m_lat)));
auto p2 = p1;
if (p2.x > ll.m_lon)
{
if (p2.x > 0)
--p2.x;
}
else if (p2.x < ll.m_lon)
{
if (p2.x < kArcSecondsInDegree)
++p2.x;
}
auto p3 = p1;
if (p3.y > ll.m_lat)
{
if (p3.y > 0)
--p3.y;
}
else if (p3.y < ll.m_lat)
{
if (p3.y < kArcSecondsInDegree)
++p3.y;
}
// Approximate height from triangle p1, p2, p3.
// p1.y == p2.y; p1.x == p3.x
// https://stackoverflow.com/questions/36090269/finding-height-of-point-on-height-map-triangles
int const det = (p2.y - p3.y) * (p1.x - p3.x) + (p3.x - p2.x) * (p1.y - p3.y);
if (det == 0)
return GetHeightRC(p1.y, p1.x);
double const a1 = ((p2.y - p3.y) * (ll.m_lon - p3.x) + (p3.x - p2.x) * (ll.m_lat - p3.y)) / det;
double const a2 = ((p3.y - p1.y) * (ll.m_lon - p3.x) + (p1.x - p3.x) * (ll.m_lat - p3.y)) / det;
double const a3 = 1 - a1 - a2;
return a1 * GetHeightRC(p1.y, p1.x) + a2 * GetHeightRC(p2.y, p2.x) + a3 * GetHeightRC(p3.y, p3.x);
}
double SrtmTile::GetBilinearHeight(ms::LatLon const & coord) const
{
if (!IsValid())
return geometry::kInvalidAltitude;
auto const ll = GetCoordInSeconds(coord);
m2::Point<int> const p1(static_cast<int>(ll.m_lon), static_cast<int>(ll.m_lat));
auto p2 = p1;
if (p2.x < kArcSecondsInDegree)
++p2.x;
if (p2.y < kArcSecondsInDegree)
++p2.y;
// https://en.wikipedia.org/wiki/Bilinear_interpolation
double const denom = (p2.x - p1.x) * (p2.y - p1.y);
if (denom == 0)
return GetHeightRC(p1.y, p1.x);
return (GetHeightRC(p1.y, p1.x) * (p2.x - ll.m_lon) * (p2.y - ll.m_lat) +
GetHeightRC(p1.y, p2.x) * (ll.m_lon - p1.x) * (p2.y - ll.m_lat) +
GetHeightRC(p2.y, p1.x) * (p2.x - ll.m_lon) * (ll.m_lat - p1.y) +
GetHeightRC(p2.y, p2.x) * (ll.m_lon - p1.x) * (ll.m_lat - p1.y)) / denom;
}
// static
std::string SrtmTile::GetPath(std::string const & dir, std::string const & base)
{
@@ -132,42 +214,52 @@ std::string SrtmTile::GetPath(std::string const & dir, std::string const & base)
}
// static
ms::LatLon SrtmTile::GetCenter(ms::LatLon const & coord)
SrtmTile::LatLonKey SrtmTile::GetKey(ms::LatLon const & coord)
{
return {floor(coord.m_lat) + 0.5, floor(coord.m_lon) + 0.5};
ms::LatLon center{floor(coord.m_lat) + 0.5, floor(coord.m_lon) + 0.5};
if (coord.m_lat < 0)
center.m_lat -= 1.0;
if (coord.m_lon < 0)
center.m_lon -= 1.0;
return {static_cast<int32_t>(center.m_lat), static_cast<int32_t>(center.m_lon)};
}
// static
std::string SrtmTile::GetBase(ms::LatLon const & coord)
{
auto center = GetCenter(coord);
auto key = GetKey(coord);
std::ostringstream ss;
if (center.m_lat < 0)
if (coord.m_lat < 0)
{
ss << "S";
center.m_lat *= -1;
center.m_lat += 1;
key.first = -key.first;
}
else
{
ss << "N";
}
ss << std::setw(2) << std::setfill('0') << static_cast<int>(center.m_lat);
if (center.m_lon < 0)
ss << std::setw(2) << std::setfill('0') << key.first;
if (coord.m_lon < 0)
{
ss << "W";
center.m_lon *= -1;
center.m_lon += 1;
key.second = -key.second;
}
else
{
ss << "E";
}
ss << std::setw(3) << static_cast<int>(center.m_lon);
ss << std::setw(3) << key.second;
return ss.str();
}
geometry::Altitude * SrtmTile::DataForTests(size_t & sz)
{
m_valid = true;
sz = kArcSecondsInDegree + 1;
m_data.resize(kSrtmTileSize, 0);
return reinterpret_cast<geometry::Altitude *>(m_data.data());
}
void SrtmTile::Invalidate()
{
m_data.clear();
@@ -176,47 +268,27 @@ void SrtmTile::Invalidate()
}
// SrtmTileManager ---------------------------------------------------------------------------------
SrtmTileManager::SrtmTileManager(std::string const & dir) : m_dir(dir) {}
geometry::Altitude SrtmTileManager::GetHeight(ms::LatLon const & coord)
SrtmTile const & SrtmTileManager::GetTile(ms::LatLon const & coord)
{
auto const key = GetKey(coord);
auto it = m_tiles.find(key);
if (it == m_tiles.end())
auto res = m_tiles.emplace(SrtmTile::GetKey(coord), SrtmTile());
if (res.second)
{
SrtmTile tile;
try
{
tile.Init(m_dir, coord);
res.first->second.Init(m_dir, coord);
}
catch (RootException const & e)
{
std::string const base = SrtmTile::GetBase(coord);
LOG(LINFO, ("Can't init SRTM tile:", base, "reason:", e.Msg()));
}
// It's OK to store even invalid tiles and return invalid height
// for them later.
it = m_tiles.emplace(key, std::move(tile)).first;
}
return it->second.GetHeight(coord);
return res.first->second;
}
// static
SrtmTileManager::LatLonKey SrtmTileManager::GetKey(ms::LatLon const & coord)
void SrtmTileManager::Purge()
{
auto const tileCenter = SrtmTile::GetCenter(coord);
return {static_cast<int32_t>(tileCenter.m_lat), static_cast<int32_t>(tileCenter.m_lon)};
MapT().swap(m_tiles);
}
SrtmTile const & SrtmTileManager::GetTile(ms::LatLon const & coord)
{
// Touch the tile to force its loading.
GetHeight(coord);
auto const key = GetKey(coord);
auto const it = m_tiles.find(key);
CHECK(it != m_tiles.end(), (coord));
return it->second;
}
} // namespace generator

View File

@@ -2,44 +2,67 @@
#include "geometry/latlon.hpp"
#include "indexer/feature_altitude.hpp"
#include "geometry/point_with_altitude.hpp"
#include "base/macros.hpp"
#include <boost/container_hash/hash.hpp>
#include <cstdint>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
namespace generator
{
class SrtmTile
{
public:
SrtmTile();
SrtmTile() : m_valid(false) {}
SrtmTile(SrtmTile && rhs);
void Init(std::string const & dir, ms::LatLon const & coord);
inline bool IsValid() const { return m_valid; }
// Returns height in meters at |coord| or kInvalidAltitude.
/// @return Height in meters at |coord| or kInvalidAltitude.
/// @{
/// Nearest serialized height.
geometry::Altitude GetHeight(ms::LatLon const & coord) const;
/// Triangle interpolation.
double GetTriangleHeight(ms::LatLon const & coord) const;
/// Bilinear interpolation.
double GetBilinearHeight(ms::LatLon const & coord) const;
geometry::Altitude GetAltitude(ms::LatLon const & coord) const
{
return static_cast<geometry::Altitude>(std::round(GetBilinearHeight(coord)));
}
/// @}
using LatLonKey = std::pair<int32_t, int32_t>;
static LatLonKey GetKey(ms::LatLon const & coord);
static std::string GetBase(ms::LatLon const & coord);
static ms::LatLon GetCenter(ms::LatLon const & coord);
static std::string GetPath(std::string const & dir, std::string const & base);
/// Used in unit tests only to prepare mock tile.
geometry::Altitude * DataForTests(size_t & sz);
private:
static ms::LatLon GetCoordInSeconds(ms::LatLon const & coord);
geometry::Altitude GetHeightRC(size_t row, size_t col) const;
inline geometry::Altitude const * Data() const
{
return reinterpret_cast<geometry::Altitude const *>(m_data.data());
};
}
inline size_t Size() const { return m_data.size() / sizeof(geometry::Altitude); }
void Invalidate();
std::string m_data;
std::vector<uint8_t> m_data;
bool m_valid;
DISALLOW_COPY(SrtmTile);
@@ -48,27 +71,35 @@ private:
class SrtmTileManager
{
public:
explicit SrtmTileManager(std::string const & dir);
geometry::Altitude GetHeight(ms::LatLon const & coord);
explicit SrtmTileManager(std::string const & dir) : m_dir(dir) {}
SrtmTile const & GetTile(ms::LatLon const & coord);
private:
using LatLonKey = std::pair<int32_t, int32_t>;
static LatLonKey GetKey(ms::LatLon const & coord);
geometry::Altitude GetAltitude(ms::LatLon const & coord)
{
return GetTile(coord).GetAltitude(coord);
}
size_t GeTilesNumber() const { return m_tiles.size(); }
void Purge();
private:
std::string m_dir;
struct Hash
{
size_t operator()(LatLonKey const & key) const
size_t operator()(SrtmTile::LatLonKey const & key) const
{
return (static_cast<size_t>(key.first) << 32u) | static_cast<size_t>(key.second);
size_t seed = 0;
boost::hash_combine(seed, key.first);
boost::hash_combine(seed, key.second);
return seed;
}
};
std::unordered_map<LatLonKey, SrtmTile, Hash> m_tiles;
using MapT = std::unordered_map<SrtmTile::LatLonKey, SrtmTile, Hash>;
MapT m_tiles;
DISALLOW_COPY(SrtmTileManager);
};

View File

@@ -24,6 +24,7 @@
#include <vector>
#define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED
#define BOOST_STACKTRACE_USE_ADDR2LINE
#include <boost/stacktrace.hpp>
namespace generator

View File

@@ -55,10 +55,10 @@ void WikiUrlDumper::Dump(size_t cpuCount) const
// static
void WikiUrlDumper::DumpOne(std::string const & path, std::ostream & stream)
{
auto const & needWikiUrl = ftypes::AttractionsChecker::Instance();
//auto const & needWikiUrl = ftypes::AttractionsChecker::Instance();
feature::ForEachFeatureRawFormat(path, [&](FeatureBuilder const & feature, uint64_t /* pos */) {
if (!needWikiUrl(feature.GetTypesHolder()))
return;
// if (!needWikiUrl(feature.GetTypesHolder()))
// return;
auto const wikiUrl = feature.GetMetadata().GetWikiURL();
if (wikiUrl.empty())
@@ -89,10 +89,10 @@ WikiDataFilter::WikiDataFilter(std::string const & path, std::vector<std::string
void WikiDataFilter::FilterOne(std::string const & path, std::map<base::GeoObjectId, std::string> const & idToWikiData,
std::ostream & stream)
{
auto const & needWikiUrl = ftypes::AttractionsChecker::Instance();
//auto const & needWikiUrl = ftypes::AttractionsChecker::Instance();
feature::ForEachFeatureRawFormat(path, [&](FeatureBuilder const & feature, uint64_t /* pos */) {
if (!needWikiUrl(feature.GetTypesHolder()))
return;
// if (!needWikiUrl(feature.GetTypesHolder()))
// return;
auto const it = idToWikiData.find(feature.GetMostGenericOsmId());
if (it == std::end(idToWikiData))

View File

@@ -62,8 +62,12 @@ UNIT_TEST(Segment_Smoke)
TEST(!OnSegment(P(10 + eps, 10), ps), ());
TEST(!OnSegment(P(0, 0), ps), ());
}
}
// Paranoid tests.
// This paranoid test doesn' work with Release optimizations (LTO?).
#ifndef NDEBUG
UNIT_TEST(Segment_Paranoid)
{
{
P ps[] = {{0, 0}, {1e100, 1e100}};
TEST(OnSegment(ps[0], ps), ());
@@ -94,6 +98,7 @@ UNIT_TEST(Segment_Smoke)
TEST(!OnSegment(P(1e-16, 2.0 * 1e-16), ps), ());
}
}
#endif
UNIT_TEST(Triangle_Smoke)
{
@@ -129,6 +134,8 @@ UNIT_TEST(Triangle_PointInsideSegment)
TEST(!InsideTriangle(P(eps, eps), ps), ());
}
// This paranoid test doesn' work with Release optimizations (LTO?).
#ifndef NDEBUG
UNIT_TEST(Triangle_PointInsidePoint)
{
double constexpr eps = 1.0E-10;
@@ -147,6 +154,7 @@ UNIT_TEST(Triangle_PointInsidePoint)
TEST(!InsideTriangle(P(eps, eps), ps), ());
#endif
}
#endif
UNIT_TEST(PolygonSelfIntersections_IntersectSmoke)
{

View File

@@ -12,15 +12,38 @@ using namespace std;
using m2::Spline;
using m2::PointD;
namespace
{
double constexpr kAlmostZero = 1.0E-16;
void TestEqual(double x, double y)
{
if (fabs(x) < kAlmostZero || fabs(y) < kAlmostZero)
TEST_ALMOST_EQUAL_ABS(x, y, kAlmostZero, ());
else
TEST_ALMOST_EQUAL_ULPS(x, y, ());
}
void TestPointDDir(PointD const & dst, PointD const & src)
{
double const len1 = dst.Length();
double const len2 = src.Length();
TEST_ALMOST_EQUAL_ULPS(dst.x/len1, src.x/len2, ());
TEST_ALMOST_EQUAL_ULPS(dst.y/len1, src.y/len2, ());
if (len1 < kAlmostZero || len2 < kAlmostZero)
{
TestEqual(dst.x, src.x);
TestEqual(dst.y, src.y);
}
else
{
TestEqual(dst.x/len1, src.x/len2);
TestEqual(dst.y/len1, src.y/len2);
}
}
UNIT_TEST(SmoothedDirections)
} // namespace
UNIT_TEST(Spline_SmoothedDirections)
{
vector<PointD> path;
path.push_back(PointD(0, 0));

Some files were not shown because too many files have changed in this diff Show More