Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2018-04-09 20:40:11 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2018-04-11 14:27:47 +0300
commit0dc0baa25593b462517e0a8e603154dcd917cdc5 (patch)
tree93452601558bbb6260e55962ba5360ebda8699ee
parentb333719087bbe70c2e3d6ec03151b131670e2d26 (diff)
[coding] [geometry] Refactored geometry serialization.
This commit moves all the code related to geometry serialization from indexer/ and coding/ to a single place, namely coding/geometry_coding.{c,h}pp.
-rw-r--r--3party/osrm/osrm-backend/plugins/MapsMePlugin.hpp7
-rw-r--r--coding/CMakeLists.txt3
-rw-r--r--coding/coding_tests/CMakeLists.txt3
-rw-r--r--coding/coding_tests/geometry_coding_test.cpp (renamed from indexer/indexer_tests/geometry_coding_test.cpp)147
-rw-r--r--coding/coding_tests/geometry_serialization_test.cpp60
-rw-r--r--coding/coding_tests/point_to_integer_test.cpp18
-rw-r--r--coding/coding_tests/test_polylines.cpp (renamed from indexer/indexer_tests/test_polylines.cpp)6
-rw-r--r--coding/coding_tests/test_polylines.hpp9
-rw-r--r--coding/geometry_coding.cpp552
-rw-r--r--coding/geometry_coding.hpp367
-rw-r--r--coding/tesselator_decl.hpp27
-rw-r--r--coding/varint.hpp7
-rw-r--r--generator/borders_loader.cpp16
-rw-r--r--generator/centers_table_builder.cpp2
-rw-r--r--generator/dumper.cpp2
-rw-r--r--generator/feature_builder.cpp21
-rw-r--r--generator/feature_builder.hpp11
-rw-r--r--generator/feature_helpers.hpp5
-rw-r--r--generator/feature_sorter.cpp13
-rw-r--r--generator/generator_tests/triangles_tree_coding_test.cpp11
-rw-r--r--generator/geometry_holder.hpp6
-rw-r--r--generator/locality_sorter.cpp5
-rw-r--r--generator/routing_index_generator.cpp8
-rw-r--r--generator/search_index_builder.cpp2
-rw-r--r--generator/tesselator.cpp18
-rw-r--r--generator/tesselator.hpp4
-rw-r--r--indexer/CMakeLists.txt7
-rw-r--r--indexer/centers_table.cpp16
-rw-r--r--indexer/centers_table.hpp8
-rw-r--r--indexer/cities_boundaries_serdes.hpp23
-rw-r--r--indexer/coding_params.cpp31
-rw-r--r--indexer/coding_params.hpp51
-rw-r--r--indexer/data_header.cpp6
-rw-r--r--indexer/data_header.hpp13
-rw-r--r--indexer/feature_loader.cpp16
-rw-r--r--indexer/feature_loader_base.hpp20
-rw-r--r--indexer/geometry_coding.cpp276
-rw-r--r--indexer/geometry_coding.hpp110
-rw-r--r--indexer/geometry_serialization.cpp273
-rw-r--r--indexer/geometry_serialization.hpp227
-rw-r--r--indexer/indexer_tests/CMakeLists.txt5
-rw-r--r--indexer/indexer_tests/centers_table_test.cpp8
-rw-r--r--indexer/indexer_tests/cities_boundaries_serdes_tests.cpp2
-rw-r--r--indexer/indexer_tests/geometry_serialization_test.cpp69
-rw-r--r--indexer/indexer_tests/polyline_point_to_int64_test.cpp49
-rw-r--r--indexer/indexer_tests/test_polylines.hpp9
-rw-r--r--indexer/locality_object.cpp4
-rw-r--r--indexer/tesselator_decl.hpp26
-rw-r--r--qt/search_panel.cpp4
-rw-r--r--routing/cross_mwm_connector_serialization.hpp20
-rw-r--r--routing/routing_tests/cross_mwm_connector_test.cpp4
-rw-r--r--search/engine.cpp3
-rw-r--r--search/lazy_centers_table.cpp2
-rw-r--r--search/retrieval.cpp2
-rw-r--r--search/search_index_values.hpp10
-rw-r--r--search/search_integration_tests/downloader_search_test.cpp4
-rw-r--r--search/search_integration_tests/interactive_search_test.cpp2
-rw-r--r--search/search_tests_support/test_search_request.cpp6
-rw-r--r--search/search_trie.hpp7
-rw-r--r--storage/country_info_getter.cpp9
-rw-r--r--storage/country_polygon.hpp38
-rw-r--r--transit/transit_serdes.hpp7
-rw-r--r--xcode/coding/coding.xcodeproj/project.pbxproj24
-rw-r--r--xcode/indexer/indexer.xcodeproj/project.pbxproj54
64 files changed, 1331 insertions, 1444 deletions
diff --git a/3party/osrm/osrm-backend/plugins/MapsMePlugin.hpp b/3party/osrm/osrm-backend/plugins/MapsMePlugin.hpp
index 2248c961ac..8ad591839d 100644
--- a/3party/osrm/osrm-backend/plugins/MapsMePlugin.hpp
+++ b/3party/osrm/osrm-backend/plugins/MapsMePlugin.hpp
@@ -1,15 +1,14 @@
#pragma once
-#include "plugin_base.hpp"
#include "../../../../base/string_utils.hpp"
#include "../../../../coding/file_container.hpp"
#include "../../../../coding/read_write_utils.hpp"
#include "../../../../defines.hpp"
-#include "../../../../geometry/region2d.hpp"
-#include "../../../../indexer/geometry_serialization.hpp"
#include "../../../../geometry/mercator.hpp"
+#include "../../../../geometry/region2d.hpp"
#include "../../../../storage/country_decl.hpp"
#include "../../../../storage/country_polygon.hpp"
+#include "plugin_base.hpp"
#include "../algorithms/object_encoder.hpp"
#include "../data_structures/search_engine.hpp"
@@ -135,7 +134,7 @@ public:
for (size_t j = 0; j < count; ++j)
{
vector<m2::PointD> points;
- serial::LoadOuterPath(src, serial::CodingParams(), points);
+ serial::LoadOuterPath(src, serial::GeometryCodingParams(), points);
m_regions[i].emplace_back(move(m2::RegionD(points.begin(), points.end())));
}
diff --git a/coding/CMakeLists.txt b/coding/CMakeLists.txt
index f27d92d48d..87bfe831ef 100644
--- a/coding/CMakeLists.txt
+++ b/coding/CMakeLists.txt
@@ -40,6 +40,8 @@ set(
file_writer.cpp
file_writer.hpp
fixed_bits_ddvector.hpp
+ geometry_coding.cpp
+ geometry_coding.hpp
hex.cpp
hex.hpp
huffman.cpp
@@ -79,6 +81,7 @@ set(
streams_common.hpp
streams_sink.hpp
succinct_mapper.hpp
+ tesselator_decl.hpp
text_storage.hpp
traffic.cpp
traffic.hpp
diff --git a/coding/coding_tests/CMakeLists.txt b/coding/coding_tests/CMakeLists.txt
index 8e73fe4056..6955a79419 100644
--- a/coding/coding_tests/CMakeLists.txt
+++ b/coding/coding_tests/CMakeLists.txt
@@ -18,6 +18,7 @@ set(
file_sort_test.cpp
file_utils_test.cpp
fixed_bits_ddvector_test.cpp
+ geometry_coding_test.cpp
hex_test.cpp
huffman_test.cpp
mem_file_reader_test.cpp
@@ -32,6 +33,8 @@ set(
reader_writer_ops_test.cpp
simple_dense_coding_test.cpp
succinct_mapper_test.cpp
+ test_polylines.cpp
+ test_polylines.hpp
text_storage_tests.cpp
traffic_test.cpp
uri_test.cpp
diff --git a/indexer/indexer_tests/geometry_coding_test.cpp b/coding/coding_tests/geometry_coding_test.cpp
index f454e67c37..7d56444560 100644
--- a/indexer/indexer_tests/geometry_coding_test.cpp
+++ b/coding/coding_tests/geometry_coding_test.cpp
@@ -1,10 +1,9 @@
#include "testing/testing.hpp"
-#include "indexer/coding_params.hpp"
-#include "indexer/geometry_coding.hpp"
-#include "indexer/indexer_tests/test_polylines.hpp"
-
#include "coding/byte_stream.hpp"
+#include "coding/coding_tests/test_polylines.hpp"
+#include "coding/geometry_coding.hpp"
+#include "coding/point_to_integer.hpp"
#include "coding/pointd_to_pointu.hpp"
#include "coding/varint.hpp"
#include "coding/writer.hpp"
@@ -16,65 +15,9 @@
#include "base/logging.hpp"
-using PU = m2::PointU;
-
-UNIT_TEST(EncodeDelta)
-{
- for (int x = -100; x <= 100; ++x)
- {
- for (int y = -100; y <= 100; ++y)
- {
- PU orig = PU(100 + x, 100 + y);
- PU pred = PU(100, 100);
- TEST_EQUAL(orig, DecodeDelta(EncodeDelta(orig, pred), pred), ());
- vector<char> data;
- PushBackByteSink<vector<char> > sink(data);
- WriteVarUint(sink, EncodeDelta(orig, pred));
- size_t expectedSize = 1;
- if (x >= 8 || x < -8 || y >= 4 || y < -4) expectedSize = 2;
- if (x >= 64 || x < -64 || y >= 64 || y < -64) expectedSize = 3;
- TEST_EQUAL(data.size(), expectedSize, (x, y));
- }
- }
-}
-
-UNIT_TEST(PredictPointsInPolyline2)
-{
- // Ci = Ci-1 + (Ci-1 + Ci-2) / 2
- TEST_EQUAL(PU(5, 5), PredictPointInPolyline(PU(8, 7), PU(4, 4), PU(1, 2)), ());
-}
-
-UNIT_TEST(PredictPointsInPolyline2_ClampMax)
-{
- // Ci = Ci-1 + (Ci-1 + Ci-2) / 2
- TEST_EQUAL(PU(4, 4), PredictPointInPolyline(PU(4, 4), PU(4, 4), PU(1, 2)), ());
- TEST_EQUAL(PU(5, 5), PredictPointInPolyline(PU(8, 7), PU(4, 4), PU(1, 2)), ());
- TEST_EQUAL(PU(5, 5), PredictPointInPolyline(PU(5, 5), PU(4, 4), PU(1, 2)), ());
-}
-
-UNIT_TEST(PredictPointsInPolyline2_Clamp0)
-{
- TEST_EQUAL(PU(4, 0), PredictPointInPolyline(PU(5, 5), PU(4, 1), PU(4, 4)), ());
-}
-
-/*
-UNIT_TEST(PredictPointsInPolyline3_Square)
-{
- TEST_EQUAL(PU(5, 1), PredictPointInPolyline(PU(6, 6), PU(5, 4), PU(2, 4), PU(2, 1)), ());
- TEST_EQUAL(PU(5, 3), PredictPointInPolyline(PU(6, 6), PU(4, 1), PU(2, 2), PU(3, 4)), ());
-}
-
-UNIT_TEST(PredictPointsInPolyline3_SquareClamp0)
-{
- TEST_EQUAL(PU(5, 1), PredictPointInPolyline(PU(6, 6), PU(5, 4), PU(2, 4), PU(2, 1)), ());
- TEST_EQUAL(PU(4, 0), PredictPointInPolyline(PU(6, 6), PU(2, 0), PU(3, 2), PU(5, 1)), ());
-}
+using namespace coding;
-UNIT_TEST(PredictPointsInPolyline3_90deg)
-{
- TEST_EQUAL(PU(3, 2), PredictPointInPolyline(PU(8, 8), PU(3, 6), PU(1, 6), PU(1, 5)), ());
-}
-*/
+using PU = m2::PointU;
namespace
{
@@ -85,30 +28,30 @@ m2::PointU GetMaxPoint() { return D2U(m2::PointD(MercatorBounds::maxX, MercatorB
void TestPolylineEncode(string testName,
vector<m2::PointU> const & points,
m2::PointU const & maxPoint,
- void (* fnEncode)(geo_coding::InPointsT const & points,
+ void (* fnEncode)(InPointsT const & points,
m2::PointU const & basePoint,
m2::PointU const & maxPoint,
- geo_coding::OutDeltasT & deltas),
- void (* fnDecode)(geo_coding::InDeltasT const & deltas,
+ OutDeltasT & deltas),
+ void (* fnDecode)(InDeltasT const & deltas,
m2::PointU const & basePoint,
m2::PointU const & maxPoint,
- geo_coding::OutPointsT & points))
+ OutPointsT & points))
{
size_t const count = points.size();
if (count == 0) return;
- m2::PointU const basePoint = serial::CodingParams().GetBasePoint();
+ m2::PointU const basePoint = m2::PointU::Zero();
vector<uint64_t> deltas;
deltas.resize(count);
- geo_coding::OutDeltasT deltasA(deltas);
+ OutDeltasT deltasA(deltas);
fnEncode(make_read_adapter(points), basePoint, maxPoint, deltasA);
vector<m2::PointU> decodedPoints;
decodedPoints.resize(count);
- geo_coding::OutPointsT decodedPointsA(decodedPoints);
+ OutPointsT decodedPointsA(decodedPoints);
fnDecode(make_read_adapter(deltas), basePoint, maxPoint, decodedPointsA);
TEST_EQUAL(points, decodedPoints, ());
@@ -137,14 +80,70 @@ vector<m2::PointU> SimplifyPoints(vector<m2::PointU> const & points, double eps)
void TestEncodePolyline(string name, m2::PointU maxPoint, vector<m2::PointU> const & points)
{
- using namespace geo_coding;
-
TestPolylineEncode(name + "1", points, maxPoint, &EncodePolylinePrev1, &DecodePolylinePrev1);
TestPolylineEncode(name + "2", points, maxPoint, &EncodePolylinePrev2, &DecodePolylinePrev2);
TestPolylineEncode(name + "3", points, maxPoint, &EncodePolylinePrev3, &DecodePolylinePrev3);
}
} // namespace
+UNIT_TEST(EncodeDelta)
+{
+ for (int x = -100; x <= 100; ++x)
+ {
+ for (int y = -100; y <= 100; ++y)
+ {
+ PU orig = PU(100 + x, 100 + y);
+ PU pred = PU(100, 100);
+ TEST_EQUAL(orig, DecodeDelta(EncodeDelta(orig, pred), pred), ());
+ vector<char> data;
+ PushBackByteSink<vector<char> > sink(data);
+ WriteVarUint(sink, EncodeDelta(orig, pred));
+ size_t expectedSize = 1;
+ if (x >= 8 || x < -8 || y >= 4 || y < -4) expectedSize = 2;
+ if (x >= 64 || x < -64 || y >= 64 || y < -64) expectedSize = 3;
+ TEST_EQUAL(data.size(), expectedSize, (x, y));
+ }
+ }
+}
+
+UNIT_TEST(PredictPointsInPolyline2)
+{
+ // Ci = Ci-1 + (Ci-1 + Ci-2) / 2
+ TEST_EQUAL(PU(5, 5), PredictPointInPolyline(PU(8, 7), PU(4, 4), PU(1, 2)), ());
+}
+
+UNIT_TEST(PredictPointsInPolyline2_ClampMax)
+{
+ // Ci = Ci-1 + (Ci-1 + Ci-2) / 2
+ TEST_EQUAL(PU(4, 4), PredictPointInPolyline(PU(4, 4), PU(4, 4), PU(1, 2)), ());
+ TEST_EQUAL(PU(5, 5), PredictPointInPolyline(PU(8, 7), PU(4, 4), PU(1, 2)), ());
+ TEST_EQUAL(PU(5, 5), PredictPointInPolyline(PU(5, 5), PU(4, 4), PU(1, 2)), ());
+}
+
+UNIT_TEST(PredictPointsInPolyline2_Clamp0)
+{
+ TEST_EQUAL(PU(4, 0), PredictPointInPolyline(PU(5, 5), PU(4, 1), PU(4, 4)), ());
+}
+
+/*
+UNIT_TEST(PredictPointsInPolyline3_Square)
+{
+ TEST_EQUAL(PU(5, 1), PredictPointInPolyline(PU(6, 6), PU(5, 4), PU(2, 4), PU(2, 1)), ());
+ TEST_EQUAL(PU(5, 3), PredictPointInPolyline(PU(6, 6), PU(4, 1), PU(2, 2), PU(3, 4)), ());
+}
+
+UNIT_TEST(PredictPointsInPolyline3_SquareClamp0)
+{
+ TEST_EQUAL(PU(5, 1), PredictPointInPolyline(PU(6, 6), PU(5, 4), PU(2, 4), PU(2, 1)), ());
+ TEST_EQUAL(PU(4, 0), PredictPointInPolyline(PU(6, 6), PU(2, 0), PU(3, 2), PU(5, 1)), ());
+}
+
+UNIT_TEST(PredictPointsInPolyline3_90deg)
+{
+ TEST_EQUAL(PU(3, 2), PredictPointInPolyline(PU(8, 8), PU(3, 6), PU(1, 6), PU(1, 5)), ());
+}
+*/
+
UNIT_TEST(EncodePolyline)
{
size_t const kSizes [] = { 0, 1, 2, 3, 4, ARRAY_SIZE(LargePolygon::kLargePolygon) };
@@ -175,12 +174,12 @@ UNIT_TEST(EncodePolyline)
UNIT_TEST(DecodeEncodePolyline_DataSet1)
{
- size_t const count = ARRAY_SIZE(index_test::arr1);
+ size_t const count = ARRAY_SIZE(geometry_coding_tests::arr1);
vector<m2::PointU> points;
points.reserve(count);
for (size_t i = 0; i < count; ++i)
- points.push_back(D2U(index_test::arr1[i]));
+ points.push_back(D2U(geometry_coding_tests::arr1[i]));
TestPolylineEncode("DataSet1", points, GetMaxPoint(),
- &geo_coding::EncodePolyline, &geo_coding::DecodePolyline);
+ &EncodePolyline, &DecodePolyline);
}
diff --git a/coding/coding_tests/geometry_serialization_test.cpp b/coding/coding_tests/geometry_serialization_test.cpp
new file mode 100644
index 0000000000..1aa9636ad2
--- /dev/null
+++ b/coding/coding_tests/geometry_serialization_test.cpp
@@ -0,0 +1,60 @@
+#include "testing/testing.hpp"
+
+#include "coding/byte_stream.hpp"
+#include "coding/coding_tests/test_polylines.hpp"
+#include "coding/geometry_coding.hpp"
+#include "coding/reader.hpp"
+
+#include "geometry/mercator.hpp"
+
+#include "base/logging.hpp"
+
+// Copy-Paste from feature_builder.cpp
+namespace
+{
+bool is_equal(double d1, double d2)
+{
+ return (fabs(d1 - d2) < MercatorBounds::GetCellID2PointAbsEpsilon());
+}
+
+bool is_equal(m2::PointD const & p1, m2::PointD const & p2)
+{
+ return p1.EqualDxDy(p2, MercatorBounds::GetCellID2PointAbsEpsilon());
+}
+
+bool is_equal(m2::RectD const & r1, m2::RectD const & r2)
+{
+ return (is_equal(r1.minX(), r2.minX()) && is_equal(r1.minY(), r2.minY()) &&
+ is_equal(r1.maxX(), r2.maxX()) && is_equal(r1.maxY(), r2.maxY()));
+}
+}
+
+UNIT_TEST(SaveLoadPolyline_DataSet1)
+{
+ using namespace geometry_coding_tests;
+
+ vector<m2::PointD> data1(arr1, arr1 + ARRAY_SIZE(arr1));
+
+ vector<char> buffer;
+ PushBackByteSink<vector<char>> w(buffer);
+
+ serial::GeometryCodingParams cp;
+ serial::SaveOuterPath(data1, cp, w);
+
+ vector<m2::PointD> data2;
+ ArrayByteSource r(&buffer[0]);
+ serial::LoadOuterPath(r, cp, data2);
+
+ TEST_EQUAL(data1.size(), data2.size(), ());
+
+ m2::RectD r1, r2;
+ for (size_t i = 0; i < data1.size(); ++i)
+ {
+ r1.Add(data1[i]);
+ r2.Add(data2[i]);
+
+ TEST(is_equal(data1[i], data2[i]), (data1[i], data2[i]));
+ }
+
+ TEST(is_equal(r1, r2), (r1, r2));
+}
diff --git a/coding/coding_tests/point_to_integer_test.cpp b/coding/coding_tests/point_to_integer_test.cpp
index d7322532d7..2842fedfdf 100644
--- a/coding/coding_tests/point_to_integer_test.cpp
+++ b/coding/coding_tests/point_to_integer_test.cpp
@@ -1,5 +1,6 @@
#include "testing/testing.hpp"
+#include "coding/coding_tests/test_polylines.hpp"
#include "coding/point_to_integer.hpp"
#include "coding/pointd_to_pointu.hpp"
@@ -110,3 +111,20 @@ UNIT_TEST(PointUToUint64Obsolete_1bit)
TEST_EQUAL(3ULL << 60, PointUToUint64Obsolete(m2::PointU(kBig, kBig)), ());
TEST_EQUAL((1ULL << 60) - 1, PointUToUint64Obsolete(m2::PointU(kBig - 1, kBig - 1)), ());
}
+
+UNIT_TEST(PointToInt64_DataSet1)
+{
+ using namespace geometry_coding_tests;
+
+ for (size_t i = 0; i < ARRAY_SIZE(arr1); ++i)
+ {
+ m2::PointD const pt(arr1[i].x, arr1[i].y);
+ int64_t const id = PointToInt64Obsolete(pt, kCoordBits);
+ m2::PointD const pt1 = Int64ToPointObsolete(id, kCoordBits);
+
+ CheckEqualPoints(pt, pt1);
+
+ int64_t const id1 = PointToInt64Obsolete(pt1, kCoordBits);
+ TEST_EQUAL(id, id1, (pt, pt1));
+ }
+}
diff --git a/indexer/indexer_tests/test_polylines.cpp b/coding/coding_tests/test_polylines.cpp
index 357553b178..1d2e24a092 100644
--- a/indexer/indexer_tests/test_polylines.cpp
+++ b/coding/coding_tests/test_polylines.cpp
@@ -1,6 +1,6 @@
-#include "indexer/indexer_tests/test_polylines.hpp"
+#include "coding/coding_tests/test_polylines.hpp"
-namespace index_test
+namespace geometry_coding_tests
{
P arr1[376] = { P(25.624035299999999182, 72.26346513007850092), P(25.624273200000001083, 72.263461698303601111), P(25.624488899999999347, 72.26341365347376211), P(25.624979400000000851, 72.263304218156179104), P(25.626030799999998777, 72.263025101705878228), P(25.629390999999998257, 72.261676817778678128), P(25.630162399999999678, 72.26138836631159279), P(25.631299500000000791, 72.260963603282490908), P(25.63236829999999955, 72.26051310574631259), P(25.63325580000000059, 72.260190152533994024), P(25.633720499999999021, 72.260019906865807116), P(25.634314799999998513, 72.259865485075735592), P(25.634578999999998672, 72.259830215951140531), P(25.635424199999999217, 72.259772832171691448), P(25.635776400000001018, 72.259834791404088605), P(25.638406499999998545, 72.260604806439260983), P(25.639231599999998679, 72.260931765228107793), P(25.639867699999999928, 72.261237563690428942), P(25.640699399999999031, 72.261850499331046649), P(25.643624299999999039, 72.264447578158552687), P(25.644772700000000754, 72.265904403664706024), P(25.645413800000000037, 72.267106341816230497), P(25.646751600000001758, 72.270404536824941033), P(25.64890219999999843, 72.275985791150915816), P(25.649064599999999103, 72.276404165523842948), P(25.650549500000000336, 72.279974564589863917), P(25.651433600000000723, 72.281545386607334081), P(25.652029899999998719, 72.282193025251160634), P(25.652814700000000414, 72.282915237415323872), P(25.654197199999998702, 72.283799562153532747), P(25.656540400000000801, 72.285055792411071707), P(25.658162999999998277, 72.286263412818769325), P(25.661959599999999426, 72.289916920742129491), P(25.663380199999998865, 72.291039561736027963), P(25.665810499999999195, 72.292780588759853799), P(25.6700361000000008, 72.29585629709197292), P(25.670962599999999298, 72.296655718166547899), P(25.672222699999998952, 72.297961211704517837), P(25.673103499999999855, 72.29896171301187735), P(25.674837499999998869, 72.300952077677095531), P(25.676358000000000459, 72.302732468128681376), P(25.678018200000000348, 72.304444228347662715), P(25.680309600000001069, 72.306619426588397914), P(25.682252600000001763, 72.308208994982337003), P(25.685880300000000886, 72.310749482551628375), P(25.6871223999999998, 72.311619291531712861), P(25.689502399999998516, 72.313337574126506979), P(25.689994200000001001, 72.313685586072296019), P(25.691337099999998372, 72.314639003020189989), P(25.694014100000000411, 72.316465930359882464), P(25.696650399999999337, 72.318133963117716689), P(25.697924300000000386, 72.31863598381848135), P(25.699229800000001234, 72.31891418618496914), P(25.700213699999999051, 72.319045273707061483), P(25.703616300000000194, 72.319271576784373678), P(25.707311499999999427, 72.319273484907995453), P(25.715181600000001083, 72.318046763400587906), P(25.72608460000000008, 72.315978426880036523), P(25.728649600000000675, 72.31539857900408208), P(25.730824299999998317, 72.315156452495600092), P(25.732753200000001215, 72.314945427265811873), P(25.736661200000000349, 72.315042353781024076), P(25.74480259999999987, 72.315568583243575063), P(25.747831600000001373, 72.315649864883624787), P(25.749809599999998966, 72.315866807206518274), P(25.752535200000000515, 72.316023647210727177), P(25.755610000000000781, 72.315910501039496694), P(25.760463999999998919, 72.315272459413776573), P(25.762314700000001011, 72.315021747344800929), P(25.763456399999999036, 72.314812630534717641), P(25.763716200000001066, 72.31478954377344337), P(25.771413500000001306, 72.314102668549878672), P(25.779617200000000565, 72.313375160856324442), P(25.784148800000000534, 72.313357035273327256), P(25.790238899999998523, 72.313577786126856495), P(25.793676300000001334, 72.313716876708198811), P(25.796280599999999339, 72.314048100429985766), P(25.798680499999999682, 72.31463614103191162), P(25.800190700000001698, 72.315239260045032665), P(25.803071100000000371, 72.316310615756250968), P(25.806439499999999754, 72.316835901112042961), P(25.809219599999998707, 72.316657116642062419), P(25.813906700000000427, 72.315918133153061831), P(25.817769800000000657, 72.31543750249576874), P(25.819804099999998925, 72.315482531661231747), P(25.823219200000000484, 72.315995217547779816), P(25.824360999999999677, 72.316092908788874638), P(25.825752500000000111, 72.316000750836963107), P(25.833053499999998337, 72.315183355397863352), P(25.835087900000001326, 72.314863574077250519), P(25.836477299999998536, 72.314986830897922232), P(25.838510800000001666, 72.315843910886087542), P(25.84021669999999915, 72.316586137240363996), P(25.845591399999999993, 72.318366369042564656), P(25.847287900000001315, 72.318912278071522337), P(25.852937300000000675, 72.321233538069833457), P(25.857534099999998745, 72.324114950429262194), P(25.858493899999999144, 72.324638770105451613), P(25.859516599999999187, 72.325101910243901671), P(25.860960299999998568, 72.325309341574609334), P(25.864481800000000078, 72.325170990340012622), P(25.866295099999998541, 72.325066225249685203), P(25.871619400000000155, 72.324758609934391984), P(25.873917800000000966, 72.324524655307570242), P(25.875719000000000136, 72.324229064532204347), P(25.882352300000000866, 72.322516991669758113), P(25.886094899999999797, 72.321551632301222412), P(25.891463999999999146, 72.320154280548763381), P(25.892594599999998906, 72.32000410941930113), P(25.893775399999999109, 72.320041127430243932), P(25.895055100000000436, 72.320205228136387632), P(25.901716900000000265, 72.321479884460799781), P(25.905201399999999268, 72.322148897878847151), P(25.906758400000001075, 72.322300409542663147), P(25.908453200000000294, 72.322276366107203671), P(25.910453700000001476, 72.322039939449879853), P(25.912611200000000622, 72.321379323121732341), P(25.914446699999999169, 72.320507670602822259), P(25.915890699999998503, 72.319578403757603269), P(25.916971199999998987, 72.318721085380474278), P(25.923277999999999821, 72.312682767056259081), P(25.924315100000001166, 72.311643903530907096), P(25.925479700000000349, 72.310661910829537646), P(25.926380200000000542, 72.31012846985993292), P(25.927288000000000778, 72.309673827336439444), P(25.929170299999999116, 72.308742039167825055), P(25.931695000000001272, 72.307558244187632113), P(25.935542200000000435, 72.305689970006980616), P(25.936291600000000557, 72.305420216334297834), P(25.937011699999999337, 72.3052109385934898), P(25.937444899999999137, 72.305171830245583919), P(25.938065999999999178, 72.305126426436075349), P(25.939194700000001603, 72.305346959512363014), P(25.941637199999998842, 72.306187700803491225), P(25.951531899999999098, 72.309363611414866568), P(25.958591599999998323, 72.311600021678131611), P(25.961859900000000323, 72.312588133461261464), P(25.9623209000000017, 72.312845323461488078), P(25.962808800000001241, 72.313126745396871797), P(25.963783500000001681, 72.313929806056449934), P(25.964454100000001091, 72.315054565005411291), P(25.966293799999998981, 72.319575350745964215), P(25.966609900000001687, 72.320173934482440359), P(25.966938999999999993, 72.320628647970096381), P(25.968776200000000642, 72.322731857094510133), P(25.969766299999999859, 72.323772036806516894), P(25.97039970000000153, 72.324406914991570261), P(25.971057800000000526, 72.324904784282267656), P(25.972805199999999815, 72.325716763759459127), P(25.973508700000000005, 72.326106631888762877), P(25.974174900000001287, 72.326699167072590058), P(25.974623600000001034, 72.327462886785923502), P(25.97499170000000035, 72.32822527930542833), P(25.975826399999998984, 72.329784823533856297), P(25.976481499999998448, 72.330935420885211329), P(25.977230399999999833, 72.332212952428704966), P(25.978115400000000079, 72.333512265445278899), P(25.9789551000000003, 72.33474671239962106), P(25.980276700000001, 72.336402410819303554), P(25.98169719999999927, 72.337880836033434662), P(25.983172299999999666, 72.33911288186702393), P(25.984414600000000917, 72.340068567971513858), P(25.985398499999998734, 72.340636603533639004), P(25.986058100000001048, 72.340908025445514795), P(25.987230000000000274, 72.341316496490946975), P(25.988157300000001015, 72.341676869267246275), P(25.991148400000000152, 72.342299318530393748), P(25.997876999999999015, 72.343701138883602653), P(25.999752600000000768, 72.344154484369809666), P(26.001479700000000861, 72.344723890629211382), P(26.003023999999999916, 72.345420432028205937), P(26.005314899999998346, 72.346859159309715892), P(26.007066099999999409, 72.348322733682408625), P(26.008686999999998335, 72.35014618535842601), P(26.012360000000001037, 72.354910262506038521), P(26.013286199999999582, 72.355943685106993257), P(26.013858500000001328, 72.35652369166834319), P(26.014633599999999802, 72.357135968669368253), P(26.015746700000001113, 72.357673410043958029), P(26.017126499999999822, 72.358212001250265644), P(26.020520199999999988, 72.359278695677289761), P(26.021437599999998724, 72.359644892510004865), P(26.022532699999999295, 72.360275718006846546), P(26.028545999999998628, 72.365263533617877556), P(26.029226600000001213, 72.365797602942478761), P(26.030111600000001459, 72.366317546512846093), P(26.032004199999999372, 72.367306080501194288), P(26.033209299999999331, 72.367834246590078351), P(26.034265699999998844, 72.368067397148493569), P(26.035592099999998794, 72.368224167962054594), P(26.03677019999999942, 72.368129074294643033), P(26.043432299999999202, 72.366408627750374194), P(26.045431499999999403, 72.365842856777021552), P(26.048415399999999664, 72.36504242213915461), P(26.052753299999999115, 72.363920454888528866), P(26.05556269999999941, 72.363008918012667436), P(26.060303699999998628, 72.360393712052541559), P(26.065962500000001256, 72.35698705139280662), P(26.067612400000001571, 72.356026924714299753), P(26.069255399999999412, 72.355021374242639354), P(26.070335599999999943, 72.354163985856629893), P(26.071483900000000489, 72.353231772141796796), P(26.073087300000000965, 72.351530224288538307), P(26.07495580000000146, 72.349052146600300262), P(26.077375199999998756, 72.345412414793742073), P(26.079008800000000434, 72.34322240936705839), P(26.080636800000000619, 72.341554327036718064), P(26.081818800000000635, 72.340620379333103074), P(26.083176200000000478, 72.339615440891947173), P(26.085581000000001239, 72.338285853103528211), P(26.092078799999999461, 72.335142167729841844), P(26.099516500000000008, 72.332061609286498083), P(26.102282500000001164, 72.330882175026999903), P(26.105014700000001682, 72.329521843521945357), P(26.108211900000000583, 72.327720133658942814), P(26.116759299999998234, 72.322424061632020198), P(26.118289900000000614, 72.321345929920937579), P(26.124188000000000187, 72.316306990481081129), P(26.126093300000000852, 72.314456217615472156), P(26.13131840000000139, 72.308768748722727082), P(26.133807300000000851, 72.305896196846916268), P(26.135103199999999646, 72.304208818196542552), P(26.13615610000000089, 72.3027141546473473), P(26.136958199999998698, 72.301545345164157652), P(26.137658200000000619, 72.300474224549915903), P(26.140487000000000251, 72.29551524417688313), P(26.146685800000000199, 72.285760107870132174), P(26.151274499999999534, 72.277504651282583836), P(26.151979099999998368, 72.276113553331668982), P(26.152562700000000717, 72.274582520714972134), P(26.152978600000000853, 72.272986691312326002), P(26.154697899999998612, 72.264608683472175699), P(26.155105599999998844, 72.263003939235275652), P(26.155811400000001044, 72.261258344309723611), P(26.156706599999999696, 72.259655777039213831), P(26.158511799999999425, 72.257073180827120495), P(26.163497199999998344, 72.251147710512896083), P(26.164152500000000146, 72.250452144382251163), P(26.165397099999999853, 72.249370018656591697), P(26.171159400000000517, 72.245101348184562084), P(26.171824600000000771, 72.244502288299599968), P(26.172791700000001214, 72.243464858038208831), P(26.173422299999998586, 72.24251111483852128), P(26.174280599999999453, 72.240982180618559028), P(26.174924399999998315, 72.239409446329290176), P(26.175138900000000319, 72.238550480576279256), P(26.177894599999998348, 72.222417606854094174), P(26.178249600000000896, 72.220799387733251251), P(26.178700899999999052, 72.219414415122045625), P(26.179689899999999625, 72.217234222262234766), P(26.182073200000001378, 72.213506738076645775), P(26.18310470000000123, 72.211533626956168064), P(26.183614800000000855, 72.210338776927230242), P(26.18428000000000111, 72.208417574177602205), P(26.185804499999999706, 72.203266316303412964), P(26.186153000000000901, 72.202346286216979365), P(26.186549599999999316, 72.201465316811109574), P(26.187059699999998941, 72.200685882789031211), P(26.187643699999998859, 72.200064170625580573), P(26.188815999999999207, 72.199110470754774838), P(26.189986799999999789, 72.198491439723213148), P(26.190943999999998226, 72.198205925482497491), P(26.192045499999998981, 72.198064597333782899), P(26.201502200000000187, 72.19749033573828001), P(26.204289599999999183, 72.197194731015855496), P(26.212046699999998367, 72.196023752898682346), P(26.217400099999998986, 72.195033541852339454), P(26.220660899999998605, 72.194099530393685882), P(26.223864100000000121, 72.193042117073559893), P(26.227025699999998665, 72.192404096537160285), P(26.229406099999998503, 72.192154413131575552), P(26.23379059999999896, 72.191934250652863625), P(26.241092200000000645, 72.191652763688111349), P(26.247795599999999894, 72.191305763109099303), P(26.259740499999999486, 72.190710990755292187), P(26.262441899999998896, 72.190662426481935654), P(26.26396259999999927, 72.190803739092231694), P(26.265582200000000768, 72.19108065172507338), P(26.271514700000000886, 72.192273445913514252), P(26.275603900000000124, 72.192994312937273094), P(26.278289999999998372, 72.193506828374651718), P(26.280647800000000558, 72.193799369593079973), P(26.284991699999999071, 72.194193426147350579), P(26.295021899999998283, 72.194996021158502231), P(26.296629599999999272, 72.195353135208762296), P(26.298219400000000689, 72.195936520796209379), P(26.299353599999999886, 72.196573622487093758), P(26.300700500000001369, 72.19746290844136638), P(26.301440499999998224, 72.198127833072547332), P(26.302059899999999715, 72.198747051231549676), P(26.302597999999999701, 72.199118470577644757), P(26.30326700000000173, 72.200164931796578571), P(26.304018299999999186, 72.201524555689601925), P(26.305375600000001413, 72.20513574950004454), P(26.306215500000000418, 72.206942181028665573), P(26.307179600000001329, 72.208595118825385839), P(26.307805599999998236, 72.209443034325843769), P(26.308593200000000678, 72.210334966852684602), P(26.309511400000001657, 72.211171854914510959), P(26.310345000000001647, 72.211829485157878139), P(26.313103999999999161, 72.213550746524816759), P(26.313808999999999116, 72.214105903186023738), P(26.315858999999999668, 72.21616368063173752), P(26.316473599999998356, 72.216713905276705532), P(26.317261800000000704, 72.217105619191144683), P(26.318279199999999207, 72.217451609641841515), P(26.31951039999999864, 72.217778930438797147), P(26.319995200000001034, 72.217883719155963718), P(26.322028199999998321, 72.21814340535271981), P(26.323134799999998279, 72.218219615725388394), P(26.324022500000001656, 72.218280774611798734), P(26.32581220000000144, 72.218525220186265301), P(26.327261700000001099, 72.218861882068196678), P(26.330273800000000506, 72.219715642811124212), P(26.337171999999998917, 72.221928497785057743), P(26.339137900000000769, 72.222394361231621929), P(26.341438799999998821, 72.222689314479467271), P(26.343669200000000785, 72.222811640430336411), P(26.346788899999999956, 72.222677310542948703), P(26.356923500000000615, 72.222042438730937874), P(26.359536099999999692, 72.2221015051835451), P(26.36183730000000125, 72.222299854521224916), P(26.366428899999998947, 72.222842507761527031), P(26.374883000000000521, 72.223912965077033732), P(26.380090800000001394, 72.224542709845593436), P(26.39073850000000121, 72.225869670908153353), P(26.393878699999998361, 72.226187124115313054), P(26.400813700000000495, 72.226887965488728582), P(26.405969100000000083, 72.227408932782296347), P(26.434136200000001082, 72.23031015029567925), P(26.437651200000001239, 72.230672215773722655), P(26.439650799999999009, 72.230860300030158783), P(26.442400500000001529, 72.230918230849241013), P(26.444426599999999894, 72.230815518016711962), P(26.454957100000001446, 72.229639190945519545), P(26.455386699999998257, 72.229609273288744475), P(26.470600499999999755, 72.227804710557407475), P(26.485397899999998828, 72.226080035891357056), P(26.487313600000000235, 72.226084418502168205), P(26.488673999999999609, 72.226209799401686951), P(26.489974300000000085, 72.226456941463752059), P(26.493316499999998825, 72.227405883949458598), P(26.497907399999999001, 72.228727947008763977), P(26.507186099999998419, 72.231355762593423719), P(26.521764000000001005, 72.235531322949142918), P(26.522283200000000392, 72.235663963313356817), P(26.52274799999999999, 72.235808991367022713), P(26.523495799999999178, 72.236006428221017472), P(26.537509100000001183, 72.239985971537208798), P(26.540924100000001573, 72.240959309764491536), P(26.544420699999999869, 72.241674408812258434), P(26.546888100000000321, 72.242183101965366632), P(26.5518616999999999, 72.242874580127462991), P(26.562219100000000083, 72.244128903051048951), P(26.564274399999998622, 72.244315309516480283), P(26.576127799999998302, 72.245028538203385438), P(26.58263820000000166, 72.244424904560787581), P(26.591367999999999228, 72.243389190867901561), P(26.598972199999998622, 72.242452221067154028), P(26.600826200000000199, 72.242522931717928714), P(26.603627199999998254, 72.242683603364909573), P(26.606756300000000692, 72.243241096929352807), P(26.612569100000001754, 72.244800578667096147), P(26.615042299999998932, 72.246052459623328446), P(26.621848599999999863, 72.249011664844303482), P(26.627471299999999843, 72.250195383365820589), P(26.641823800000000944, 72.252710806698729584), P(26.648778100000001245, 72.254338371527666141), P(26.655288500000001051, 72.25700169234383452), P(26.660515000000000185, 72.259171735257126556), P(26.662390800000000723, 72.25996099777080417), P(26.670629300000001649, 72.263625851730935779), P(26.671595899999999801, 72.264267979553508781), P(26.676856199999999575, 72.267335711577246116), P(26.677412499999999085, 72.267929636079472289), P(26.676856199999999575, 72.267335711577246116) };
-}
+} // namespace geometry_coding_tests
diff --git a/coding/coding_tests/test_polylines.hpp b/coding/coding_tests/test_polylines.hpp
new file mode 100644
index 0000000000..dc2b0f37a7
--- /dev/null
+++ b/coding/coding_tests/test_polylines.hpp
@@ -0,0 +1,9 @@
+#pragma once
+
+#include "geometry/point2d.hpp"
+
+namespace geometry_coding_tests
+{
+using P = m2::PointD;
+extern P arr1[376];
+} // namespace geometry_coding_tests
diff --git a/coding/geometry_coding.cpp b/coding/geometry_coding.cpp
new file mode 100644
index 0000000000..fd0f5b4f9f
--- /dev/null
+++ b/coding/geometry_coding.cpp
@@ -0,0 +1,552 @@
+#include "coding/geometry_coding.hpp"
+
+#include "coding/point_to_integer.hpp"
+
+#include "geometry/mercator.hpp"
+
+#include "base/assert.hpp"
+
+#include <complex>
+#include <stack>
+
+using namespace std;
+
+namespace
+{
+inline m2::PointU ClampPoint(m2::PointU const & maxPoint, m2::Point<double> const & point)
+{
+ using uvalue_t = m2::PointU::value_type;
+ // return m2::PointU(my::clamp(static_cast<uvalue_t>(point.x), static_cast<uvalue_t>(0),
+ // maxPoint.x),
+ // my::clamp(static_cast<uvalue_t>(point.y), static_cast<uvalue_t>(0),
+ // maxPoint.y));
+
+ return m2::PointU(
+ static_cast<uvalue_t>(my::clamp(point.x, 0.0, static_cast<double>(maxPoint.x))),
+ static_cast<uvalue_t>(my::clamp(point.y, 0.0, static_cast<double>(maxPoint.y))));
+}
+
+struct edge_less_p0
+{
+ using edge_t = tesselator::Edge;
+
+ bool operator()(edge_t const & e1, edge_t const & e2) const
+ {
+ return (e1.m_p[0] == e2.m_p[0]) ? (e1.m_side < e2.m_side) : (e1.m_p[0] < e2.m_p[0]);
+ }
+ bool operator()(edge_t const & e1, int e2) const { return e1.m_p[0] < e2; }
+ bool operator()(int e1, edge_t const & e2) const { return e1 < e2.m_p[0]; }
+};
+} // namespace
+
+namespace coding
+{
+bool TestDecoding(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT const & deltas,
+ void (* fnDecode)(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutPointsT & points))
+{
+ size_t const count = points.size();
+
+ vector<m2::PointU> decoded;
+ decoded.resize(count);
+
+ OutPointsT decodedA(decoded);
+ fnDecode(make_read_adapter(deltas), basePoint, maxPoint, decodedA);
+
+ for (size_t i = 0; i < count; ++i)
+ ASSERT_EQUAL(points[i], decoded[i], ());
+ return true;
+}
+
+m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
+ m2::PointU const & p1,
+ m2::PointU const & p2)
+{
+ // return ClampPoint(maxPoint, m2::PointI64(p1) + m2::PointI64(p1) - m2::PointI64(p2));
+ // return ClampPoint(maxPoint, m2::PointI64(p1) + (m2::PointI64(p1) - m2::PointI64(p2)) / 2);
+ return ClampPoint(maxPoint, m2::PointD(p1) + (m2::PointD(p1) - m2::PointD(p2)) / 2.0);
+}
+
+uint64_t EncodeDelta(m2::PointU const & actual, m2::PointU const & prediction)
+{
+ return bits::BitwiseMerge(
+ bits::ZigZagEncode(static_cast<int32_t>(actual.x) - static_cast<int32_t>(prediction.x)),
+ bits::ZigZagEncode(static_cast<int32_t>(actual.y) - static_cast<int32_t>(prediction.y)));
+}
+
+m2::PointU DecodeDelta(uint64_t delta, m2::PointU const & prediction)
+{
+ uint32_t x, y;
+ bits::BitwiseSplit(delta, x, y);
+ return m2::PointU(prediction.x + bits::ZigZagDecode(x), prediction.y + bits::ZigZagDecode(y));
+}
+
+m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
+ m2::PointU const & p1,
+ m2::PointU const & p2,
+ m2::PointU const & p3)
+{
+ CHECK_NOT_EQUAL(p2, p3, ());
+
+ complex<double> const c1(p1.x, p1.y);
+ complex<double> const c2(p2.x, p2.y);
+ complex<double> const c3(p3.x, p3.y);
+ complex<double> const d = (c1 - c2) / (c2 - c3);
+ complex<double> const c0 = c1 + (c1 - c2) * polar(0.5, 0.5 * arg(d));
+
+ /*
+ complex<double> const c1(p1.x, p1.y);
+ complex<double> const c2(p2.x, p2.y);
+ complex<double> const c3(p3.x, p3.y);
+ complex<double> const d = (c1 - c2) / (c2 - c3);
+ complex<double> const c01 = c1 + (c1 - c2) * polar(0.5, arg(d));
+ complex<double> const c02 = c1 + (c1 - c2) * complex<double>(0.5, 0.0);
+ complex<double> const c0 = (c01 + c02) * complex<double>(0.5, 0.0);
+ */
+
+ return ClampPoint(maxPoint, m2::PointD(c0.real(), c0.imag()));
+}
+
+m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint,
+ m2::PointU const & p1,
+ m2::PointU const & p2,
+ m2::PointU const & p3)
+{
+ // parallelogram prediction
+ return ClampPoint(maxPoint, p1 + p2 - p3);
+}
+
+void EncodePolylinePrev1(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT & deltas)
+{
+ size_t const count = points.size();
+ if (count > 0)
+ {
+ deltas.push_back(EncodeDelta(points[0], basePoint));
+ for (size_t i = 1; i < count; ++i)
+ deltas.push_back(EncodeDelta(points[i], points[i-1]));
+ }
+
+ ASSERT(TestDecoding(points, basePoint, maxPoint, deltas, &DecodePolylinePrev1), ());
+}
+
+void DecodePolylinePrev1(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & /*maxPoint*/,
+ OutPointsT & points)
+{
+ size_t const count = deltas.size();
+ if (count > 0)
+ {
+ points.push_back(DecodeDelta(deltas[0], basePoint));
+ for (size_t i = 1; i < count; ++i)
+ points.push_back(DecodeDelta(deltas[i], points.back()));
+ }
+}
+
+void EncodePolylinePrev2(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT & deltas)
+{
+ size_t const count = points.size();
+ if (count > 0)
+ {
+ deltas.push_back(EncodeDelta(points[0], basePoint));
+ if (count > 1)
+ {
+ deltas.push_back(EncodeDelta(points[1], points[0]));
+ for (size_t i = 2; i < count; ++i)
+ deltas.push_back(EncodeDelta(points[i],
+ PredictPointInPolyline(maxPoint, points[i-1], points[i-2])));
+ }
+ }
+
+ ASSERT(TestDecoding(points, basePoint, maxPoint, deltas, &DecodePolylinePrev2), ());
+}
+
+void DecodePolylinePrev2(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutPointsT & points)
+{
+ size_t const count = deltas.size();
+ if (count > 0)
+ {
+ points.push_back(DecodeDelta(deltas[0], basePoint));
+ if (count > 1)
+ {
+ points.push_back(DecodeDelta(deltas[1], points.back()));
+ for (size_t i = 2; i < count; ++i)
+ {
+ size_t const n = points.size();
+ points.push_back(DecodeDelta(deltas[i],
+ PredictPointInPolyline(maxPoint, points[n-1], points[n-2])));
+ }
+ }
+ }
+}
+
+void EncodePolylinePrev3(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT & deltas)
+{
+ ASSERT_LESS_OR_EQUAL(basePoint.x, maxPoint.x, (basePoint, maxPoint));
+ ASSERT_LESS_OR_EQUAL(basePoint.y, maxPoint.y, (basePoint, maxPoint));
+
+ size_t const count = points.size();
+ if (count > 0)
+ {
+ deltas.push_back(EncodeDelta(points[0], basePoint));
+ if (count > 1)
+ {
+ deltas.push_back(EncodeDelta(points[1], points[0]));
+ if (count > 2)
+ {
+ m2::PointU const prediction = PredictPointInPolyline(maxPoint, points[1], points[0]);
+ deltas.push_back(EncodeDelta(points[2], prediction));
+ for (size_t i = 3; i < count; ++i)
+ {
+ m2::PointU const prediction =
+ PredictPointInPolyline(maxPoint, points[i-1], points[i-2], points[i-3]);
+ deltas.push_back(EncodeDelta(points[i], prediction));
+ }
+ }
+ }
+ }
+
+ ASSERT(TestDecoding(points, basePoint, maxPoint, deltas, &DecodePolylinePrev3), ());
+}
+
+void DecodePolylinePrev3(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutPointsT & points)
+{
+ ASSERT_LESS_OR_EQUAL(basePoint.x, maxPoint.x, (basePoint, maxPoint));
+ ASSERT_LESS_OR_EQUAL(basePoint.y, maxPoint.y, (basePoint, maxPoint));
+
+ size_t const count = deltas.size();
+ if (count> 0)
+ {
+ points.push_back(DecodeDelta(deltas[0], basePoint));
+ if (count > 1)
+ {
+ m2::PointU const pt0 = points.back();
+ points.push_back(DecodeDelta(deltas[1], pt0));
+ if (count > 2)
+ {
+ points.push_back(DecodeDelta(deltas[2],
+ PredictPointInPolyline(maxPoint, points.back(), pt0)));
+ for (size_t i = 3; i < count; ++i)
+ {
+ size_t const n = points.size();
+ m2::PointU const prediction =
+ PredictPointInPolyline(maxPoint, points[n-1], points[n-2], points[n-3]);
+ points.push_back(DecodeDelta(deltas[i], prediction));
+ }
+ }
+ }
+ }
+}
+
+void EncodePolyline(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT & deltas)
+{
+ EncodePolylinePrev2(points, basePoint, maxPoint, deltas);
+}
+
+void DecodePolyline(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutPointsT & points)
+{
+ DecodePolylinePrev2(deltas, basePoint, maxPoint, points);
+}
+
+void EncodeTriangleStrip(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT & deltas)
+{
+ size_t const count = points.size();
+ if (count > 0)
+ {
+ ASSERT_GREATER(count, 2, ());
+
+ deltas.push_back(EncodeDelta(points[0], basePoint));
+ deltas.push_back(EncodeDelta(points[1], points[0]));
+ deltas.push_back(EncodeDelta(points[2], points[1]));
+
+ for (size_t i = 3; i < count; ++i)
+ {
+ m2::PointU const prediction =
+ PredictPointInTriangle(maxPoint, points[i-1], points[i-2], points[i-3]);
+ deltas.push_back(EncodeDelta(points[i], prediction));
+ }
+ }
+}
+
+void DecodeTriangleStrip(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutPointsT & points)
+{
+ size_t const count = deltas.size();
+ if (count > 0)
+ {
+ ASSERT_GREATER(count, 2, ());
+
+ points.push_back(DecodeDelta(deltas[0], basePoint));
+ points.push_back(DecodeDelta(deltas[1], points.back()));
+ points.push_back(DecodeDelta(deltas[2], points.back()));
+
+ for (size_t i = 3; i < count; ++i)
+ {
+ size_t const n = points.size();
+ m2::PointU const prediction =
+ PredictPointInTriangle(maxPoint, points[n-1], points[n-2], points[n-3]);
+ points.push_back(DecodeDelta(deltas[i], prediction));
+ }
+ }
+}
+} // namespace coding
+
+namespace serial
+{
+// GeometryCodingParams ----------------------------------------------------------------------------
+GeometryCodingParams::GeometryCodingParams() : m_BasePointUint64(0), m_CoordBits(POINT_COORD_BITS)
+{
+ m_BasePoint = Uint64ToPointUObsolete(m_BasePointUint64);
+}
+
+GeometryCodingParams::GeometryCodingParams(uint8_t coordBits, m2::PointD const & pt)
+ : m_CoordBits(coordBits)
+{
+ SetBasePoint(pt);
+}
+
+GeometryCodingParams::GeometryCodingParams(uint8_t coordBits, uint64_t basePointUint64)
+ : m_BasePointUint64(basePointUint64), m_CoordBits(coordBits)
+{
+ m_BasePoint = Uint64ToPointUObsolete(m_BasePointUint64);
+}
+
+void GeometryCodingParams::SetBasePoint(m2::PointD const & pt)
+{
+ m_BasePoint = PointDToPointU(pt, m_CoordBits);
+ m_BasePointUint64 = PointUToUint64Obsolete(m_BasePoint);
+}
+
+namespace pts
+{
+m2::PointU D2U(m2::PointD const & p, uint32_t coordBits) { return PointDToPointU(p, coordBits); }
+
+m2::PointD U2D(m2::PointU const & p, uint32_t coordBits)
+{
+ m2::PointD const pt = PointUToPointD(p, coordBits);
+ ASSERT(MercatorBounds::minX <= pt.x && pt.y <= MercatorBounds::maxX, (p, pt, coordBits));
+ ASSERT(MercatorBounds::minY <= pt.x && pt.y <= MercatorBounds::maxY, (p, pt, coordBits));
+ return pt;
+}
+
+m2::PointU GetMaxPoint(GeometryCodingParams const & params)
+{
+ return D2U(m2::PointD(MercatorBounds::maxX, MercatorBounds::maxY), params.GetCoordBits());
+}
+
+m2::PointU GetBasePoint(GeometryCodingParams const & params)
+{
+ return params.GetBasePoint();
+}
+} // namespace pts
+
+void Encode(EncodeFunT fn, vector<m2::PointD> const & points,
+ GeometryCodingParams const & params, DeltasT & deltas)
+{
+ size_t const count = points.size();
+
+ pts::PointsU upoints;
+ upoints.reserve(count);
+
+ transform(points.begin(), points.end(), back_inserter(upoints),
+ bind(&pts::D2U, placeholders::_1, params.GetCoordBits()));
+
+ ASSERT(deltas.empty(), ());
+ deltas.resize(count);
+
+ coding::OutDeltasT adapt(deltas);
+ (*fn)(make_read_adapter(upoints), pts::GetBasePoint(params), pts::GetMaxPoint(params), adapt);
+}
+
+void Decode(DecodeFunT fn, DeltasT const & deltas, GeometryCodingParams const & params,
+ OutPointsT & points, size_t reserveF)
+{
+ DecodeImpl(fn, deltas, params, points, reserveF);
+}
+
+void Decode(DecodeFunT fn, DeltasT const & deltas, GeometryCodingParams const & params,
+ vector<m2::PointD> & points, size_t reserveF)
+{
+ DecodeImpl(fn, deltas, params, points, reserveF);
+}
+
+void const * LoadInner(DecodeFunT fn, void const * pBeg, size_t count,
+ GeometryCodingParams const & params, OutPointsT & points)
+{
+ DeltasT deltas;
+ deltas.reserve(count);
+ void const * ret =
+ ReadVarUint64Array(static_cast<char const *>(pBeg), count, MakeBackInsertFunctor(deltas));
+
+ Decode(fn, deltas, params, points);
+ return ret;
+}
+
+TrianglesChainSaver::TrianglesChainSaver(GeometryCodingParams const & params)
+{
+ m_base = pts::GetBasePoint(params);
+ m_max = pts::GetMaxPoint(params);
+}
+
+void TrianglesChainSaver::operator()(TPoint arr[3], vector<TEdge> edges)
+{
+ m_buffers.push_back(TBuffer());
+ MemWriter<TBuffer> writer(m_buffers.back());
+
+ WriteVarUint(writer, coding::EncodeDelta(arr[0], m_base));
+ WriteVarUint(writer, coding::EncodeDelta(arr[1], arr[0]));
+
+ TEdge curr = edges.front();
+ curr.m_delta = coding::EncodeDelta(arr[2], arr[1]);
+
+ sort(edges.begin(), edges.end(), edge_less_p0());
+
+ stack<TEdge> st;
+ while (true)
+ {
+ CHECK_EQUAL(curr.m_delta >> 62, 0, ());
+ uint64_t delta = curr.m_delta << 2;
+
+ // find next edges
+ int const nextNode = curr.m_p[1];
+ auto i = lower_bound(edges.begin(), edges.end(), nextNode, edge_less_p0());
+ bool const found = (i != edges.end() && i->m_p[0] == nextNode);
+ if (found)
+ {
+ // fill 2 tree-struct bites
+ ASSERT_NOT_EQUAL(i->m_side, -1, ());
+
+ uint64_t const one = 1;
+
+ // first child
+ delta |= (one << i->m_side);
+
+ vector<TEdge>::iterator j = i + 1;
+ if (j != edges.end() && j->m_p[0] == nextNode)
+ {
+ // second child
+ ASSERT_EQUAL(i->m_side, 0, ());
+ ASSERT_EQUAL(j->m_side, 1, ());
+
+ delta |= (one << j->m_side);
+
+ // push to stack for further processing
+ st.push(*j);
+ }
+
+ curr = *i;
+ }
+
+ // write delta for current element
+ WriteVarUint(writer, delta);
+
+ if (!found)
+ {
+ // end of chain - pop current from stack or exit
+ if (st.empty())
+ break;
+ else
+ {
+ curr = st.top();
+ st.pop();
+ }
+ }
+ }
+}
+
+void DecodeTriangles(coding::InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, coding::OutPointsT & points)
+{
+ size_t const count = deltas.size();
+ ASSERT_GREATER(count, 2, ());
+
+ points.push_back(coding::DecodeDelta(deltas[0], basePoint));
+ points.push_back(coding::DecodeDelta(deltas[1], points.back()));
+ points.push_back(coding::DecodeDelta(deltas[2] >> 2, points.back()));
+
+ stack<size_t> st;
+
+ size_t ind = 2;
+ uint8_t treeBits = deltas[2] & 3;
+
+ for (size_t i = 3; i < count;)
+ {
+ // points 0, 1 - is a common edge
+ // point 2 - is an opposite point for new triangle to calculate prediction
+ size_t trg[3];
+
+ if (treeBits & 1)
+ {
+ // common edge is 1->2
+ trg[0] = ind;
+ trg[1] = ind - 1;
+ trg[2] = ind - 2;
+
+ // push to stack for further processing
+ if (treeBits & 2)
+ st.push(ind);
+ }
+ else if (treeBits & 2)
+ {
+ // common edge is 2->0
+ trg[0] = ind - 2;
+ trg[1] = ind;
+ trg[2] = ind - 1;
+ }
+ else
+ {
+ // end of chain - pop current from stack
+ ASSERT(!st.empty(), ());
+ ind = st.top();
+ st.pop();
+ treeBits = 2;
+ continue;
+ }
+
+ // push points
+ points.push_back(points[trg[0]]);
+ points.push_back(points[trg[1]]);
+ points.push_back(coding::DecodeDelta(
+ deltas[i] >> 2,
+ coding::PredictPointInTriangle(maxPoint, points[trg[0]], points[trg[1]], points[trg[2]])));
+
+ // next step
+ treeBits = deltas[i] & 3;
+ ind = points.size() - 1;
+ ++i;
+ }
+
+ ASSERT(treeBits == 0 && st.empty(), ());
+}
+} // namespace serial
diff --git a/coding/geometry_coding.hpp b/coding/geometry_coding.hpp
new file mode 100644
index 0000000000..6fd37e0e5f
--- /dev/null
+++ b/coding/geometry_coding.hpp
@@ -0,0 +1,367 @@
+#pragma once
+
+#include "geometry/point2d.hpp"
+
+#include "coding/pointd_to_pointu.hpp"
+#include "coding/tesselator_decl.hpp"
+#include "coding/varint.hpp"
+#include "coding/writer.hpp"
+
+#include "base/array_adapters.hpp"
+#include "base/base.hpp"
+#include "base/bits.hpp"
+#include "base/buffer_vector.hpp"
+#include "base/stl_add.hpp"
+
+#include <algorithm>
+#include <cstddef>
+#include <cstdint>
+#include <functional>
+#include <iterator>
+#include <list>
+#include <vector>
+
+namespace coding
+{
+using InPointsT = array_read<m2::PointU>;
+using InDeltasT = array_read<uint64_t>;
+using OutPointsT = array_write<m2::PointU>;
+using OutDeltasT = array_write<uint64_t>;
+
+uint64_t EncodeDelta(m2::PointU const & actual, m2::PointU const & prediction);
+
+m2::PointU DecodeDelta(uint64_t delta, m2::PointU const & prediction);
+
+/// Predict next point for polyline with given previous points (p1, p2).
+m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
+ m2::PointU const & p1,
+ m2::PointU const & p2);
+
+/// Predict next point for polyline with given previous points (p1, p2, p3).
+m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
+ m2::PointU const & p1,
+ m2::PointU const & p2,
+ m2::PointU const & p3);
+
+/// Predict point for neighbour triangle with given
+/// previous triangle (p1, p2, p3) and common edge (p1, p2).
+m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint,
+ m2::PointU const & p1,
+ m2::PointU const & p2,
+ m2::PointU const & p3);
+
+void EncodePolylinePrev1(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT & deltas);
+
+void DecodePolylinePrev1(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutPointsT & points);
+
+void EncodePolylinePrev2(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT & deltas);
+
+void DecodePolylinePrev2(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutPointsT & points);
+
+void EncodePolylinePrev3(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT & deltas);
+
+void DecodePolylinePrev3(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutPointsT & points);
+
+void EncodePolyline(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT & deltas);
+
+void DecodePolyline(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutPointsT & points);
+
+void EncodeTriangleStrip(InPointsT const & points,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutDeltasT & deltas);
+
+void DecodeTriangleStrip(InDeltasT const & deltas,
+ m2::PointU const & basePoint,
+ m2::PointU const & maxPoint,
+ OutPointsT & points);
+} // namespace coding
+
+namespace serial
+{
+class GeometryCodingParams
+{
+public:
+ GeometryCodingParams();
+ GeometryCodingParams(uint8_t coordBits, m2::PointD const & pt);
+ GeometryCodingParams(uint8_t coordBits, uint64_t basePointUint64);
+
+ m2::PointU GetBasePoint() const { return m_BasePoint; }
+ uint64_t GetBasePointUint64() const { return m_BasePointUint64; }
+ int64_t GetBasePointInt64() const { return static_cast<int64_t>(m_BasePointUint64); }
+
+ void SetBasePoint(m2::PointD const & pt);
+
+ uint32_t GetCoordBits() const { return m_CoordBits; }
+
+ template <typename WriterT>
+ void Save(WriterT & writer) const
+ {
+ WriteVarUint(writer, GetCoordBits());
+ WriteVarUint(writer, m_BasePointUint64);
+ }
+
+ template <typename SourceT>
+ void Load(SourceT & src)
+ {
+ uint32_t const coordBits = ReadVarUint<uint32_t>(src);
+ ASSERT_LESS(coordBits, 32, ());
+ *this = GeometryCodingParams(coordBits, ReadVarUint<uint64_t>(src));
+ }
+
+private:
+ uint64_t m_BasePointUint64;
+ m2::PointU m_BasePoint;
+ uint8_t m_CoordBits;
+};
+
+namespace pts
+{
+using PointsU = buffer_vector<m2::PointU, 32>;
+
+m2::PointU D2U(m2::PointD const & p, uint32_t coordBits);
+
+m2::PointD U2D(m2::PointU const & p, uint32_t coordBits);
+
+m2::PointU GetMaxPoint(GeometryCodingParams const & params);
+
+m2::PointU GetBasePoint(GeometryCodingParams const & params);
+} // namespace pts
+
+/// @name Encode and Decode function types.
+typedef void (*EncodeFunT)(coding::InPointsT const &, m2::PointU const &,
+ m2::PointU const &, coding::OutDeltasT &);
+typedef void (*DecodeFunT)(coding::InDeltasT const &, m2::PointU const &,
+ m2::PointU const &, coding::OutPointsT &);
+
+using DeltasT = buffer_vector<uint64_t, 32>;
+using OutPointsT = buffer_vector<m2::PointD, 32>;
+
+void Encode(EncodeFunT fn, std::vector<m2::PointD> const & points,
+ GeometryCodingParams const & params, DeltasT & deltas);
+
+/// @name Overloads for different out container types.
+void Decode(DecodeFunT fn, DeltasT const & deltas, GeometryCodingParams const & params,
+ OutPointsT & points, size_t reserveF = 1);
+void Decode(DecodeFunT fn, DeltasT const & deltas, GeometryCodingParams const & params,
+ std::vector<m2::PointD> & points, size_t reserveF = 1);
+
+template <class TDecodeFun, class TOutPoints>
+void DecodeImpl(TDecodeFun fn, DeltasT const & deltas, GeometryCodingParams const & params,
+ TOutPoints & points, size_t reserveF)
+{
+ size_t const count = deltas.size() * reserveF;
+
+ pts::PointsU upoints;
+ upoints.resize(count);
+
+ coding::OutPointsT adapt(upoints);
+ (*fn)(make_read_adapter(deltas), pts::GetBasePoint(params), pts::GetMaxPoint(params), adapt);
+
+ if (points.size() < 2)
+ {
+ // Do not call reserve when loading triangles - they are accumulated to one vector.
+ points.reserve(count);
+ }
+
+ std::transform(upoints.begin(), upoints.begin() + adapt.size(), std::back_inserter(points),
+ std::bind(&pts::U2D, std::placeholders::_1, params.GetCoordBits()));
+}
+
+template <class TSink>
+void SavePoint(TSink & sink, m2::PointD const & pt, GeometryCodingParams const & cp)
+{
+ WriteVarUint(sink, coding::EncodeDelta(PointDToPointU(pt, cp.GetCoordBits()), cp.GetBasePoint()));
+}
+
+template <class TSource>
+m2::PointD LoadPoint(TSource & src, GeometryCodingParams const & cp)
+{
+ m2::PointD const pt =
+ PointUToPointD(coding::DecodeDelta(ReadVarUint<uint64_t>(src), cp.GetBasePoint()), cp.GetCoordBits());
+ return pt;
+}
+
+template <class TSink>
+void SaveInner(EncodeFunT fn, std::vector<m2::PointD> const & points,
+ GeometryCodingParams const & params, TSink & sink)
+{
+ DeltasT deltas;
+ Encode(fn, points, params, deltas);
+ WriteVarUintArray(deltas, sink);
+}
+
+template <class TSink>
+void WriteBufferToSink(std::vector<char> const & buffer, TSink & sink)
+{
+ uint32_t const count = static_cast<uint32_t>(buffer.size());
+ WriteVarUint(sink, count);
+ sink.Write(&buffer[0], count);
+}
+
+template <class TSink>
+void SaveOuter(EncodeFunT fn, std::vector<m2::PointD> const & points,
+ GeometryCodingParams const & params, TSink & sink)
+{
+ DeltasT deltas;
+ Encode(fn, points, params, deltas);
+
+ std::vector<char> buffer;
+ MemWriter<std::vector<char>> writer(buffer);
+ WriteVarUintArray(deltas, writer);
+
+ WriteBufferToSink(buffer, sink);
+}
+
+void const * LoadInner(DecodeFunT fn, void const * pBeg, size_t count,
+ GeometryCodingParams const & params, OutPointsT & points);
+
+template <class TSource, class TPoints>
+void LoadOuter(DecodeFunT fn, TSource & src, GeometryCodingParams const & params,
+ TPoints & points, size_t reserveF = 1)
+{
+ uint32_t const count = ReadVarUint<uint32_t>(src);
+ std::vector<char> buffer(count);
+ char * p = &buffer[0];
+ src.Read(p, count);
+
+ DeltasT deltas;
+ deltas.reserve(count / 2);
+ ReadVarUint64Array(p, p + count, MakeBackInsertFunctor(deltas));
+
+ Decode(fn, deltas, params, points, reserveF);
+}
+
+/// @name Paths.
+template <class TSink>
+void SaveInnerPath(std::vector<m2::PointD> const & points,
+ GeometryCodingParams const & params, TSink & sink)
+{
+ SaveInner(&coding::EncodePolyline, points, params, sink);
+}
+
+template <class TSink>
+void SaveOuterPath(std::vector<m2::PointD> const & points,
+ GeometryCodingParams const & params, TSink & sink)
+{
+ SaveOuter(&coding::EncodePolyline, points, params, sink);
+}
+
+inline void const * LoadInnerPath(void const * pBeg, size_t count,
+ GeometryCodingParams const & params, OutPointsT & points)
+{
+ return LoadInner(&coding::DecodePolyline, pBeg, count, params, points);
+}
+
+template <class TSource, class TPoints>
+void LoadOuterPath(TSource & src, GeometryCodingParams const & params, TPoints & points)
+{
+ LoadOuter(&coding::DecodePolyline, src, params, points);
+}
+
+/// @name Triangles.
+template <class TSink>
+void SaveInnerTriangles(std::vector<m2::PointD> const & points,
+ GeometryCodingParams const & params, TSink & sink)
+{
+ SaveInner(&coding::EncodeTriangleStrip, points, params, sink);
+}
+
+inline void const * LoadInnerTriangles(void const * pBeg, size_t count,
+ GeometryCodingParams const & params,
+ OutPointsT & triangles)
+{
+ CHECK_GREATER_OR_EQUAL(count, 2, ());
+ triangles.clear();
+ OutPointsT points;
+ void const * res = LoadInner(&coding::DecodeTriangleStrip, pBeg, count, params, points);
+
+ triangles.reserve((count - 2) * 3);
+ for (size_t i = 2; i < count; ++i)
+ {
+ triangles.push_back(points[i - 2]);
+ triangles.push_back(points[i - 1]);
+ triangles.push_back(points[i]);
+ }
+ return res;
+}
+
+void DecodeTriangles(coding::InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, coding::OutPointsT & triangles);
+
+template <class TSource>
+void LoadOuterTriangles(TSource & src, GeometryCodingParams const & params,
+ OutPointsT & triangles)
+{
+ uint32_t const count = ReadVarUint<uint32_t>(src);
+
+ for (uint32_t i = 0; i < count; ++i)
+ LoadOuter(&DecodeTriangles, src, params, triangles, 3);
+}
+
+class TrianglesChainSaver
+{
+ using TPoint = m2::PointU;
+ using TEdge = tesselator::Edge;
+ using TBuffer = std::vector<char>;
+
+ TPoint m_base;
+ TPoint m_max;
+
+ std::list<TBuffer> m_buffers;
+
+public:
+ explicit TrianglesChainSaver(GeometryCodingParams const & params);
+
+ TPoint GetBasePoint() const { return m_base; }
+ TPoint GetMaxPoint() const { return m_max; }
+
+ void operator()(TPoint arr[3], std::vector<TEdge> edges);
+
+ size_t GetBufferSize() const
+ {
+ size_t sz = 0;
+ for (auto const & i : m_buffers)
+ sz += i.size();
+ return sz;
+ }
+
+ template <class TSink>
+ void Save(TSink & sink)
+ {
+ // Not necessary assumption that 3-bytes varuint
+ // is enough for triangle chains count.
+ size_t const count = m_buffers.size();
+ CHECK_LESS_OR_EQUAL(count, 0x1FFFFF, ());
+
+ WriteVarUint(sink, static_cast<uint32_t>(count));
+
+ std::for_each(m_buffers.begin(), m_buffers.end(),
+ std::bind(&WriteBufferToSink<TSink>, std::placeholders::_1, ref(sink)));
+ }
+};
+} // namespace serial
diff --git a/coding/tesselator_decl.hpp b/coding/tesselator_decl.hpp
new file mode 100644
index 0000000000..2e0e5e9b47
--- /dev/null
+++ b/coding/tesselator_decl.hpp
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "base/assert.hpp"
+
+#include <cstdint>
+
+namespace tesselator
+{
+// Edge of graph, built from triangles list.
+struct Edge
+{
+ int m_p[2]; // indexes of connected triangles (0 -> 1)
+ uint64_t m_delta; // delta of 1 - triangle from 0 - triangle
+
+ // intersected rib of 0 - triangle:
+ // - -1 - uninitialized or root edge
+ // - 0 - this edge intersects 1-2 rib;
+ // - 1 - this edge intersects 2-0 rib;
+ int8_t m_side;
+
+ Edge(int from, int to, uint64_t delta, char side) : m_delta(delta), m_side(side)
+ {
+ m_p[0] = from;
+ m_p[1] = to;
+ }
+};
+} // namespace tesselator
diff --git a/coding/varint.hpp b/coding/varint.hpp
index fe0090436f..8754c567ce 100644
--- a/coding/varint.hpp
+++ b/coding/varint.hpp
@@ -8,6 +8,7 @@
#include "base/exception.hpp"
#include "base/stl_add.hpp"
+#include <cstddef>
#include <type_traits>
/// This function writes, using optimal bytes count.
@@ -272,3 +273,9 @@ void const * ReadVarUint64Array(void const * pBeg, size_t count, F f)
return impl::ReadVarInt64Array(pBeg, impl::ReadVarInt64ArrayGivenSize(count), f, IdFunctor());
}
+template <class Cont, class Sink>
+inline void WriteVarUintArray(Cont const & v, Sink & sink)
+{
+ for (size_t i = 0; i != v.size(); ++i)
+ WriteVarUint(sink, v[i]);
+}
diff --git a/generator/borders_loader.cpp b/generator/borders_loader.cpp
index 1ab58f6636..dd4207838f 100644
--- a/generator/borders_loader.cpp
+++ b/generator/borders_loader.cpp
@@ -7,16 +7,15 @@
#include "storage/country_polygon.hpp"
-#include "indexer/geometry_serialization.hpp"
#include "indexer/scales.hpp"
-#include "geometry/mercator.hpp"
-
-#include "geometry/simplification.hpp"
-#include "geometry/distance.hpp"
#include "coding/file_container.hpp"
-#include "coding/read_write_utils.hpp"
#include "coding/file_name_utils.hpp"
+#include "coding/read_write_utils.hpp"
+
+#include "geometry/distance.hpp"
+#include "geometry/mercator.hpp"
+#include "geometry/simplification.hpp"
#include "base/exception.hpp"
#include "base/logging.hpp"
@@ -28,7 +27,6 @@
#include <iomanip>
#include <vector>
-
namespace borders
{
@@ -119,7 +117,7 @@ public:
{
// use index in vector as tag
FileWriter w = m_writer.GetWriter(strings::to_string(m_polys.size()));
- serial::CodingParams cp;
+ serial::GeometryCodingParams cp;
// calc rect
m2::RectD rect;
@@ -185,7 +183,7 @@ void UnpackBorders(std::string const & baseDir, std::string const & targetDir)
{
poly << i + 1 << endl;
std::vector<m2::PointD> points;
- serial::LoadOuterPath(src, serial::CodingParams(), points);
+ serial::LoadOuterPath(src, serial::GeometryCodingParams(), points);
for (auto p : points)
{
ms::LatLon const ll = MercatorBounds::ToLatLon(p);
diff --git a/generator/centers_table_builder.cpp b/generator/centers_table_builder.cpp
index 395513b1c0..feedd56558 100644
--- a/generator/centers_table_builder.cpp
+++ b/generator/centers_table_builder.cpp
@@ -52,7 +52,7 @@ bool BuildCentersTableFromDataFile(std::string const & filename, bool forceRebui
feature::DataHeader const header(rcont);
FeaturesVector const features(rcont, header, table.get());
- builder.SetCodingParams(header.GetDefCodingParams());
+ builder.SetGeometryCodingParams(header.GetDefGeometryCodingParams());
features.ForEach([&](FeatureType & ft, uint32_t featureId) {
builder.Put(featureId, feature::GetCenter(ft));
});
diff --git a/generator/dumper.cpp b/generator/dumper.cpp
index 3c1a1f8dae..cf0d0913d3 100644
--- a/generator/dumper.cpp
+++ b/generator/dumper.cpp
@@ -197,7 +197,7 @@ namespace feature
FilesContainerR container(make_unique<FileReader>(fPath));
feature::DataHeader header(container);
- serial::CodingParams codingParams(trie::GetCodingParams(header.GetDefCodingParams()));
+ serial::GeometryCodingParams codingParams(trie::GetGeometryCodingParams(header.GetDefGeometryCodingParams()));
auto const trieRoot = trie::ReadTrie<ModelReaderPtr, ValueList<TValue>>(
container.GetReader(SEARCH_INDEX_FILE_TAG), SingleValueSerializer<TValue>(codingParams));
diff --git a/generator/feature_builder.cpp b/generator/feature_builder.cpp
index 4a754684a1..2ccbdbf944 100644
--- a/generator/feature_builder.cpp
+++ b/generator/feature_builder.cpp
@@ -6,15 +6,14 @@
#include "routing_common/car_model.hpp"
#include "routing_common/pedestrian_model.hpp"
-#include "indexer/coding_params.hpp"
#include "indexer/feature_impl.hpp"
#include "indexer/feature_visibility.hpp"
-#include "indexer/geometry_serialization.hpp"
-
-#include "geometry/region2d.hpp"
#include "coding/bit_streams.hpp"
#include "coding/byte_stream.hpp"
+#include "coding/geometry_coding.hpp"
+
+#include "geometry/region2d.hpp"
#include "base/logging.hpp"
#include "base/string_utils.hpp"
@@ -364,7 +363,7 @@ bool FeatureBuilder1::CheckValid() const
return true;
}
-void FeatureBuilder1::SerializeBase(TBuffer & data, serial::CodingParams const & params, bool saveAddInfo) const
+void FeatureBuilder1::SerializeBase(TBuffer & data, serial::GeometryCodingParams const & params, bool saveAddInfo) const
{
PushBackByteSink<TBuffer> sink(data);
@@ -380,7 +379,7 @@ void FeatureBuilder1::Serialize(TBuffer & data) const
data.clear();
- serial::CodingParams cp;
+ serial::GeometryCodingParams cp;
SerializeBase(data, cp, true /* store additional info from FeatureParams */);
@@ -410,7 +409,7 @@ void FeatureBuilder1::Serialize(TBuffer & data) const
void FeatureBuilder1::Deserialize(TBuffer & data)
{
- serial::CodingParams cp;
+ serial::GeometryCodingParams cp;
ArrayByteSource source(&data[0]);
m_params.Read(source);
@@ -601,7 +600,7 @@ bool FeatureBuilder2::IsLocalityObject()
!m_params.house.IsEmpty();
}
-void FeatureBuilder2::SerializeLocalityObject(serial::CodingParams const & params,
+void FeatureBuilder2::SerializeLocalityObject(serial::GeometryCodingParams const & params,
SupportingData & data)
{
data.m_buffer.clear();
@@ -628,7 +627,7 @@ void FeatureBuilder2::SerializeLocalityObject(serial::CodingParams const & param
serial::SaveInnerTriangles(data.m_innerTrg, params, sink);
}
-void FeatureBuilder2::Serialize(SupportingData & data, serial::CodingParams const & params)
+void FeatureBuilder2::Serialize(SupportingData & data, serial::GeometryCodingParams const & params)
{
data.m_buffer.clear();
@@ -690,7 +689,7 @@ void FeatureBuilder2::Serialize(SupportingData & data, serial::CodingParams cons
// offsets was pushed from high scale index to low
reverse(data.m_ptsOffset.begin(), data.m_ptsOffset.end());
- serial::WriteVarUintArray(data.m_ptsOffset, sink);
+ WriteVarUintArray(data.m_ptsOffset, sink);
}
}
else if (type == GEOM_AREA)
@@ -701,7 +700,7 @@ void FeatureBuilder2::Serialize(SupportingData & data, serial::CodingParams cons
{
// offsets was pushed from high scale index to low
reverse(data.m_trgOffset.begin(), data.m_trgOffset.end());
- serial::WriteVarUintArray(data.m_trgOffset, sink);
+ WriteVarUintArray(data.m_trgOffset, sink);
}
}
}
diff --git a/generator/feature_builder.hpp b/generator/feature_builder.hpp
index 7bd1581263..4dae2cb51d 100644
--- a/generator/feature_builder.hpp
+++ b/generator/feature_builder.hpp
@@ -11,7 +11,10 @@
#include <list>
#include <string>
-namespace serial { class CodingParams; }
+namespace serial
+{
+class GeometryCodingParams;
+} // namespace serial
/// Used for serialization\deserialization of features during --generate_features.
class FeatureBuilder1
@@ -91,7 +94,7 @@ public:
/// @name Serialization.
//@{
void Serialize(TBuffer & data) const;
- void SerializeBase(TBuffer & data, serial::CodingParams const & params, bool saveAddInfo) const;
+ void SerializeBase(TBuffer & data, serial::GeometryCodingParams const & params, bool saveAddInfo) const;
void Deserialize(TBuffer & data);
//@}
@@ -255,8 +258,8 @@ public:
//@{
bool PreSerialize(SupportingData const & data);
bool IsLocalityObject();
- void SerializeLocalityObject(serial::CodingParams const & params, SupportingData & data);
- void Serialize(SupportingData & data, serial::CodingParams const & params);
+ void SerializeLocalityObject(serial::GeometryCodingParams const & params, SupportingData & data);
+ void Serialize(SupportingData & data, serial::GeometryCodingParams const & params);
//@}
feature::AddressData const & GetAddressData() const { return m_params.GetAddressData(); }
diff --git a/generator/feature_helpers.hpp b/generator/feature_helpers.hpp
index 77221bbc68..3943670653 100644
--- a/generator/feature_helpers.hpp
+++ b/generator/feature_helpers.hpp
@@ -1,10 +1,11 @@
#pragma once
+#include "coding/geometry_coding.hpp"
+
#include "geometry/distance.hpp"
#include "geometry/point2d.hpp"
#include "geometry/simplification.hpp"
-#include "indexer/coding_params.hpp"
#include "indexer/scales.hpp"
#include "base/assert.hpp"
@@ -40,7 +41,7 @@ private:
m2::PointD m_midAll;
size_t m_locCount = 0;
size_t m_allCount = 0;
- uint32_t m_coordBits = serial::CodingParams().GetCoordBits();
+ uint32_t m_coordBits = serial::GeometryCodingParams().GetCoordBits();
std::vector<CellAndOffset> m_vec;
};
diff --git a/generator/feature_sorter.cpp b/generator/feature_sorter.cpp
index 47c63cf4b8..86f2422869 100644
--- a/generator/feature_sorter.cpp
+++ b/generator/feature_sorter.cpp
@@ -7,29 +7,28 @@
#include "generator/region_meta.hpp"
#include "generator/tesselator.hpp"
-#include "defines.hpp"
-
#include "indexer/data_header.hpp"
#include "indexer/feature_impl.hpp"
#include "indexer/feature_processor.hpp"
#include "indexer/feature_visibility.hpp"
-#include "indexer/geometry_serialization.hpp"
#include "indexer/scales.hpp"
#include "indexer/scales_patch.hpp"
#include "platform/mwm_version.hpp"
-#include "geometry/polygon.hpp"
-
#include "coding/file_container.hpp"
#include "coding/file_name_utils.hpp"
#include "coding/internal/file_data.hpp"
+#include "geometry/polygon.hpp"
+
#include "base/assert.hpp"
#include "base/logging.hpp"
#include "base/scope_guard.hpp"
#include "base/string_utils.hpp"
+#include "defines.hpp"
+
#include <list>
#include <memory>
#include <vector>
@@ -280,7 +279,7 @@ public:
auto & buffer = holder.GetBuffer();
if (fb.PreSerialize(buffer))
{
- fb.Serialize(buffer, m_header.GetDefCodingParams());
+ fb.Serialize(buffer, m_header.GetDefGeometryCodingParams());
featureId = WriteFeatureBase(buffer.m_buffer, fb);
@@ -339,7 +338,7 @@ bool GenerateFinalFeatures(feature::GenerateInfo const & info, string const & na
coordBits -= ((scales::GetUpperScale() - scales::GetUpperWorldScale()) / 2);
// coding params
- header.SetCodingParams(serial::CodingParams(coordBits, midPoints.GetCenter()));
+ header.SetGeometryCodingParams(serial::GeometryCodingParams(coordBits, midPoints.GetCenter()));
// scales
if (isWorld)
diff --git a/generator/generator_tests/triangles_tree_coding_test.cpp b/generator/generator_tests/triangles_tree_coding_test.cpp
index c17cc95590..9074bbc97f 100644
--- a/generator/generator_tests/triangles_tree_coding_test.cpp
+++ b/generator/generator_tests/triangles_tree_coding_test.cpp
@@ -1,17 +1,14 @@
-#include "generator/tesselator.hpp"
+#include "testing/testing.hpp"
-#include "indexer/geometry_serialization.hpp"
-#include "indexer/coding_params.hpp"
+#include "generator/tesselator.hpp"
+#include "coding/geometry_coding.hpp"
#include "coding/pointd_to_pointu.hpp"
#include "coding/reader.hpp"
#include "coding/writer.hpp"
#include "geometry/mercator.hpp"
-#include "testing/testing.hpp"
-
-
namespace
{
typedef m2::PointD P;
@@ -59,7 +56,7 @@ namespace
for (size_t i = 0; i < countT; ++i)
info.Add(arrT[i][0], arrT[i][1], arrT[i][2]);
- serial::CodingParams cp;
+ serial::GeometryCodingParams cp;
serial::TrianglesChainSaver saver(cp);
tesselator::PointsInfo points;
diff --git a/generator/geometry_holder.hpp b/generator/geometry_holder.hpp
index 8d5606c422..1c87d5d7b6 100644
--- a/generator/geometry_holder.hpp
+++ b/generator/geometry_holder.hpp
@@ -5,13 +5,13 @@
#include "generator/feature_helpers.hpp"
#include "generator/tesselator.hpp"
+
#include "geometry/distance.hpp"
#include "geometry/point2d.hpp"
#include "geometry/polygon.hpp"
#include "geometry/simplification.hpp"
#include "indexer/data_header.hpp"
-#include "indexer/geometry_serialization.hpp"
#include <cstdint>
#include <functional>
@@ -156,7 +156,7 @@ private:
// outer path can have 2 points in small scale levels
ASSERT_GREATER(points.size(), 1, ());
- auto cp = m_header.GetCodingParams(i);
+ auto cp = m_header.GetGeometryCodingParams(i);
// Optimization: Store first point once in header for outer linear features.
cp.SetBasePoint(points[0]);
@@ -180,7 +180,7 @@ private:
return;
}
- auto const cp = m_header.GetCodingParams(i);
+ auto const cp = m_header.GetGeometryCodingParams(i);
serial::TrianglesChainSaver saver(cp);
diff --git a/generator/locality_sorter.cpp b/generator/locality_sorter.cpp
index 086236f693..f9f54672a4 100644
--- a/generator/locality_sorter.cpp
+++ b/generator/locality_sorter.cpp
@@ -3,7 +3,6 @@
#include "generator/geometry_holder.hpp"
#include "indexer/data_header.hpp"
-#include "indexer/geometry_serialization.hpp"
#include "indexer/scales.hpp"
#include "indexer/scales_patch.hpp"
@@ -111,7 +110,7 @@ public:
auto & buffer = holder.GetBuffer();
if (fb.PreSerialize(buffer))
{
- fb.SerializeLocalityObject(serial::CodingParams(), buffer);
+ fb.SerializeLocalityObject(serial::GeometryCodingParams(), buffer);
WriteFeatureBase(buffer.m_buffer, fb);
}
}
@@ -129,7 +128,7 @@ bool GenerateLocalityData(string const & featuresDir, string const & nodesFile,
string const & dataFile)
{
DataHeader header;
- header.SetCodingParams(serial::CodingParams());
+ header.SetGeometryCodingParams(serial::GeometryCodingParams());
header.SetScales({scales::GetUpperScale()});
set<uint64_t> nodeIds;
diff --git a/generator/routing_index_generator.cpp b/generator/routing_index_generator.cpp
index 161a38c9be..5a8c64c6b0 100644
--- a/generator/routing_index_generator.cpp
+++ b/generator/routing_index_generator.cpp
@@ -20,13 +20,13 @@
#include "transit/transit_graph_data.hpp"
#include "transit/transit_serdes.hpp"
-#include "indexer/coding_params.hpp"
#include "indexer/data_header.hpp"
#include "indexer/feature.hpp"
#include "indexer/feature_processor.hpp"
#include "coding/file_container.hpp"
#include "coding/file_name_utils.hpp"
+#include "coding/geometry_coding.hpp"
#include "coding/point_to_integer.hpp"
#include "coding/pointd_to_pointu.hpp"
#include "coding/reader.hpp"
@@ -444,10 +444,10 @@ void FillWeights(string const & path, string const & mwmFile, string const & cou
foundCount, ", not found:", notFoundCount));
}
-serial::CodingParams LoadCodingParams(string const & mwmFile)
+serial::GeometryCodingParams LoadGeometryCodingParams(string const & mwmFile)
{
DataHeader const dataHeader(mwmFile);
- return dataHeader.GetDefCodingParams();
+ return dataHeader.GetDefGeometryCodingParams();
}
} // namespace
@@ -492,7 +492,7 @@ void SerializeCrossMwm(string const & mwmFile, string const & sectionName,
CrossMwmConnectorPerVehicleType<CrossMwmId> const & connectors,
vector<CrossMwmConnectorSerializer::Transition<CrossMwmId>> const & transitions)
{
- serial::CodingParams const codingParams = LoadCodingParams(mwmFile);
+ serial::GeometryCodingParams const codingParams = LoadGeometryCodingParams(mwmFile);
FilesContainerW cont(mwmFile, FileWriter::OP_WRITE_EXISTING);
auto writer = cont.GetWriter(sectionName);
auto const startPos = writer.Pos();
diff --git a/generator/search_index_builder.cpp b/generator/search_index_builder.cpp
index 77c8db295d..b6a8c6690e 100644
--- a/generator/search_index_builder.cpp
+++ b/generator/search_index_builder.cpp
@@ -469,7 +469,7 @@ void BuildSearchIndex(FilesContainerR & container, Writer & indexWriter)
CategoriesHolder categoriesHolder(platform.GetReader(SEARCH_CATEGORIES_FILE_NAME));
FeaturesVectorTest features(container);
- auto codingParams = trie::GetCodingParams(features.GetHeader().GetDefCodingParams());
+ auto codingParams = trie::GetGeometryCodingParams(features.GetHeader().GetDefGeometryCodingParams());
SingleValueSerializer<Value> serializer(codingParams);
vector<pair<Key, Value>> searchIndexKeyValuePairs;
diff --git a/generator/tesselator.cpp b/generator/tesselator.cpp
index 7667e1ccd4..fe259d2060 100644
--- a/generator/tesselator.cpp
+++ b/generator/tesselator.cpp
@@ -1,11 +1,10 @@
#include "generator/tesselator.hpp"
-#include "indexer/geometry_coding.hpp"
+#include "coding/geometry_coding.hpp"
+#include "coding/writer.hpp"
#include "geometry/robust_orientation.hpp"
-#include "coding/writer.hpp"
-
#include "base/assert.hpp"
#include "base/logging.hpp"
@@ -15,7 +14,6 @@
#include "3party/libtess2/Include/tesselator.h"
-
namespace tesselator
{
int TesselateInterior(PolygonsT const & polys, TrianglesInfo & info)
@@ -102,10 +100,10 @@ int TesselateInterior(PolygonsT const & polys, TrianglesInfo & info)
m_neighbors.find(std::make_pair(i->first.second, i->first.first)) == m_neighbors.end())
{
uint64_t deltas[3];
- deltas[0] = EncodeDelta(points.m_points[i->first.first], points.m_base);
- deltas[1] = EncodeDelta(points.m_points[i->first.second], points.m_points[i->first.first]);
- deltas[2] = EncodeDelta(points.m_points[m_triangles[i->second].GetPoint3(i->first)],
- points.m_points[i->first.second]);
+ deltas[0] = coding::EncodeDelta(points.m_points[i->first.first], points.m_base);
+ deltas[1] = coding::EncodeDelta(points.m_points[i->first.second], points.m_points[i->first.first]);
+ deltas[2] = coding::EncodeDelta(points.m_points[m_triangles[i->second].GetPoint3(i->first)],
+ points.m_points[i->first.second]);
size_t const sz = GetBufferSize(deltas, deltas + 3);
if (sz < cr)
@@ -161,7 +159,7 @@ int TesselateInterior(PolygonsT const & polys, TrianglesInfo & info)
std::pair<int, int> const p = CommonEdge(to, from);
m2::PointU const prediction =
- PredictPointInTriangle(points.m_max,
+ coding::PredictPointInTriangle(points.m_max,
// common edge with 'to'
points.m_points[from.m_p[(p.second+1) % 3]],
points.m_points[from.m_p[(p.second)]],
@@ -169,7 +167,7 @@ int TesselateInterior(PolygonsT const & polys, TrianglesInfo & info)
points.m_points[from.m_p[(p.second+2) % 3]]);
// delta from prediction to diagonal point of 'to'
- return EncodeDelta(points.m_points[to.m_p[(p.first+2) % 3]], prediction);
+ return coding::EncodeDelta(points.m_points[to.m_p[(p.first+2) % 3]], prediction);
}
template <class TPopOrder>
diff --git a/generator/tesselator.hpp b/generator/tesselator.hpp
index 9375e0de62..c1b385ffdc 100644
--- a/generator/tesselator.hpp
+++ b/generator/tesselator.hpp
@@ -1,5 +1,6 @@
#pragma once
-#include "indexer/tesselator_decl.hpp"
+
+#include "coding/tesselator_decl.hpp"
#include "geometry/point2d.hpp"
@@ -10,7 +11,6 @@
#include <utility>
#include <vector>
-
namespace tesselator
{
typedef std::vector<m2::PointD> PointsT;
diff --git a/indexer/CMakeLists.txt b/indexer/CMakeLists.txt
index 109de339bb..099910e5f9 100644
--- a/indexer/CMakeLists.txt
+++ b/indexer/CMakeLists.txt
@@ -22,8 +22,6 @@ set(
classificator_loader.cpp
classificator_loader.hpp
classificator.hpp
- coding_params.cpp
- coding_params.hpp
cuisines.cpp
cuisines.hpp
data_factory.cpp
@@ -80,10 +78,6 @@ set(
ftypes_matcher.hpp
ftypes_sponsored.cpp
ftypes_sponsored.hpp
- geometry_coding.cpp
- geometry_coding.hpp
- geometry_serialization.cpp
- geometry_serialization.hpp
index_builder.cpp
index_builder.hpp
index_helpers.cpp
@@ -129,7 +123,6 @@ set(
string_slice.hpp
succinct_trie_builder.hpp
succinct_trie_reader.hpp
- tesselator_decl.hpp
tree_structure.hpp
trie_builder.hpp
trie_reader.hpp
diff --git a/indexer/centers_table.cpp b/indexer/centers_table.cpp
index 0b863e190d..3ffed0a8b2 100644
--- a/indexer/centers_table.cpp
+++ b/indexer/centers_table.cpp
@@ -1,10 +1,10 @@
#include "indexer/centers_table.hpp"
#include "indexer/feature_processor.hpp"
-#include "indexer/geometry_coding.hpp"
#include "coding/endianness.hpp"
#include "coding/file_container.hpp"
+#include "coding/geometry_coding.hpp"
#include "coding/memory_region.hpp"
#include "coding/pointd_to_pointu.hpp"
#include "coding/reader.hpp"
@@ -133,7 +133,7 @@ public:
static_assert(sizeof(Header) == 16, "Wrong header size.");
- CentersTableV0(Reader & reader, serial::CodingParams const & codingParams)
+ CentersTableV0(Reader & reader, serial::GeometryCodingParams const & codingParams)
: m_reader(reader), m_codingParams(codingParams)
{
}
@@ -165,12 +165,12 @@ public:
NonOwningReaderSource msource(mreader);
uint64_t delta = ReadVarUint<uint64_t>(msource);
- entry[0] = DecodeDelta(delta, m_codingParams.GetBasePoint());
+ entry[0] = coding::DecodeDelta(delta, m_codingParams.GetBasePoint());
for (size_t i = 1; i < kBlockSize && msource.Size() > 0; ++i)
{
delta = ReadVarUint<uint64_t>(msource);
- entry[i] = DecodeDelta(delta, entry[i - 1]);
+ entry[i] = coding::DecodeDelta(delta, entry[i - 1]);
}
}
@@ -213,7 +213,7 @@ private:
private:
Header m_header;
Reader & m_reader;
- serial::CodingParams const m_codingParams;
+ serial::GeometryCodingParams const m_codingParams;
unique_ptr<CopiedMemoryRegion> m_idsRegion;
unique_ptr<CopiedMemoryRegion> m_offsetsRegion;
@@ -248,7 +248,7 @@ bool CentersTable::Header::IsValid() const
// CentersTable ------------------------------------------------------------------------------------
unique_ptr<CentersTable> CentersTable::Load(Reader & reader,
- serial::CodingParams const & codingParams)
+ serial::GeometryCodingParams const & codingParams)
{
uint16_t const version = ReadPrimitiveFromPos<uint16_t>(reader, 0 /* pos */);
if (version != 0)
@@ -300,11 +300,11 @@ void CentersTableBuilder::Freeze(Writer & writer) const
{
offsets.push_back(static_cast<uint32_t>(deltas.size()));
- uint64_t delta = EncodeDelta(m_centers[i], m_codingParams.GetBasePoint());
+ uint64_t delta = coding::EncodeDelta(m_centers[i], m_codingParams.GetBasePoint());
WriteVarUint(writer, delta);
for (size_t j = i + 1; j < i + CentersTableV0::kBlockSize && j < m_centers.size(); ++j)
{
- delta = EncodeDelta(m_centers[j], m_centers[j - 1]);
+ delta = coding::EncodeDelta(m_centers[j], m_centers[j - 1]);
WriteVarUint(writer, delta);
}
}
diff --git a/indexer/centers_table.hpp b/indexer/centers_table.hpp
index ee223368b3..68e151c614 100644
--- a/indexer/centers_table.hpp
+++ b/indexer/centers_table.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "indexer/coding_params.hpp"
+#include "coding/geometry_coding.hpp"
#include "geometry/point2d.hpp"
@@ -53,7 +53,7 @@ public:
// Loads CentersTable instance. Note that |reader| must be alive
// until the destruction of loaded table. Returns nullptr if
// CentersTable can't be loaded.
- static unique_ptr<CentersTable> Load(Reader & reader, serial::CodingParams const & codingParams);
+ static unique_ptr<CentersTable> Load(Reader & reader, serial::GeometryCodingParams const & codingParams);
private:
virtual bool Init() = 0;
@@ -62,7 +62,7 @@ private:
class CentersTableBuilder
{
public:
- inline void SetCodingParams(serial::CodingParams const & codingParams)
+ inline void SetGeometryCodingParams(serial::GeometryCodingParams const & codingParams)
{
m_codingParams = codingParams;
}
@@ -71,7 +71,7 @@ public:
void Freeze(Writer & writer) const;
private:
- serial::CodingParams m_codingParams;
+ serial::GeometryCodingParams m_codingParams;
vector<m2::PointU> m_centers;
vector<uint32_t> m_ids;
diff --git a/indexer/cities_boundaries_serdes.hpp b/indexer/cities_boundaries_serdes.hpp
index e42eb6e36a..9e3456d49f 100644
--- a/indexer/cities_boundaries_serdes.hpp
+++ b/indexer/cities_boundaries_serdes.hpp
@@ -1,11 +1,10 @@
#pragma once
#include "indexer/city_boundary.hpp"
-#include "indexer/coding_params.hpp"
-#include "indexer/geometry_coding.hpp"
#include "coding/bit_streams.hpp"
#include "coding/elias_coder.hpp"
+#include "coding/geometry_coding.hpp"
#include "coding/pointd_to_pointu.hpp"
#include "coding/reader.hpp"
#include "coding/varint.hpp"
@@ -40,7 +39,7 @@ public:
struct Visitor
{
public:
- Visitor(Sink & sink, serial::CodingParams const & params)
+ Visitor(Sink & sink, serial::GeometryCodingParams const & params)
: m_sink(sink), m_params(params), m_last(params.GetBasePoint())
{
}
@@ -49,7 +48,7 @@ public:
void operator()(m2::PointU const & p)
{
- WriteVarUint(m_sink, ::EncodeDelta(p, m_last));
+ WriteVarUint(m_sink, coding::EncodeDelta(p, m_last));
m_last = p;
}
@@ -156,11 +155,11 @@ public:
}
Sink & m_sink;
- serial::CodingParams m_params;
+ serial::GeometryCodingParams m_params;
m2::PointU m_last;
};
- CitiesBoundariesEncoder(Sink & sink, serial::CodingParams const & params)
+ CitiesBoundariesEncoder(Sink & sink, serial::GeometryCodingParams const & params)
: m_sink(sink), m_visitor(sink, params)
{
}
@@ -200,7 +199,7 @@ public:
struct Visitor
{
public:
- Visitor(Source & source, serial::CodingParams const & params)
+ Visitor(Source & source, serial::GeometryCodingParams const & params)
: m_source(source), m_params(params), m_last(params.GetBasePoint())
{
}
@@ -214,7 +213,7 @@ public:
void operator()(m2::PointU & p)
{
- p = ::DecodeDelta(ReadVarUint<uint64_t>(m_source), m_last);
+ p = coding::DecodeDelta(ReadVarUint<uint64_t>(m_source), m_last);
m_last = p;
}
@@ -293,11 +292,11 @@ public:
}
Source & m_source;
- serial::CodingParams const m_params;
+ serial::GeometryCodingParams const m_params;
m2::PointU m_last;
};
- CitiesBoundariesDecoderV0(Source & source, serial::CodingParams const & params)
+ CitiesBoundariesDecoderV0(Source & source, serial::GeometryCodingParams const & params)
: m_source(source), m_visitor(source, params)
{
}
@@ -399,7 +398,7 @@ struct CitiesBoundariesSerDes
HeaderV0 const header;
visitor(header);
- serial::CodingParams const params(header.m_coordBits,
+ serial::GeometryCodingParams const params(header.m_coordBits,
m2::PointD(MercatorBounds::minX, MercatorBounds::minY));
CitiesBoundariesEncoder<Sink> encoder(sink, params);
encoder(boundaries);
@@ -423,7 +422,7 @@ struct CitiesBoundariesSerDes
auto const wy = MercatorBounds::maxY - MercatorBounds::minY;
precision = std::max(wx, wy) / pow(2, header.m_coordBits);
- serial::CodingParams const params(header.m_coordBits,
+ serial::GeometryCodingParams const params(header.m_coordBits,
m2::PointD(MercatorBounds::minX, MercatorBounds::minY));
CitiesBoundariesDecoderV0<Source> decoder(source, params);
decoder(boundaries);
diff --git a/indexer/coding_params.cpp b/indexer/coding_params.cpp
deleted file mode 100644
index f9d37783e1..0000000000
--- a/indexer/coding_params.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "indexer/coding_params.hpp"
-
-#include "coding/point_to_integer.hpp"
-#include "coding/pointd_to_pointu.hpp"
-
-namespace serial
-{
- CodingParams::CodingParams()
- : m_BasePointUint64(0), m_CoordBits(POINT_COORD_BITS)
- {
- m_BasePoint = Uint64ToPointUObsolete(m_BasePointUint64);
- }
-
- CodingParams::CodingParams(uint8_t coordBits, m2::PointD const & pt)
- : m_CoordBits(coordBits)
- {
- SetBasePoint(pt);
- }
-
- CodingParams::CodingParams(uint8_t coordBits, uint64_t basePointUint64)
- : m_BasePointUint64(basePointUint64), m_CoordBits(coordBits)
- {
- m_BasePoint = Uint64ToPointUObsolete(m_BasePointUint64);
- }
-
- void CodingParams::SetBasePoint(m2::PointD const & pt)
- {
- m_BasePoint = PointDToPointU(pt, m_CoordBits);
- m_BasePointUint64 = PointUToUint64Obsolete(m_BasePoint);
- }
-} // namespace serial
diff --git a/indexer/coding_params.hpp b/indexer/coding_params.hpp
deleted file mode 100644
index b836b6a09c..0000000000
--- a/indexer/coding_params.hpp
+++ /dev/null
@@ -1,51 +0,0 @@
-#pragma once
-
-#include "geometry/point2d.hpp"
-
-#include "coding/varint.hpp"
-
-namespace serial
-{
- class CodingParams
- {
- public:
- /// @todo: Factor out?
- //@{
- CodingParams();
- CodingParams(uint8_t coordBits, m2::PointD const & pt);
- CodingParams(uint8_t coordBits, uint64_t basePointUint64);
- //@}
-
- /// @todo: Factor out.
- //@{
- inline m2::PointU GetBasePoint() const { return m_BasePoint; }
- inline uint64_t GetBasePointUint64() const { return m_BasePointUint64; }
- inline int64_t GetBasePointInt64() const
- {
- return static_cast<int64_t>(m_BasePointUint64);
- }
-
- void SetBasePoint(m2::PointD const & pt);
- //@}
-
- inline uint32_t GetCoordBits() const { return m_CoordBits; }
-
- template <typename WriterT> void Save(WriterT & writer) const
- {
- WriteVarUint(writer, GetCoordBits());
- WriteVarUint(writer, m_BasePointUint64);
- }
-
- template <typename SourceT> void Load(SourceT & src)
- {
- uint32_t const coordBits = ReadVarUint<uint32_t>(src);
- ASSERT_LESS(coordBits, 32, ());
- *this = CodingParams(coordBits, ReadVarUint<uint64_t>(src));
- }
-
- private:
- uint64_t m_BasePointUint64;
- m2::PointU m_BasePoint;
- uint8_t m_CoordBits;
- };
-} // namespace serial
diff --git a/indexer/data_header.cpp b/indexer/data_header.cpp
index 400fc001ab..030950ce63 100644
--- a/indexer/data_header.cpp
+++ b/indexer/data_header.cpp
@@ -25,9 +25,9 @@ namespace feature
Load(cont);
}
- serial::CodingParams DataHeader::GetCodingParams(int scaleIndex) const
+ serial::GeometryCodingParams DataHeader::GetGeometryCodingParams(int scaleIndex) const
{
- return serial::CodingParams(m_codingParams.GetCoordBits() -
+ return serial::GeometryCodingParams(m_codingParams.GetCoordBits() -
(m_scales.back() - m_scales[scaleIndex]) / 2,
m_codingParams.GetBasePointUint64());
}
@@ -144,7 +144,7 @@ namespace feature
{
ReaderSource<ModelReaderPtr> src(r);
int64_t const base = ReadPrimitiveFromSource<int64_t>(src);
- m_codingParams = serial::CodingParams(POINT_COORD_BITS, base);
+ m_codingParams = serial::GeometryCodingParams(POINT_COORD_BITS, base);
m_bounds.first = ReadVarInt<int64_t>(src) + base;
m_bounds.second = ReadVarInt<int64_t>(src) + base;
diff --git a/indexer/data_header.hpp b/indexer/data_header.hpp
index 42e751ded7..7bcd036399 100644
--- a/indexer/data_header.hpp
+++ b/indexer/data_header.hpp
@@ -1,16 +1,15 @@
#pragma once
-#include "indexer/coding_params.hpp"
-
#include "platform/mwm_version.hpp"
+#include "coding/geometry_coding.hpp"
+
#include "geometry/rect2d.hpp"
#include "base/buffer_vector.hpp"
#include "std/utility.hpp"
-
class FilesContainerR;
class FileWriter;
class ModelReaderPtr;
@@ -24,7 +23,7 @@ namespace feature
static const size_t MAX_SCALES_COUNT = 4;
private:
- serial::CodingParams m_codingParams;
+ serial::GeometryCodingParams m_codingParams;
pair<int64_t, int64_t> m_bounds;
@@ -36,15 +35,15 @@ namespace feature
explicit DataHeader(string const & fileName);
explicit DataHeader(FilesContainerR const & cont);
- inline void SetCodingParams(serial::CodingParams const & cp)
+ inline void SetGeometryCodingParams(serial::GeometryCodingParams const & cp)
{
m_codingParams = cp;
}
- inline serial::CodingParams const & GetDefCodingParams() const
+ inline serial::GeometryCodingParams const & GetDefGeometryCodingParams() const
{
return m_codingParams;
}
- serial::CodingParams GetCodingParams(int scaleIndex) const;
+ serial::GeometryCodingParams GetGeometryCodingParams(int scaleIndex) const;
m2::RectD const GetBounds() const;
void SetBounds(m2::RectD const & r);
diff --git a/indexer/feature_loader.cpp b/indexer/feature_loader.cpp
index c5ea2f5149..14beac5e6f 100644
--- a/indexer/feature_loader.cpp
+++ b/indexer/feature_loader.cpp
@@ -1,7 +1,7 @@
+#include "indexer/feature_loader.hpp"
+
#include "indexer/classificator.hpp"
#include "indexer/feature.hpp"
-#include "indexer/feature_loader.hpp"
-#include "indexer/geometry_serialization.hpp"
#include "indexer/scales.hpp"
#include "coding/byte_stream.hpp"
@@ -17,7 +17,6 @@
namespace feature
{
-
uint8_t LoaderCurrent::GetHeader()
{
return Header();
@@ -45,7 +44,7 @@ void LoaderCurrent::ParseCommon()
if (m_pF->GetFeatureType() == GEOM_POINT)
{
- m_pF->m_center = serial::LoadPoint(source, GetDefCodingParams());
+ m_pF->m_center = serial::LoadPoint(source, GetDefGeometryCodingParams());
m_pF->m_limitRect.Add(m_pF->m_center);
}
@@ -122,7 +121,7 @@ void LoaderCurrent::ParseHeader2()
ArrayByteSource src(bitSource.RoundPtr());
- serial::CodingParams const & cp = GetDefCodingParams();
+ serial::GeometryCodingParams const & cp = GetDefGeometryCodingParams();
if (typeMask == HEADER_GEOM_LINE)
{
@@ -186,7 +185,7 @@ uint32_t LoaderCurrent::ParseGeometry(int scale)
ReaderSource<FilesContainerR::TReader> src(m_Info.GetGeometryReader(ind));
src.Skip(m_ptsOffsets[ind]);
- serial::CodingParams cp = GetCodingParams(ind);
+ serial::GeometryCodingParams cp = GetGeometryCodingParams(ind);
cp.SetBasePoint(m_pF->m_points[0]);
serial::LoadOuterPath(src, cp, m_pF->m_points);
@@ -233,7 +232,7 @@ uint32_t LoaderCurrent::ParseTriangles(int scale)
{
ReaderSource<FilesContainerR::TReader> src(m_Info.GetTrianglesReader(ind));
src.Skip(m_trgOffsets[ind]);
- serial::LoadOuterTriangles(src, GetCodingParams(ind), m_pF->m_triangles);
+ serial::LoadOuterTriangles(src, GetGeometryCodingParams(ind), m_pF->m_triangles);
sz = static_cast<uint32_t>(src.Pos() - m_trgOffsets[ind]);
}
@@ -344,5 +343,4 @@ int LoaderCurrent::GetScaleIndex(int scale, offsets_t const & offsets) const
return -1;
}
}
-
-}
+} // namespace feature
diff --git a/indexer/feature_loader_base.hpp b/indexer/feature_loader_base.hpp
index cb2618c112..3b5d40b25a 100644
--- a/indexer/feature_loader_base.hpp
+++ b/indexer/feature_loader_base.hpp
@@ -1,12 +1,12 @@
#pragma once
-#include "indexer/coding_params.hpp"
+
#include "indexer/data_header.hpp"
#include "coding/file_container.hpp"
+#include "coding/geometry_coding.hpp"
#include "std/noncopyable.hpp"
-
class FeatureType;
class ArrayByteSource;
@@ -40,13 +40,13 @@ namespace feature
inline version::Format GetMWMFormat() const { return m_header.GetFormat(); }
- inline serial::CodingParams const & GetDefCodingParams() const
+ inline serial::GeometryCodingParams const & GetDefGeometryCodingParams() const
{
- return m_header.GetDefCodingParams();
+ return m_header.GetDefGeometryCodingParams();
}
- inline serial::CodingParams GetCodingParams(int scaleIndex) const
+ inline serial::GeometryCodingParams GetGeometryCodingParams(int scaleIndex) const
{
- return m_header.GetCodingParams(scaleIndex);
+ return m_header.GetGeometryCodingParams(scaleIndex);
}
inline int GetScalesCount() const { return static_cast<int>(m_header.GetScalesCount()); }
@@ -87,13 +87,13 @@ namespace feature
uint32_t CalcOffset(ArrayByteSource const & source) const;
- inline serial::CodingParams const & GetDefCodingParams() const
+ inline serial::GeometryCodingParams const & GetDefGeometryCodingParams() const
{
- return m_Info.GetDefCodingParams();
+ return m_Info.GetDefGeometryCodingParams();
}
- inline serial::CodingParams GetCodingParams(int scaleIndex) const
+ inline serial::GeometryCodingParams GetGeometryCodingParams(int scaleIndex) const
{
- return m_Info.GetCodingParams(scaleIndex);
+ return m_Info.GetGeometryCodingParams(scaleIndex);
}
uint8_t Header() const { return static_cast<uint8_t>(*DataPtr()); }
diff --git a/indexer/geometry_coding.cpp b/indexer/geometry_coding.cpp
deleted file mode 100644
index f3d68172c5..0000000000
--- a/indexer/geometry_coding.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-#include "indexer/geometry_coding.hpp"
-
-#include "base/assert.hpp"
-#include "base/stl_add.hpp"
-
-#include "std/complex.hpp"
-#include "std/vector.hpp"
-
-
-namespace
-{
- inline m2::PointU ClampPoint(m2::PointU const & maxPoint, m2::Point<double> const & point)
- {
- typedef m2::PointU::value_type uvalue_t;
- //return m2::PointU(my::clamp(static_cast<uvalue_t>(point.x), static_cast<uvalue_t>(0), maxPoint.x),
- // my::clamp(static_cast<uvalue_t>(point.y), static_cast<uvalue_t>(0), maxPoint.y));
-
- return m2::PointU(static_cast<uvalue_t>(my::clamp(point.x, 0.0, static_cast<double>(maxPoint.x))),
- static_cast<uvalue_t>(my::clamp(point.y, 0.0, static_cast<double>(maxPoint.y))));
- }
-}
-
-m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2)
-{
- // return ClampPoint(maxPoint, m2::PointI64(p1) + m2::PointI64(p1) - m2::PointI64(p2));
- // return ClampPoint(maxPoint, m2::PointI64(p1) + (m2::PointI64(p1) - m2::PointI64(p2)) / 2);
- return ClampPoint(maxPoint, m2::PointD(p1) + (m2::PointD(p1) - m2::PointD(p2)) / 2.0);
-}
-
-m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2,
- m2::PointU const & p3)
-{
- CHECK_NOT_EQUAL(p2, p3, ());
-
- complex<double> const c1(p1.x, p1.y);
- complex<double> const c2(p2.x, p2.y);
- complex<double> const c3(p3.x, p3.y);
- complex<double> const d = (c1 - c2) / (c2 - c3);
- complex<double> const c0 = c1 + (c1 - c2) * polar(0.5, 0.5 * arg(d));
-
- /*
- complex<double> const c1(p1.x, p1.y);
- complex<double> const c2(p2.x, p2.y);
- complex<double> const c3(p3.x, p3.y);
- complex<double> const d = (c1 - c2) / (c2 - c3);
- complex<double> const c01 = c1 + (c1 - c2) * polar(0.5, arg(d));
- complex<double> const c02 = c1 + (c1 - c2) * complex<double>(0.5, 0.0);
- complex<double> const c0 = (c01 + c02) * complex<double>(0.5, 0.0);
- */
-
- return ClampPoint(maxPoint, m2::PointD(c0.real(), c0.imag()));
-}
-
-m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2,
- m2::PointU const & p3)
-{
- // parallelogram prediction
- return ClampPoint(maxPoint, p1 + p2 - p3);
-}
-
-
-namespace geo_coding
-{
- bool TestDecoding(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT const & deltas,
- void (* fnDecode)(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points))
- {
- size_t const count = points.size();
-
- vector<m2::PointU> decoded;
- decoded.resize(count);
-
- OutPointsT decodedA(decoded);
- fnDecode(make_read_adapter(deltas), basePoint, maxPoint, decodedA);
-
- for (size_t i = 0; i < count; ++i)
- ASSERT_EQUAL(points[i], decoded[i], ());
- return true;
- }
-
-void EncodePolylinePrev1(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas)
-{
- size_t const count = points.size();
- if (count > 0)
- {
- deltas.push_back(EncodeDelta(points[0], basePoint));
- for (size_t i = 1; i < count; ++i)
- deltas.push_back(EncodeDelta(points[i], points[i-1]));
- }
-
- ASSERT(TestDecoding(points, basePoint, maxPoint, deltas, &DecodePolylinePrev1), ());
-}
-
-void DecodePolylinePrev1(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & /*maxPoint*/,
- OutPointsT & points)
-{
- size_t const count = deltas.size();
- if (count > 0)
- {
- points.push_back(DecodeDelta(deltas[0], basePoint));
- for (size_t i = 1; i < count; ++i)
- points.push_back(DecodeDelta(deltas[i], points.back()));
- }
-}
-
-void EncodePolylinePrev2(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas)
-{
- size_t const count = points.size();
- if (count > 0)
- {
- deltas.push_back(EncodeDelta(points[0], basePoint));
- if (count > 1)
- {
- deltas.push_back(EncodeDelta(points[1], points[0]));
- for (size_t i = 2; i < count; ++i)
- deltas.push_back(EncodeDelta(points[i],
- PredictPointInPolyline(maxPoint, points[i-1], points[i-2])));
- }
- }
-
- ASSERT(TestDecoding(points, basePoint, maxPoint, deltas, &DecodePolylinePrev2), ());
-}
-
-void DecodePolylinePrev2(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points)
-{
- size_t const count = deltas.size();
- if (count > 0)
- {
- points.push_back(DecodeDelta(deltas[0], basePoint));
- if (count > 1)
- {
- points.push_back(DecodeDelta(deltas[1], points.back()));
- for (size_t i = 2; i < count; ++i)
- {
- size_t const n = points.size();
- points.push_back(DecodeDelta(deltas[i],
- PredictPointInPolyline(maxPoint, points[n-1], points[n-2])));
- }
- }
- }
-}
-
-void EncodePolylinePrev3(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas)
-{
- ASSERT_LESS_OR_EQUAL(basePoint.x, maxPoint.x, (basePoint, maxPoint));
- ASSERT_LESS_OR_EQUAL(basePoint.y, maxPoint.y, (basePoint, maxPoint));
-
- size_t const count = points.size();
- if (count > 0)
- {
- deltas.push_back(EncodeDelta(points[0], basePoint));
- if (count > 1)
- {
- deltas.push_back(EncodeDelta(points[1], points[0]));
- if (count > 2)
- {
- m2::PointU const prediction = PredictPointInPolyline(maxPoint, points[1], points[0]);
- deltas.push_back(EncodeDelta(points[2], prediction));
- for (size_t i = 3; i < count; ++i)
- {
- m2::PointU const prediction =
- PredictPointInPolyline(maxPoint, points[i-1], points[i-2], points[i-3]);
- deltas.push_back(EncodeDelta(points[i], prediction));
- }
- }
- }
- }
-
- ASSERT(TestDecoding(points, basePoint, maxPoint, deltas, &DecodePolylinePrev3), ());
-}
-
-void DecodePolylinePrev3(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points)
-{
- ASSERT_LESS_OR_EQUAL(basePoint.x, maxPoint.x, (basePoint, maxPoint));
- ASSERT_LESS_OR_EQUAL(basePoint.y, maxPoint.y, (basePoint, maxPoint));
-
- size_t const count = deltas.size();
- if (count> 0)
- {
- points.push_back(DecodeDelta(deltas[0], basePoint));
- if (count > 1)
- {
- m2::PointU const pt0 = points.back();
- points.push_back(DecodeDelta(deltas[1], pt0));
- if (count > 2)
- {
- points.push_back(DecodeDelta(deltas[2],
- PredictPointInPolyline(maxPoint, points.back(), pt0)));
- for (size_t i = 3; i < count; ++i)
- {
- size_t const n = points.size();
- m2::PointU const prediction =
- PredictPointInPolyline(maxPoint, points[n-1], points[n-2], points[n-3]);
- points.push_back(DecodeDelta(deltas[i], prediction));
- }
- }
- }
- }
-}
-
-void EncodeTriangleStrip(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas)
-{
- size_t const count = points.size();
- if (count > 0)
- {
- ASSERT_GREATER(count, 2, ());
-
- deltas.push_back(EncodeDelta(points[0], basePoint));
- deltas.push_back(EncodeDelta(points[1], points[0]));
- deltas.push_back(EncodeDelta(points[2], points[1]));
-
- for (size_t i = 3; i < count; ++i)
- {
- m2::PointU const prediction =
- PredictPointInTriangle(maxPoint, points[i-1], points[i-2], points[i-3]);
- deltas.push_back(EncodeDelta(points[i], prediction));
- }
- }
-}
-
-void DecodeTriangleStrip(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points)
-{
- size_t const count = deltas.size();
- if (count > 0)
- {
- ASSERT_GREATER(count, 2, ());
-
- points.push_back(DecodeDelta(deltas[0], basePoint));
- points.push_back(DecodeDelta(deltas[1], points.back()));
- points.push_back(DecodeDelta(deltas[2], points.back()));
-
- for (size_t i = 3; i < count; ++i)
- {
- size_t const n = points.size();
- m2::PointU const prediction =
- PredictPointInTriangle(maxPoint, points[n-1], points[n-2], points[n-3]);
- points.push_back(DecodeDelta(deltas[i], prediction));
- }
- }
-}
-
-}
diff --git a/indexer/geometry_coding.hpp b/indexer/geometry_coding.hpp
deleted file mode 100644
index 645938d205..0000000000
--- a/indexer/geometry_coding.hpp
+++ /dev/null
@@ -1,110 +0,0 @@
-#pragma once
-
-#include "geometry/point2d.hpp"
-
-#include "coding/varint.hpp"
-
-#include "base/base.hpp"
-#include "base/bits.hpp"
-#include "base/array_adapters.hpp"
-
-//@{
-inline uint64_t EncodeDelta(m2::PointU const & actual, m2::PointU const & prediction)
-{
- return bits::BitwiseMerge(
- bits::ZigZagEncode(static_cast<int32_t>(actual.x) - static_cast<int32_t>(prediction.x)),
- bits::ZigZagEncode(static_cast<int32_t>(actual.y) - static_cast<int32_t>(prediction.y)));
-}
-
-inline m2::PointU DecodeDelta(uint64_t delta, m2::PointU const & prediction)
-{
- uint32_t x, y;
- bits::BitwiseSplit(delta, x, y);
- return m2::PointU(prediction.x + bits::ZigZagDecode(x), prediction.y + bits::ZigZagDecode(y));
-}
-//@}
-
-
-/// Predict next point for polyline with given previous points (p1, p2).
-m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2);
-
-/// Predict next point for polyline with given previous points (p1, p2, p3).
-m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2,
- m2::PointU const & p3);
-
-/// Predict point for neighbour triangle with given
-/// previous triangle (p1, p2, p3) and common edge (p1, p2).
-m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2,
- m2::PointU const & p3);
-
-/// Geometry Coding-Decoding functions.
-namespace geo_coding
-{
- typedef array_read<m2::PointU> InPointsT;
- typedef array_write<m2::PointU> OutPointsT;
-
- typedef array_read<uint64_t> InDeltasT;
- typedef array_write<uint64_t> OutDeltasT;
-
-void EncodePolylinePrev1(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas);
-
-void DecodePolylinePrev1(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points);
-
-void EncodePolylinePrev2(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas);
-
-void DecodePolylinePrev2(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points);
-
-void EncodePolylinePrev3(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas);
-
-void DecodePolylinePrev3(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points);
-
-inline void EncodePolyline(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas)
-{
- EncodePolylinePrev2(points, basePoint, maxPoint, deltas);
-}
-
-inline void DecodePolyline(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points)
-{
- DecodePolylinePrev2(deltas, basePoint, maxPoint, points);
-}
-
-void EncodeTriangleStrip(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas);
-
-void DecodeTriangleStrip(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points);
-}
diff --git a/indexer/geometry_serialization.cpp b/indexer/geometry_serialization.cpp
deleted file mode 100644
index 7893a4c07f..0000000000
--- a/indexer/geometry_serialization.cpp
+++ /dev/null
@@ -1,273 +0,0 @@
-#include "indexer/geometry_serialization.hpp"
-
-#include "indexer/geometry_coding.hpp"
-
-#include "coding/pointd_to_pointu.hpp"
-
-#include "geometry/mercator.hpp"
-
-#include "std/algorithm.hpp"
-#include "std/bind.hpp"
-#include "std/iterator.hpp"
-#include "std/stack.hpp"
-
-
-namespace serial
-{
- namespace pts
- {
- inline m2::PointU D2U(m2::PointD const & p, uint32_t coordBits)
- {
- return PointDToPointU(p, coordBits);
- }
-
- inline m2::PointD U2D(m2::PointU const & p, uint32_t coordBits)
- {
- m2::PointD const pt = PointUToPointD(p, coordBits);
- ASSERT(MercatorBounds::minX <= pt.x && pt.y <= MercatorBounds::maxX,
- (p, pt, coordBits));
- ASSERT(MercatorBounds::minY <= pt.x && pt.y <= MercatorBounds::maxY,
- (p, pt, coordBits));
- return pt;
- }
-
- inline m2::PointU GetMaxPoint(CodingParams const & params)
- {
- return D2U(m2::PointD(MercatorBounds::maxX, MercatorBounds::maxY), params.GetCoordBits());
- }
-
- inline m2::PointU GetBasePoint(CodingParams const & params)
- {
- return params.GetBasePoint();
- }
-
- typedef buffer_vector<m2::PointU, 32> upoints_t;
- }
-
- void Encode(EncodeFunT fn, vector<m2::PointD> const & points,
- CodingParams const & params, DeltasT & deltas)
- {
- size_t const count = points.size();
-
- pts::upoints_t upoints;
- upoints.reserve(count);
-
- transform(points.begin(), points.end(), back_inserter(upoints),
- bind(&pts::D2U, _1, params.GetCoordBits()));
-
- ASSERT ( deltas.empty(), () );
- deltas.resize(count);
-
- geo_coding::OutDeltasT adapt(deltas);
- (*fn)(make_read_adapter(upoints), pts::GetBasePoint(params), pts::GetMaxPoint(params), adapt);
- }
-
- template <class TDecodeFun, class TOutPoints>
- void DecodeImpl(TDecodeFun fn, DeltasT const & deltas, CodingParams const & params,
- TOutPoints & points, size_t reserveF)
- {
- size_t const count = deltas.size() * reserveF;
-
- pts::upoints_t upoints;
- upoints.resize(count);
-
- geo_coding::OutPointsT adapt(upoints);
- (*fn)(make_read_adapter(deltas), pts::GetBasePoint(params), pts::GetMaxPoint(params), adapt);
-
- if (points.size() < 2)
- {
- // Do not call reserve when loading triangles - they are accumulated to one vector.
- points.reserve(count);
- }
-
- transform(upoints.begin(), upoints.begin() + adapt.size(), back_inserter(points),
- bind(&pts::U2D, _1, params.GetCoordBits()));
- }
-
- void Decode(DecodeFunT fn, DeltasT const & deltas, CodingParams const & params,
- OutPointsT & points, size_t reserveF)
- {
- DecodeImpl(fn, deltas, params, points, reserveF);
- }
-
- void Decode(DecodeFunT fn, DeltasT const & deltas, CodingParams const & params,
- vector<m2::PointD> & points, size_t reserveF)
- {
- DecodeImpl(fn, deltas, params, points, reserveF);
- }
-
- void const * LoadInner(DecodeFunT fn, void const * pBeg, size_t count,
- CodingParams const & params, OutPointsT & points)
- {
- DeltasT deltas;
- deltas.reserve(count);
- void const * ret = ReadVarUint64Array(static_cast<char const *>(pBeg), count,
- MakeBackInsertFunctor(deltas));
-
- Decode(fn, deltas, params, points);
- return ret;
- }
-
-
- TrianglesChainSaver::TrianglesChainSaver(CodingParams const & params)
- {
- m_base = pts::GetBasePoint(params);
- m_max = pts::GetMaxPoint(params);
- }
-
- namespace
- {
- struct edge_less_p0
- {
- typedef tesselator::Edge edge_t;
-
- bool operator() (edge_t const & e1, edge_t const & e2) const
- {
- return (e1.m_p[0] == e2.m_p[0]) ? (e1.m_side < e2.m_side) : (e1.m_p[0] < e2.m_p[0]);
- }
- bool operator() (edge_t const & e1, int e2) const
- {
- return e1.m_p[0] < e2;
- }
- bool operator() (int e1, edge_t const & e2) const
- {
- return e1 < e2.m_p[0];
- }
- };
- }
-
- void TrianglesChainSaver::operator() (TPoint arr[3], vector<TEdge> edges)
- {
- m_buffers.push_back(TBuffer());
- MemWriter<TBuffer> writer(m_buffers.back());
-
- WriteVarUint(writer, EncodeDelta(arr[0], m_base));
- WriteVarUint(writer, EncodeDelta(arr[1], arr[0]));
-
- TEdge curr = edges.front();
- curr.m_delta = EncodeDelta(arr[2], arr[1]);
-
- sort(edges.begin(), edges.end(), edge_less_p0());
-
- stack<TEdge> st;
- while (true)
- {
- CHECK_EQUAL ( curr.m_delta >> 62, 0, () );
- uint64_t delta = curr.m_delta << 2;
-
- // find next edges
- int const nextNode = curr.m_p[1];
- auto i = lower_bound(edges.begin(), edges.end(), nextNode, edge_less_p0());
- bool const found = (i != edges.end() && i->m_p[0] == nextNode);
- if (found)
- {
- // fill 2 tree-struct bites
- ASSERT_NOT_EQUAL(i->m_side, -1, ());
-
- uint64_t const one = 1;
-
- // first child
- delta |= (one << i->m_side);
-
- vector<TEdge>::iterator j = i+1;
- if (j != edges.end() && j->m_p[0] == nextNode)
- {
- // second child
- ASSERT_EQUAL(i->m_side, 0, ());
- ASSERT_EQUAL(j->m_side, 1, ());
-
- delta |= (one << j->m_side);
-
- // push to stack for further processing
- st.push(*j);
- }
-
- curr = *i;
- }
-
- // write delta for current element
- WriteVarUint(writer, delta);
-
- if (!found)
- {
- // end of chain - pop current from stack or exit
- if (st.empty())
- break;
- else
- {
- curr = st.top();
- st.pop();
- }
- }
- }
- }
-
- void DecodeTriangles(geo_coding::InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- geo_coding::OutPointsT & points)
- {
- size_t const count = deltas.size();
- ASSERT_GREATER ( count, 2, () );
-
- points.push_back(DecodeDelta(deltas[0], basePoint));
- points.push_back(DecodeDelta(deltas[1], points.back()));
- points.push_back(DecodeDelta(deltas[2] >> 2, points.back()));
-
- stack<size_t> st;
-
- size_t ind = 2;
- uint8_t treeBits = deltas[2] & 3;
-
- for (size_t i = 3; i < count;)
- {
- // points 0, 1 - is a common edge
- // point 2 - is an opposite point for new triangle to calculate prediction
- size_t trg[3];
-
- if (treeBits & 1)
- {
- // common edge is 1->2
- trg[0] = ind;
- trg[1] = ind-1;
- trg[2] = ind-2;
-
- // push to stack for further processing
- if (treeBits & 2)
- st.push(ind);
- }
- else if (treeBits & 2)
- {
- // common edge is 2->0
- trg[0] = ind-2;
- trg[1] = ind;
- trg[2] = ind-1;
- }
- else
- {
- // end of chain - pop current from stack
- ASSERT ( !st.empty(), () );
- ind = st.top();
- st.pop();
- treeBits = 2;
- continue;
- }
-
- // push points
- points.push_back(points[trg[0]]);
- points.push_back(points[trg[1]]);
- points.push_back(DecodeDelta(deltas[i] >> 2,
- PredictPointInTriangle(maxPoint,
- points[trg[0]],
- points[trg[1]],
- points[trg[2]])));
-
- // next step
- treeBits = deltas[i] & 3;
- ind = points.size() - 1;
- ++i;
- }
-
- ASSERT ( treeBits == 0 && st.empty(), () );
- }
-}
diff --git a/indexer/geometry_serialization.hpp b/indexer/geometry_serialization.hpp
deleted file mode 100644
index 218ef209a0..0000000000
--- a/indexer/geometry_serialization.hpp
+++ /dev/null
@@ -1,227 +0,0 @@
-#pragma once
-
-#include "indexer/geometry_coding.hpp"
-#include "indexer/tesselator_decl.hpp"
-#include "indexer/coding_params.hpp"
-
-#include "geometry/point2d.hpp"
-
-#include "coding/pointd_to_pointu.hpp"
-#include "coding/reader.hpp"
-#include "coding/varint.hpp"
-#include "coding/writer.hpp"
-
-#include "base/buffer_vector.hpp"
-#include "base/stl_add.hpp"
-
-#include "std/algorithm.hpp"
-#include "std/bind.hpp"
-#include "std/list.hpp"
-
-
-namespace serial
-{
- template <class TCont, class TSink>
- inline void WriteVarUintArray(TCont const & v, TSink & sink)
- {
- for (size_t i = 0; i != v.size(); ++i)
- WriteVarUint(sink, v[i]);
- }
-
- /// @name Encode and Decode function types.
- //@{
- typedef void (*EncodeFunT)(geo_coding::InPointsT const &,
- m2::PointU const &, m2::PointU const &,
- geo_coding::OutDeltasT &);
- typedef void (*DecodeFunT)(geo_coding::InDeltasT const &,
- m2::PointU const &, m2::PointU const &,
- geo_coding::OutPointsT &);
- //@}
-
- typedef buffer_vector<uint64_t, 32> DeltasT;
- typedef buffer_vector<m2::PointD, 32> OutPointsT;
-
- void Encode(EncodeFunT fn, vector<m2::PointD> const & points, CodingParams const & params,
- DeltasT & deltas);
-
- /// @name Overloads for different out container types.
- //@{
- void Decode(DecodeFunT fn, DeltasT const & deltas, CodingParams const & params,
- OutPointsT & points, size_t reserveF = 1);
- void Decode(DecodeFunT fn, DeltasT const & deltas, CodingParams const & params,
- vector<m2::PointD> & points, size_t reserveF = 1);
- //@}
-
- template <class TSink>
- void SavePoint(TSink & sink, m2::PointD const & pt, CodingParams const & cp)
- {
- WriteVarUint(sink, EncodeDelta(PointDToPointU(pt, cp.GetCoordBits()), cp.GetBasePoint()));
- }
-
- template <class TSource>
- m2::PointD LoadPoint(TSource & src, CodingParams const & cp)
- {
- m2::PointD const pt = PointUToPointD(DecodeDelta(ReadVarUint<uint64_t>(src), cp.GetBasePoint()),
- cp.GetCoordBits());
- return pt;
- }
-
- template <class TSink>
- void SaveInner(EncodeFunT fn, vector<m2::PointD> const & points,
- CodingParams const & params, TSink & sink)
- {
- DeltasT deltas;
- Encode(fn, points, params, deltas);
- WriteVarUintArray(deltas, sink);
- }
-
- template <class TSink>
- void WriteBufferToSink(vector<char> const & buffer, TSink & sink)
- {
- uint32_t const count = static_cast<uint32_t>(buffer.size());
- WriteVarUint(sink, count);
- sink.Write(&buffer[0], count);
- }
-
- template <class TSink>
- void SaveOuter(EncodeFunT fn, vector<m2::PointD> const & points,
- CodingParams const & params, TSink & sink)
- {
- DeltasT deltas;
- Encode(fn, points, params, deltas);
-
- vector<char> buffer;
- MemWriter<vector<char> > writer(buffer);
- WriteVarUintArray(deltas, writer);
-
- WriteBufferToSink(buffer, sink);
- }
-
- void const * LoadInner(DecodeFunT fn, void const * pBeg, size_t count,
- CodingParams const & params, OutPointsT & points);
-
- template <class TSource, class TPoints>
- void LoadOuter(DecodeFunT fn, TSource & src, CodingParams const & params,
- TPoints & points, size_t reserveF = 1)
- {
- uint32_t const count = ReadVarUint<uint32_t>(src);
- vector<char> buffer(count);
- char * p = &buffer[0];
- src.Read(p, count);
-
- DeltasT deltas;
- deltas.reserve(count / 2);
- ReadVarUint64Array(p, p + count, MakeBackInsertFunctor(deltas));
-
- Decode(fn, deltas, params, points, reserveF);
- }
-
-
- /// @name Paths.
- //@{
- template <class TSink>
- void SaveInnerPath(vector<m2::PointD> const & points, CodingParams const & params, TSink & sink)
- {
- SaveInner(&geo_coding::EncodePolyline, points, params, sink);
- }
- template <class TSink>
- void SaveOuterPath(vector<m2::PointD> const & points, CodingParams const & params, TSink & sink)
- {
- SaveOuter(&geo_coding::EncodePolyline, points, params, sink);
- }
-
- inline void const * LoadInnerPath(void const * pBeg, size_t count, CodingParams const & params,
- OutPointsT & points)
- {
- return LoadInner(&geo_coding::DecodePolyline, pBeg, count, params, points);
- }
-
- template <class TSource, class TPoints>
- void LoadOuterPath(TSource & src, CodingParams const & params, TPoints & points)
- {
- LoadOuter(&geo_coding::DecodePolyline, src, params, points);
- }
- //@}
-
- /// @name Triangles.
- //@{
- template <class TSink>
- void SaveInnerTriangles(vector<m2::PointD> const & points,
- CodingParams const & params, TSink & sink)
- {
- SaveInner(&geo_coding::EncodeTriangleStrip, points, params, sink);
- }
-
- inline void const * LoadInnerTriangles(void const * pBeg, size_t count,
- CodingParams const & params, OutPointsT & triangles)
- {
- CHECK_GREATER_OR_EQUAL(count, 2, ());
- triangles.clear();
- OutPointsT points;
- void const * res = LoadInner(&geo_coding::DecodeTriangleStrip, pBeg, count, params, points);
-
- triangles.reserve((count - 2) * 3);
- for (size_t i = 2; i < count; ++i)
- {
- triangles.push_back(points[i - 2]);
- triangles.push_back(points[i - 1]);
- triangles.push_back(points[i]);
- }
- return res;
- }
-
- class TrianglesChainSaver
- {
- using TPoint = m2::PointU;
- using TEdge = tesselator::Edge;
- using TBuffer = vector<char>;
-
- TPoint m_base;
- TPoint m_max;
-
- list<TBuffer> m_buffers;
-
- public:
- explicit TrianglesChainSaver(CodingParams const & params);
-
- TPoint GetBasePoint() const { return m_base; }
- TPoint GetMaxPoint() const { return m_max; }
-
- void operator() (TPoint arr[3], vector<TEdge> edges);
-
- size_t GetBufferSize() const
- {
- size_t sz = 0;
- for (auto const & i : m_buffers)
- sz += i.size();
- return sz;
- }
-
- template <class TSink> void Save(TSink & sink)
- {
- // Not necessary assumption that 3-bytes varuint
- // is enough for triangle chains count.
- size_t const count = m_buffers.size();
- CHECK_LESS_OR_EQUAL(count, 0x1FFFFF, ());
-
- WriteVarUint(sink, static_cast<uint32_t>(count));
-
- for_each(m_buffers.begin(), m_buffers.end(), bind(&WriteBufferToSink<TSink>, _1, ref(sink)));
- }
- };
-
- void DecodeTriangles(geo_coding::InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- geo_coding::OutPointsT & triangles);
-
- template <class TSource>
- void LoadOuterTriangles(TSource & src, CodingParams const & params, OutPointsT & triangles)
- {
- uint32_t const count = ReadVarUint<uint32_t>(src);
-
- for (uint32_t i = 0; i < count; ++i)
- LoadOuter(&DecodeTriangles, src, params, triangles, 3);
- }
- //@}
-}
diff --git a/indexer/indexer_tests/CMakeLists.txt b/indexer/indexer_tests/CMakeLists.txt
index 48e05d6b29..c84224d8bb 100644
--- a/indexer/indexer_tests/CMakeLists.txt
+++ b/indexer/indexer_tests/CMakeLists.txt
@@ -16,8 +16,6 @@ set(
feature_xml_test.cpp
features_offsets_table_test.cpp
features_vector_test.cpp
- geometry_coding_test.cpp
- geometry_serialization_test.cpp
index_builder_test.cpp
index_test.cpp
interval_index_test.cpp
@@ -25,7 +23,6 @@ set(
mwm_set_test.cpp
osm_editor_test.cpp
osm_editor_test.hpp
- polyline_point_to_int64_test.cpp
postcodes_matcher_tests.cpp
rank_table_test.cpp
scale_index_reading_tests.cpp
@@ -35,8 +32,6 @@ set(
string_slice_tests.cpp
succinct_trie_test.cpp
test_mwm_set.hpp
- test_polylines.cpp
- test_polylines.hpp
test_type.cpp
trie_test.cpp
ugc_types_test.cpp
diff --git a/indexer/indexer_tests/centers_table_test.cpp b/indexer/indexer_tests/centers_table_test.cpp
index 6874d26fa6..9a60075994 100644
--- a/indexer/indexer_tests/centers_table_test.cpp
+++ b/indexer/indexer_tests/centers_table_test.cpp
@@ -36,7 +36,7 @@ UNIT_CLASS_TEST(CentersTableTest, Smoke)
string const kMap = my::JoinFoldersToPath(GetPlatform().WritableDir(), "minsk-pass.mwm");
feature::DataHeader header(kMap);
- auto const codingParams = header.GetDefCodingParams();
+ auto const codingParams = header.GetDefGeometryCodingParams();
FeaturesVectorTest fv(kMap);
@@ -45,7 +45,7 @@ UNIT_CLASS_TEST(CentersTableTest, Smoke)
{
CentersTableBuilder builder;
- builder.SetCodingParams(codingParams);
+ builder.SetGeometryCodingParams(codingParams);
fv.GetVector().ForEach(
[&](FeatureType & ft, uint32_t id) { builder.Put(id, feature::GetCenter(ft)); });
@@ -74,13 +74,13 @@ UNIT_CLASS_TEST(CentersTableTest, Subset)
vector<pair<uint32_t, m2::PointD>> const features = {
{1, m2::PointD(0, 0)}, {5, m2::PointD(1, 1)}, {10, m2::PointD(2, 2)}};
- serial::CodingParams codingParams;
+ serial::GeometryCodingParams codingParams;
TBuffer buffer;
{
CentersTableBuilder builder;
- builder.SetCodingParams(codingParams);
+ builder.SetGeometryCodingParams(codingParams);
for (auto const & feature : features)
builder.Put(feature.first, feature.second);
diff --git a/indexer/indexer_tests/cities_boundaries_serdes_tests.cpp b/indexer/indexer_tests/cities_boundaries_serdes_tests.cpp
index 5347573735..743126f49d 100644
--- a/indexer/indexer_tests/cities_boundaries_serdes_tests.cpp
+++ b/indexer/indexer_tests/cities_boundaries_serdes_tests.cpp
@@ -2,8 +2,8 @@
#include "indexer/cities_boundaries_serdes.hpp"
#include "indexer/city_boundary.hpp"
-#include "indexer/coding_params.hpp"
+#include "coding/geometry_coding.hpp"
#include "coding/reader.hpp"
#include "coding/writer.hpp"
diff --git a/indexer/indexer_tests/geometry_serialization_test.cpp b/indexer/indexer_tests/geometry_serialization_test.cpp
deleted file mode 100644
index 87cbb60a96..0000000000
--- a/indexer/indexer_tests/geometry_serialization_test.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "testing/testing.hpp"
-
-#include "indexer/indexer_tests/test_polylines.hpp"
-
-#include "indexer/geometry_serialization.hpp"
-#include "indexer/coding_params.hpp"
-#include "geometry/mercator.hpp"
-
-#include "coding/reader.hpp"
-#include "coding/byte_stream.hpp"
-
-#include "base/logging.hpp"
-
-
-// Copy-Paste from feature_builder.cpp
-namespace
-{
- bool is_equal(double d1, double d2)
- {
- //return my::AlmostEqualULPs(d1, d2, 100000000);
- return (fabs(d1 - d2) < MercatorBounds::GetCellID2PointAbsEpsilon());
- }
-
- bool is_equal(m2::PointD const & p1, m2::PointD const & p2)
- {
- return p1.EqualDxDy(p2, MercatorBounds::GetCellID2PointAbsEpsilon());
- }
-
- bool is_equal(m2::RectD const & r1, m2::RectD const & r2)
- {
- return (is_equal(r1.minX(), r2.minX()) &&
- is_equal(r1.minY(), r2.minY()) &&
- is_equal(r1.maxX(), r2.maxX()) &&
- is_equal(r1.maxY(), r2.maxY()));
- }
-}
-
-
-UNIT_TEST(SaveLoadPolyline_DataSet1)
-{
- using namespace index_test;
-
- vector<m2::PointD> data1(arr1, arr1 + ARRAY_SIZE(arr1));
-
- vector<char> buffer;
- PushBackByteSink<vector<char> > w(buffer);
-
- serial::CodingParams cp;
- serial::SaveOuterPath(data1, cp, w);
-
- vector<m2::PointD> data2;
- ArrayByteSource r(&buffer[0]);
- serial::LoadOuterPath(r, cp, data2);
-
- TEST_EQUAL(data1.size(), data2.size(), ());
-
- m2::RectD r1, r2;
- for (size_t i = 0; i < data1.size(); ++i)
- {
- r1.Add(data1[i]);
- r2.Add(data2[i]);
-
- TEST(is_equal(data1[i], data2[i]), (data1[i], data2[i]));
- }
-
- //LOG(LINFO, (data2));
-
- TEST(is_equal(r1, r2), (r1, r2));
-}
diff --git a/indexer/indexer_tests/polyline_point_to_int64_test.cpp b/indexer/indexer_tests/polyline_point_to_int64_test.cpp
deleted file mode 100644
index e7665786d5..0000000000
--- a/indexer/indexer_tests/polyline_point_to_int64_test.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "testing/testing.hpp"
-
-#include "indexer/indexer_tests/test_polylines.hpp"
-
-#include "indexer/cell_id.hpp"
-
-#include "coding/point_to_integer.hpp"
-#include "coding/pointd_to_pointu.hpp"
-
-#include "base/logging.hpp"
-
-#include "std/cmath.hpp"
-#include "std/utility.hpp"
-
-namespace
-{
-double const g_eps = MercatorBounds::GetCellID2PointAbsEpsilon();
-uint32_t const g_coordBits = POINT_COORD_BITS;
-
-void CheckEqualPoints(m2::PointD const & p1, m2::PointD const & p2)
-{
- TEST(p1.EqualDxDy(p2, g_eps), (p1, p2));
-
- TEST_GREATER_OR_EQUAL(p1.x, -180.0, ());
- TEST_GREATER_OR_EQUAL(p1.y, -180.0, ());
- TEST_LESS_OR_EQUAL(p1.x, 180.0, ());
- TEST_LESS_OR_EQUAL(p1.y, 180.0, ());
-
- TEST_GREATER_OR_EQUAL(p2.x, -180.0, ());
- TEST_GREATER_OR_EQUAL(p2.y, -180.0, ());
- TEST_LESS_OR_EQUAL(p2.x, 180.0, ());
- TEST_LESS_OR_EQUAL(p2.y, 180.0, ());
-}
-}
-
-UNIT_TEST(PointToInt64Obsolete_DataSet1)
-{
- for (size_t i = 0; i < ARRAY_SIZE(index_test::arr1); ++i)
- {
- m2::PointD const pt(index_test::arr1[i].x, index_test::arr1[i].y);
- int64_t const id = PointToInt64Obsolete(pt, g_coordBits);
- m2::PointD const pt1 = Int64ToPointObsolete(id, g_coordBits);
-
- CheckEqualPoints(pt, pt1);
-
- int64_t const id1 = PointToInt64Obsolete(pt1, g_coordBits);
- TEST_EQUAL(id, id1, (pt, pt1));
- }
-}
diff --git a/indexer/indexer_tests/test_polylines.hpp b/indexer/indexer_tests/test_polylines.hpp
deleted file mode 100644
index 77171d2a5a..0000000000
--- a/indexer/indexer_tests/test_polylines.hpp
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma once
-
-#include "geometry/point2d.hpp"
-
-namespace index_test
-{
- typedef m2::PointD P;
- extern P arr1[376];
-}
diff --git a/indexer/locality_object.cpp b/indexer/locality_object.cpp
index 3ca1d9bb30..a4e21f50a1 100644
--- a/indexer/locality_object.cpp
+++ b/indexer/locality_object.cpp
@@ -1,16 +1,16 @@
#include "indexer/locality_object.hpp"
#include "indexer/feature_decl.hpp"
-#include "indexer/geometry_serialization.hpp"
#include "coding/byte_stream.hpp"
+#include "coding/geometry_coding.hpp"
namespace indexer
{
void LocalityObject::Deserialize(char const * data)
{
ArrayByteSource src(data);
- serial::CodingParams cp = {};
+ serial::GeometryCodingParams cp = {};
ReadPrimitiveFromSource(src, m_id);
uint8_t type;
ReadPrimitiveFromSource(src, type);
diff --git a/indexer/tesselator_decl.hpp b/indexer/tesselator_decl.hpp
deleted file mode 100644
index cc1353fcb4..0000000000
--- a/indexer/tesselator_decl.hpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#pragma once
-
-#include "base/assert.hpp"
-
-namespace tesselator
-{
- // Edge of graph, builded from triangles list.
- struct Edge
- {
- int m_p[2]; // indexes of connected triangles (0 -> 1)
- uint64_t m_delta; // delta of 1 - triangle from 0 - triangle
-
- // intersected rib of 0 - triangle:
- // - -1 - uninitialized or root edge
- // - 0 - this edge intersects 1-2 rib;
- // - 1 - this edge intersects 2-0 rib;
- int8_t m_side;
-
- Edge(int from, int to, uint64_t delta, char side)
- : m_delta(delta), m_side(side)
- {
- m_p[0] = from;
- m_p[1] = to;
- }
- };
-}
diff --git a/qt/search_panel.cpp b/qt/search_panel.cpp
index 6a3baf7470..9757e9d4f7 100644
--- a/qt/search_panel.cpp
+++ b/qt/search_panel.cpp
@@ -262,8 +262,8 @@ void SearchPanel::OnSearchTextChanged(QString const & str)
auto const timestamp = ++m_timestamp;
m_params.m_onResults = [this, timestamp](search::Results const & results,
std::vector<search::ProductInfo> const & productInfo) {
- GetPlatform().RunTask(Platform::Thread::Gui, bind(&SearchPanel::OnSearchResults, this,
- timestamp, results));
+ GetPlatform().RunTask(Platform::Thread::Gui,
+ std::bind(&SearchPanel::OnSearchResults, this, timestamp, results));
};
if (m_pDrawWidget->Search(m_params))
diff --git a/routing/cross_mwm_connector_serialization.hpp b/routing/cross_mwm_connector_serialization.hpp
index a19b4b0461..4f5a115d2c 100644
--- a/routing/cross_mwm_connector_serialization.hpp
+++ b/routing/cross_mwm_connector_serialization.hpp
@@ -8,10 +8,8 @@
#include "transit/transit_types.hpp"
-#include "indexer/coding_params.hpp"
-#include "indexer/geometry_serialization.hpp"
-
#include "coding/bit_streams.hpp"
+#include "coding/geometry_coding.hpp"
#include "coding/reader.hpp"
#include "coding/write_to_sink.hpp"
#include "coding/writer.hpp"
@@ -92,7 +90,7 @@ public:
}
template <class Sink>
- void Serialize(serial::CodingParams const & codingParams, uint32_t bitsPerCrossMwmId,
+ void Serialize(serial::GeometryCodingParams const & codingParams, uint32_t bitsPerCrossMwmId,
uint8_t bitsPerMask, Sink & sink) const
{
serial::SavePoint(sink, m_backPoint, codingParams);
@@ -125,7 +123,7 @@ public:
}
template <class Source>
- void Deserialize(serial::CodingParams const & codingParams, uint32_t bitsPerCrossMwmId,
+ void Deserialize(serial::GeometryCodingParams const & codingParams, uint32_t bitsPerCrossMwmId,
uint8_t bitsPerMask, Source & src)
{
m_backPoint = serial::LoadPoint(src, codingParams);
@@ -165,7 +163,7 @@ public:
template <class Sink, class CrossMwmId>
static void Serialize(std::vector<Transition<CrossMwmId>> const & transitions,
CrossMwmConnectorPerVehicleType<CrossMwmId> const & connectors,
- serial::CodingParams const & codingParams, Sink & sink)
+ serial::GeometryCodingParams const & codingParams, Sink & sink)
{
uint32_t const bitsPerCrossMwmId = CalcBitsPerCrossMwmId(transitions);
auto const bitsPerMask = GetBitsPerMask<uint8_t>();
@@ -215,7 +213,7 @@ public:
for (size_t i = 0; i < numTransitions; ++i)
{
Transition<CrossMwmId> transition;
- transition.Deserialize(header.GetCodingParams(), header.GetBitsPerCrossMwmId(),
+ transition.Deserialize(header.GetGeometryCodingParams(), header.GetBitsPerCrossMwmId(),
header.GetBitsPerMask(), src);
AddTransition(transition, requiredMask, connector);
}
@@ -364,7 +362,7 @@ private:
Header() = default;
Header(uint32_t numTransitions, uint64_t sizeTransitions,
- serial::CodingParams const & codingParams, uint32_t bitsPerCrossMwmId, uint8_t bitsPerMask)
+ serial::GeometryCodingParams const & codingParams, uint32_t bitsPerCrossMwmId, uint8_t bitsPerMask)
: m_numTransitions(numTransitions)
, m_sizeTransitions(sizeTransitions)
, m_codingParams(codingParams)
@@ -417,7 +415,7 @@ private:
uint32_t GetNumTransitions() const { return m_numTransitions; }
uint64_t GetSizeTransitions() const { return m_sizeTransitions; }
Weight GetGranularity() const { return m_granularity; }
- serial::CodingParams const & GetCodingParams() const { return m_codingParams; }
+ serial::GeometryCodingParams const & GetGeometryCodingParams() const { return m_codingParams; }
uint8_t GetBitsPerCrossMwmId() const { return m_bitsPerCrossMwmId; }
uint8_t GetBitsPerMask() const { return m_bitsPerMask; }
std::vector<Section> const & GetSections() const { return m_sections; }
@@ -427,7 +425,7 @@ private:
uint32_t m_numTransitions = 0;
uint64_t m_sizeTransitions = 0;
Weight m_granularity = kGranularity;
- serial::CodingParams m_codingParams;
+ serial::GeometryCodingParams m_codingParams;
uint32_t m_bitsPerCrossMwmId = 0;
uint8_t m_bitsPerMask = 0;
std::vector<Section> m_sections;
@@ -467,7 +465,7 @@ private:
template <typename CrossMwmId>
static void WriteTransitions(std::vector<Transition<CrossMwmId>> const & transitions,
- serial::CodingParams const & codingParams, uint32_t bitsPerOsmId,
+ serial::GeometryCodingParams const & codingParams, uint32_t bitsPerOsmId,
uint8_t bitsPerMask, std::vector<uint8_t> & buffer)
{
MemWriter<std::vector<uint8_t>> memWriter(buffer);
diff --git a/routing/routing_tests/cross_mwm_connector_test.cpp b/routing/routing_tests/cross_mwm_connector_test.cpp
index 6be530cfc3..24b0bca0eb 100644
--- a/routing/routing_tests/cross_mwm_connector_test.cpp
+++ b/routing/routing_tests/cross_mwm_connector_test.cpp
@@ -164,7 +164,7 @@ void TestSerialization(vector<CrossMwmConnectorSerializer::Transition<CrossMwmId
carConnector.FillWeights(
[&](Segment const & enter, Segment const & exit) { return kEdgesWeight; });
- serial::CodingParams const codingParams;
+ serial::GeometryCodingParams const codingParams;
MemWriter<vector<uint8_t>> writer(buffer);
CrossMwmConnectorSerializer::Serialize(transitions, connectors, codingParams, writer);
}
@@ -277,7 +277,7 @@ void TestWeightsSerialization()
carConnector.FillWeights(
[&](Segment const & enter, Segment const & exit) { return weights[weightIdx++]; });
- serial::CodingParams const codingParams;
+ serial::GeometryCodingParams const codingParams;
MemWriter<vector<uint8_t>> writer(buffer);
CrossMwmConnectorSerializer::Serialize(transitions, connectors, codingParams, writer);
}
diff --git a/search/engine.cpp b/search/engine.cpp
index 2f026ee7fc..3ab530f77b 100644
--- a/search/engine.cpp
+++ b/search/engine.cpp
@@ -22,6 +22,7 @@
#include <algorithm>
#include <cstdint>
+#include <functional>
#include <map>
#include <vector>
@@ -96,7 +97,7 @@ Engine::Engine(Index & index, CategoriesHolder const & categories,
: m_shutdown(false)
{
InitSuggestions doInit;
- categories.ForEachName(bind<void>(ref(doInit), _1));
+ categories.ForEachName(bind<void>(ref(doInit), placeholders::_1));
doInit.GetSuggests(m_suggests);
m_contexts.resize(params.m_numThreads);
diff --git a/search/lazy_centers_table.cpp b/search/lazy_centers_table.cpp
index 17e7ad6deb..82ad062163 100644
--- a/search/lazy_centers_table.cpp
+++ b/search/lazy_centers_table.cpp
@@ -31,7 +31,7 @@ void LazyCentersTable::EnsureTableLoaded()
return;
}
- m_table = CentersTable::Load(*m_reader.GetPtr(), m_value.GetHeader().GetDefCodingParams());
+ m_table = CentersTable::Load(*m_reader.GetPtr(), m_value.GetHeader().GetDefGeometryCodingParams());
if (m_table)
m_state = STATE_LOADED;
else
diff --git a/search/retrieval.cpp b/search/retrieval.cpp
index 6cf101bfcc..d74087bf7e 100644
--- a/search/retrieval.cpp
+++ b/search/retrieval.cpp
@@ -291,7 +291,7 @@ struct RetrievePostcodeFeaturesAdaptor
template <typename Value>
unique_ptr<Retrieval::TrieRoot<Value>> ReadTrie(MwmValue & value, ModelReaderPtr & reader)
{
- serial::CodingParams params(trie::GetCodingParams(value.GetHeader().GetDefCodingParams()));
+ serial::GeometryCodingParams params(trie::GetGeometryCodingParams(value.GetHeader().GetDefGeometryCodingParams()));
return trie::ReadTrie<SubReaderWrapper<Reader>, ValueList<Value>>(
SubReaderWrapper<Reader>(reader.GetPtr()), SingleValueSerializer<Value>(params));
}
diff --git a/search/search_index_values.hpp b/search/search_index_values.hpp
index 3f537d305d..8b59026062 100644
--- a/search/search_index_values.hpp
+++ b/search/search_index_values.hpp
@@ -1,12 +1,10 @@
#pragma once
#include "coding/compressed_bit_vector.hpp"
+#include "coding/geometry_coding.hpp"
#include "coding/read_write_utils.hpp"
#include "coding/write_to_sink.hpp"
-#include "indexer/coding_params.hpp"
-#include "indexer/geometry_serialization.hpp"
-
#include "base/assert.hpp"
#include "base/logging.hpp"
@@ -98,7 +96,7 @@ class SingleValueSerializer<FeatureWithRankAndCenter>
public:
using Value = FeatureWithRankAndCenter;
- SingleValueSerializer(serial::CodingParams const & codingParams) : m_codingParams(codingParams) {}
+ SingleValueSerializer(serial::GeometryCodingParams const & codingParams) : m_codingParams(codingParams) {}
template <typename Sink>
void Serialize(Sink & sink, Value const & v) const
@@ -124,7 +122,7 @@ public:
}
private:
- serial::CodingParams m_codingParams;
+ serial::GeometryCodingParams m_codingParams;
};
template <>
@@ -136,7 +134,7 @@ public:
SingleValueSerializer() = default;
// todo(@mpimenov). Remove.
- SingleValueSerializer(serial::CodingParams const & /* codingParams */) {}
+ SingleValueSerializer(serial::GeometryCodingParams const & /* codingParams */) {}
// The serialization and deserialization is needed for StringsFile.
// Use ValueList for group serialization in CBVs.
diff --git a/search/search_integration_tests/downloader_search_test.cpp b/search/search_integration_tests/downloader_search_test.cpp
index c681a8edb3..609fd895f5 100644
--- a/search/search_integration_tests/downloader_search_test.cpp
+++ b/search/search_integration_tests/downloader_search_test.cpp
@@ -19,10 +19,12 @@
#include "base/macros.hpp"
#include "std/algorithm.hpp"
+#include "std/bind.hpp"
#include "std/string.hpp"
using namespace generator::tests_support;
using namespace search::tests_support;
+using namespace std;
class Index;
@@ -110,7 +112,7 @@ public:
, m_downloaderCallback(static_cast<DownloaderSearchCallback::Delegate &>(*this), index,
m_engine.GetCountryInfoGetter(), m_storage, MakeDownloaderParams(query))
{
- SetCustomOnResults(bind(&DownloaderSearchRequest::OnResultsDownloader, this, _1));
+ SetCustomOnResults(bind(&DownloaderSearchRequest::OnResultsDownloader, this, placeholders::_1));
}
void OnResultsDownloader(search::Results const & results)
diff --git a/search/search_integration_tests/interactive_search_test.cpp b/search/search_integration_tests/interactive_search_test.cpp
index 4df1daea98..c2bdeb392d 100644
--- a/search/search_integration_tests/interactive_search_test.cpp
+++ b/search/search_integration_tests/interactive_search_test.cpp
@@ -62,7 +62,7 @@ public:
{
SetCustomOnResults(
ViewportSearchCallback(static_cast<ViewportSearchCallback::Delegate &>(*this),
- bind(&InteractiveSearchRequest::OnResults, this, _1)));
+ bind(&InteractiveSearchRequest::OnResults, this, placeholders::_1)));
}
};
diff --git a/search/search_tests_support/test_search_request.cpp b/search/search_tests_support/test_search_request.cpp
index 373b3bb05a..bbf1d8a6c5 100644
--- a/search/search_tests_support/test_search_request.cpp
+++ b/search/search_tests_support/test_search_request.cpp
@@ -7,6 +7,10 @@
#include "base/logging.hpp"
+#include <functional>
+
+using namespace std;
+
namespace search
{
namespace tests_support
@@ -78,7 +82,7 @@ void TestSearchRequest::Wait()
void TestSearchRequest::SetUpCallbacks()
{
m_params.m_onStarted = bind(&TestSearchRequest::OnStarted, this);
- m_params.m_onResults = bind(&TestSearchRequest::OnResults, this, _1);
+ m_params.m_onResults = bind(&TestSearchRequest::OnResults, this, placeholders::_1);
}
void TestSearchRequest::SetUpResultParams()
diff --git a/search/search_trie.hpp b/search/search_trie.hpp
index ba9e75fb7c..b10ca53bd8 100644
--- a/search/search_trie.hpp
+++ b/search/search_trie.hpp
@@ -1,7 +1,6 @@
#pragma once
-#include "indexer/coding_params.hpp"
-
+#include "coding/geometry_coding.hpp"
#include "coding/pointd_to_pointu.hpp"
namespace search
@@ -13,9 +12,9 @@ static const uint8_t kPointCodingBits = 20;
namespace trie
{
-inline serial::CodingParams GetCodingParams(serial::CodingParams const & orig)
+inline serial::GeometryCodingParams GetGeometryCodingParams(serial::GeometryCodingParams const & orig)
{
- return serial::CodingParams(search::kPointCodingBits,
+ return serial::GeometryCodingParams(search::kPointCodingBits,
PointUToPointD(orig.GetBasePoint(), orig.GetCoordBits()));
}
} // namespace trie
diff --git a/storage/country_info_getter.cpp b/storage/country_info_getter.cpp
index 665cbe113d..2dadcf3149 100644
--- a/storage/country_info_getter.cpp
+++ b/storage/country_info_getter.cpp
@@ -1,17 +1,16 @@
-#include "storage/country.hpp"
#include "storage/country_info_getter.hpp"
+
+#include "storage/country.hpp"
#include "storage/country_polygon.hpp"
#include "platform/local_country_file_utils.hpp"
-#include "indexer/geometry_serialization.hpp"
+#include "coding/read_write_utils.hpp"
#include "geometry/latlon.hpp"
#include "geometry/mercator.hpp"
#include "geometry/region2d.hpp"
-#include "coding/read_write_utils.hpp"
-
#include "base/logging.hpp"
#include "base/string_utils.hpp"
@@ -283,7 +282,7 @@ std::result_of_t<TFn(vector<m2::RegionD>)> CountryInfoReader::WithRegion(size_t
for (size_t i = 0; i < count; ++i)
{
std::vector<m2::PointD> points;
- serial::LoadOuterPath(src, serial::CodingParams(), points);
+ serial::LoadOuterPath(src, serial::GeometryCodingParams(), points);
rgns.emplace_back(move(points));
}
}
diff --git a/storage/country_polygon.hpp b/storage/country_polygon.hpp
index 9b7cf2b34e..70f1ad0d0c 100644
--- a/storage/country_polygon.hpp
+++ b/storage/country_polygon.hpp
@@ -2,31 +2,31 @@
#include "storage/country_decl.hpp"
-#include "indexer/coding_params.hpp"
-
+#include "coding/geometry_coding.hpp"
#include "coding/point_to_integer.hpp"
#include "coding/read_write_utils.hpp"
-
+#include "coding/varint.hpp"
namespace storage
{
- template <class TSource> void Read(TSource & src, CountryDef & p)
- {
- rw::Read(src, p.m_countryId);
+template <class TSource> void Read(TSource & src, CountryDef & p)
+{
+ rw::Read(src, p.m_countryId);
- pair<int64_t, int64_t> r;
- r.first = ReadVarInt<int64_t>(src);
- r.second = ReadVarInt<int64_t>(src);
- p.m_rect = Int64ToRectObsolete(r, serial::CodingParams().GetCoordBits());
- }
+ pair<int64_t, int64_t> r;
+ r.first = ReadVarInt<int64_t>(src);
+ r.second = ReadVarInt<int64_t>(src);
+ p.m_rect = Int64ToRectObsolete(r, serial::GeometryCodingParams().GetCoordBits());
+}
+
+template <class TSink> void Write(TSink & sink, CountryDef const & p)
+{
+ rw::Write(sink, p.m_countryId);
- template <class TSink> void Write(TSink & sink, CountryDef const & p)
- {
- rw::Write(sink, p.m_countryId);
+ pair<int64_t, int64_t> const r =
+ RectToInt64Obsolete(p.m_rect, serial::GeometryCodingParams().GetCoordBits());
- pair<int64_t, int64_t> const r =
- RectToInt64Obsolete(p.m_rect, serial::CodingParams().GetCoordBits());
- WriteVarInt(sink, r.first);
- WriteVarInt(sink, r.second);
- }
+ WriteVarInt(sink, r.first);
+ WriteVarInt(sink, r.second);
}
+} // namespace storage
diff --git a/transit/transit_serdes.hpp b/transit/transit_serdes.hpp
index 45d54f9d00..38e1e34e72 100644
--- a/transit/transit_serdes.hpp
+++ b/transit/transit_serdes.hpp
@@ -2,10 +2,9 @@
#include "transit/transit_types.hpp"
-#include "indexer/geometry_coding.hpp"
-
#include "geometry/point2d.hpp"
+#include "coding/geometry_coding.hpp"
#include "coding/point_to_integer.hpp"
#include "coding/pointd_to_pointu.hpp"
#include "coding/read_write_utils.hpp"
@@ -92,7 +91,7 @@ public:
for (auto const & p : vs)
{
m2::PointU const pointU = PointDToPointU(p, POINT_COORD_BITS);
- WriteVarUint(m_sink, EncodeDelta(pointU, lastEncodedPoint));
+ WriteVarUint(m_sink, coding::EncodeDelta(pointU, lastEncodedPoint));
lastEncodedPoint = pointU;
}
}
@@ -290,7 +289,7 @@ public:
vs.resize(size);
for (auto & p : vs)
{
- m2::PointU const pointU = DecodeDelta(ReadVarUint<uint64_t, Source>(m_source), lastDecodedPoint);
+ m2::PointU const pointU = coding::DecodeDelta(ReadVarUint<uint64_t, Source>(m_source), lastDecodedPoint);
p = PointUToPointD(pointU, POINT_COORD_BITS);
lastDecodedPoint = pointU;
}
diff --git a/xcode/coding/coding.xcodeproj/project.pbxproj b/xcode/coding/coding.xcodeproj/project.pbxproj
index 1fc2e33107..b588f2be40 100644
--- a/xcode/coding/coding.xcodeproj/project.pbxproj
+++ b/xcode/coding/coding.xcodeproj/project.pbxproj
@@ -32,6 +32,12 @@
39B2B97D1FB4693500AB85A1 /* bwt_coder.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 39B2B97C1FB4693400AB85A1 /* bwt_coder.hpp */; };
39B2B97F1FB4693B00AB85A1 /* elias_coder.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 39B2B97E1FB4693B00AB85A1 /* elias_coder.hpp */; };
39B2B9811FB4694300AB85A1 /* memory_region.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 39B2B9801FB4694300AB85A1 /* memory_region.hpp */; };
+ 39F376C6207D327B0058E8E0 /* geometry_coding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39F376C4207D327B0058E8E0 /* geometry_coding.cpp */; };
+ 39F376C7207D327B0058E8E0 /* geometry_coding.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 39F376C5207D327B0058E8E0 /* geometry_coding.hpp */; };
+ 39F376C9207D32820058E8E0 /* tesselator_decl.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 39F376C8207D32820058E8E0 /* tesselator_decl.hpp */; };
+ 39F376D2207D32AA0058E8E0 /* test_polylines.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39F376CA207D329F0058E8E0 /* test_polylines.cpp */; };
+ 39F376D3207D32AD0058E8E0 /* geometry_serialization_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39F376CC207D329F0058E8E0 /* geometry_serialization_test.cpp */; };
+ 39F376D4207D32B10058E8E0 /* geometry_coding_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39F376CB207D329F0058E8E0 /* geometry_coding_test.cpp */; };
3D489BC01D3D21A00052AA38 /* succinct_mapper_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D489BBA1D3D217E0052AA38 /* succinct_mapper_test.cpp */; };
3D489BC11D3D21A40052AA38 /* simple_dense_coding_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D489BB91D3D217E0052AA38 /* simple_dense_coding_test.cpp */; };
3D489BC21D3D21AA0052AA38 /* fixed_bits_ddvector_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D489BB81D3D217E0052AA38 /* fixed_bits_ddvector_test.cpp */; };
@@ -192,6 +198,12 @@
39B2B97C1FB4693400AB85A1 /* bwt_coder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bwt_coder.hpp; sourceTree = "<group>"; };
39B2B97E1FB4693B00AB85A1 /* elias_coder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = elias_coder.hpp; sourceTree = "<group>"; };
39B2B9801FB4694300AB85A1 /* memory_region.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = memory_region.hpp; sourceTree = "<group>"; };
+ 39F376C4207D327B0058E8E0 /* geometry_coding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = geometry_coding.cpp; sourceTree = "<group>"; };
+ 39F376C5207D327B0058E8E0 /* geometry_coding.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = geometry_coding.hpp; sourceTree = "<group>"; };
+ 39F376C8207D32820058E8E0 /* tesselator_decl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = tesselator_decl.hpp; sourceTree = "<group>"; };
+ 39F376CA207D329F0058E8E0 /* test_polylines.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_polylines.cpp; sourceTree = "<group>"; };
+ 39F376CB207D329F0058E8E0 /* geometry_coding_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = geometry_coding_test.cpp; sourceTree = "<group>"; };
+ 39F376CC207D329F0058E8E0 /* geometry_serialization_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = geometry_serialization_test.cpp; sourceTree = "<group>"; };
3D489BB51D3D21510052AA38 /* libplatform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplatform.a; path = "../../../omim-xcode-build/Debug/libplatform.a"; sourceTree = "<group>"; };
3D489BB71D3D217E0052AA38 /* elias_coder_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = elias_coder_test.cpp; sourceTree = "<group>"; };
3D489BB81D3D217E0052AA38 /* fixed_bits_ddvector_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fixed_bits_ddvector_test.cpp; sourceTree = "<group>"; };
@@ -354,6 +366,9 @@
394916901BAC3A5F002A8C4F /* coding_tests */ = {
isa = PBXGroup;
children = (
+ 39F376CB207D329F0058E8E0 /* geometry_coding_test.cpp */,
+ 39F376CC207D329F0058E8E0 /* geometry_serialization_test.cpp */,
+ 39F376CA207D329F0058E8E0 /* test_polylines.cpp */,
395D1A91207BBBAC001164A5 /* zlib_test.cpp */,
395D1A8F207BBBA5001164A5 /* pointd_to_pointu_tests.cpp */,
395D1A8D207BBB9E001164A5 /* text_storage_tests.cpp */,
@@ -440,6 +455,9 @@
6753421D1A3F586300A0A8C3 /* coding */ = {
isa = PBXGroup;
children = (
+ 39F376C8207D32820058E8E0 /* tesselator_decl.hpp */,
+ 39F376C4207D327B0058E8E0 /* geometry_coding.cpp */,
+ 39F376C5207D327B0058E8E0 /* geometry_coding.hpp */,
395D1A87207BBA16001164A5 /* pointd_to_pointu.cpp */,
395D1A88207BBA16001164A5 /* pointd_to_pointu.hpp */,
6753422B1A3F588B00A0A8C3 /* base64.cpp */,
@@ -559,6 +577,7 @@
675342D01A3F588C00A0A8C3 /* writer.hpp in Headers */,
39B2B97F1FB4693B00AB85A1 /* elias_coder.hpp in Headers */,
675342CA1A3F588C00A0A8C3 /* var_serial_vector.hpp in Headers */,
+ 39F376C9207D32820058E8E0 /* tesselator_decl.hpp in Headers */,
39B2B97B1FB4692D00AB85A1 /* text_storage.hpp in Headers */,
347F33391C4540F0009758CC /* fixed_bits_ddvector.hpp in Headers */,
6753429D1A3F588C00A0A8C3 /* file_name_utils.hpp in Headers */,
@@ -585,6 +604,7 @@
675342B41A3F588C00A0A8C3 /* read_write_utils.hpp in Headers */,
675342981A3F588C00A0A8C3 /* diff.hpp in Headers */,
670D04C01B0BA92D0013A7AC /* file_data.hpp in Headers */,
+ 39F376C7207D327B0058E8E0 /* geometry_coding.hpp in Headers */,
4563B063205909290057556D /* sha1.hpp in Headers */,
6753428B1A3F588C00A0A8C3 /* buffer_reader.hpp in Headers */,
675342831A3F588C00A0A8C3 /* base64.hpp in Headers */,
@@ -704,9 +724,11 @@
67E8DB6A1BBC17490053C5BA /* reader_writer_ops_test.cpp in Sources */,
67E8DB611BBC17490053C5BA /* file_utils_test.cpp in Sources */,
3D489BC31D3D21AE0052AA38 /* elias_coder_test.cpp in Sources */,
+ 39F376D2207D32AA0058E8E0 /* test_polylines.cpp in Sources */,
67E8DB671BBC17490053C5BA /* png_decoder_test.cpp in Sources */,
394917201BAC3BE0002A8C4F /* testingmain.cpp in Sources */,
395D1A96207BBF63001164A5 /* pointd_to_pointu_tests.cpp in Sources */,
+ 39F376D3207D32AD0058E8E0 /* geometry_serialization_test.cpp in Sources */,
45C108B81E9CFE7B000FE1F6 /* point_to_integer_test.cpp in Sources */,
67E8DB5D1BBC17490053C5BA /* endianness_test.cpp in Sources */,
3D489BC11D3D21A40052AA38 /* simple_dense_coding_test.cpp in Sources */,
@@ -732,6 +754,7 @@
67E8DB761BBC17490053C5BA /* zip_creator_test.cpp in Sources */,
395D1A97207BBF63001164A5 /* text_storage_tests.cpp in Sources */,
67E8DB661BBC17490053C5BA /* multilang_utf8_string_test.cpp in Sources */,
+ 39F376D4207D32B10058E8E0 /* geometry_coding_test.cpp in Sources */,
395D1A95207BBF63001164A5 /* zlib_test.cpp in Sources */,
67E8DB741BBC17490053C5BA /* varint_vector_test.cpp in Sources */,
67E8DB631BBC17490053C5BA /* huffman_test.cpp in Sources */,
@@ -766,6 +789,7 @@
670D04BF1B0BA92D0013A7AC /* file_data.cpp in Sources */,
675342CC1A3F588C00A0A8C3 /* varint_vector.cpp in Sources */,
675342B91A3F588C00A0A8C3 /* reader_writer_ops.cpp in Sources */,
+ 39F376C6207D327B0058E8E0 /* geometry_coding.cpp in Sources */,
675E889C1DB7B0D000F8EBDA /* traffic.cpp in Sources */,
675342AE1A3F588C00A0A8C3 /* mmap_reader.cpp in Sources */,
45C108B41E9CFE69000FE1F6 /* point_to_integer.cpp in Sources */,
diff --git a/xcode/indexer/indexer.xcodeproj/project.pbxproj b/xcode/indexer/indexer.xcodeproj/project.pbxproj
index e2e76f42cf..afa22e6632 100644
--- a/xcode/indexer/indexer.xcodeproj/project.pbxproj
+++ b/xcode/indexer/indexer.xcodeproj/project.pbxproj
@@ -42,6 +42,8 @@
34AF87E61DBE565F00E5E7DC /* helpers.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 34AF87E41DBE565F00E5E7DC /* helpers.hpp */; };
34AF87E71DBE567C00E5E7DC /* libindexer_tests_support.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 34AF87D71DBE561400E5E7DC /* libindexer_tests_support.a */; };
34AF87E81DBE570200E5E7DC /* helpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34AF87E31DBE565F00E5E7DC /* helpers.cpp */; };
+ 39F376C0207D32450058E8E0 /* cities_boundaries_serdes_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39F376BE207D32410058E8E0 /* cities_boundaries_serdes_tests.cpp */; };
+ 39F376C3207D32510058E8E0 /* scale_index_reading_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39F376C1207D324E0058E8E0 /* scale_index_reading_tests.cpp */; };
3D0AEAF81FBAF9E900AD042B /* test_with_classificator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D0AEAF41FBAF9E900AD042B /* test_with_classificator.cpp */; };
3D0AEAF91FBAF9E900AD042B /* test_with_custom_mwms.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3D0AEAF51FBAF9E900AD042B /* test_with_custom_mwms.hpp */; };
3D0AEAFA1FBAF9E900AD042B /* test_with_custom_mwms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D0AEAF61FBAF9E900AD042B /* test_with_custom_mwms.cpp */; };
@@ -84,7 +86,6 @@
456E1B191F90E5B7009C32E1 /* ftypes_sponsored.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 456E1B151F90E5B6009C32E1 /* ftypes_sponsored.cpp */; };
456E1B1A1F90E5B7009C32E1 /* ftypes_sponsored.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 456E1B161F90E5B6009C32E1 /* ftypes_sponsored.hpp */; };
456E1B1B1F90E5B7009C32E1 /* city_boundary.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 456E1B171F90E5B7009C32E1 /* city_boundary.hpp */; };
- 45C108B11E9CFE41000FE1F6 /* polyline_point_to_int64_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45C108AF1E9CFE3E000FE1F6 /* polyline_point_to_int64_test.cpp */; };
45C108BD1E9D0067000FE1F6 /* libicu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 45C108BC1E9D0067000FE1F6 /* libicu.a */; };
45C108BF1E9D008D000FE1F6 /* librouting_common.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 45C108BE1E9D008D000FE1F6 /* librouting_common.a */; };
56C74C1C1C749E4700B71B9F /* categories_holder_loader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56C74C121C749E4700B71B9F /* categories_holder_loader.cpp */; };
@@ -110,15 +111,12 @@
670BAA961D0B06E1000302DA /* cell_id_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C60FB1AB065B100C38A8C /* cell_id_test.cpp */; };
670BAA971D0B06E1000302DA /* checker_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C60FC1AB065B100C38A8C /* checker_test.cpp */; };
670BAA981D0B06E1000302DA /* features_offsets_table_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C60FD1AB065B100C38A8C /* features_offsets_table_test.cpp */; };
- 670BAA991D0B06E1000302DA /* geometry_coding_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C60FE1AB065B100C38A8C /* geometry_coding_test.cpp */; };
- 670BAA9A1D0B06E1000302DA /* geometry_serialization_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C60FF1AB065B100C38A8C /* geometry_serialization_test.cpp */; };
670BAA9B1D0B06E1000302DA /* index_builder_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61001AB065B100C38A8C /* index_builder_test.cpp */; };
670BAA9C1D0B06E1000302DA /* index_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61011AB065B100C38A8C /* index_test.cpp */; };
670BAA9D1D0B06E1000302DA /* interval_index_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61021AB065B100C38A8C /* interval_index_test.cpp */; };
670BAA9E1D0B06E1000302DA /* mwm_set_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61041AB065B100C38A8C /* mwm_set_test.cpp */; };
670BAAA01D0B06E1000302DA /* scales_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61061AB065B100C38A8C /* scales_test.cpp */; };
670BAAA11D0B06E1000302DA /* sort_and_merge_intervals_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61071AB065B100C38A8C /* sort_and_merge_intervals_test.cpp */; };
- 670BAAA21D0B06E1000302DA /* test_polylines.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C61081AB065B100C38A8C /* test_polylines.cpp */; };
670BAAA31D0B06E1000302DA /* test_type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C610A1AB065B100C38A8C /* test_type.cpp */; };
670BAAA41D0B06E1000302DA /* visibility_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 670C610B1AB065B100C38A8C /* visibility_test.cpp */; };
670BAAAB1D0B07AA000302DA /* libbase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 670BAAA51D0B07AA000302DA /* libbase.a */; };
@@ -155,8 +153,6 @@
675341021A3F540F00A0A8C3 /* classificator_loader.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340AD1A3F540F00A0A8C3 /* classificator_loader.hpp */; };
675341031A3F540F00A0A8C3 /* classificator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340AE1A3F540F00A0A8C3 /* classificator.cpp */; };
675341041A3F540F00A0A8C3 /* classificator.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340AF1A3F540F00A0A8C3 /* classificator.hpp */; };
- 675341051A3F540F00A0A8C3 /* coding_params.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340B01A3F540F00A0A8C3 /* coding_params.cpp */; };
- 675341061A3F540F00A0A8C3 /* coding_params.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340B11A3F540F00A0A8C3 /* coding_params.hpp */; };
675341071A3F540F00A0A8C3 /* data_factory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340B21A3F540F00A0A8C3 /* data_factory.cpp */; };
675341081A3F540F00A0A8C3 /* data_factory.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340B31A3F540F00A0A8C3 /* data_factory.hpp */; };
675341091A3F540F00A0A8C3 /* data_header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340B41A3F540F00A0A8C3 /* data_header.cpp */; };
@@ -192,10 +188,6 @@
675341271A3F540F00A0A8C3 /* features_vector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340D41A3F540F00A0A8C3 /* features_vector.hpp */; };
675341281A3F540F00A0A8C3 /* ftypes_matcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340D51A3F540F00A0A8C3 /* ftypes_matcher.cpp */; };
675341291A3F540F00A0A8C3 /* ftypes_matcher.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340D61A3F540F00A0A8C3 /* ftypes_matcher.hpp */; };
- 6753412A1A3F540F00A0A8C3 /* geometry_coding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340D71A3F540F00A0A8C3 /* geometry_coding.cpp */; };
- 6753412B1A3F540F00A0A8C3 /* geometry_coding.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340D81A3F540F00A0A8C3 /* geometry_coding.hpp */; };
- 6753412C1A3F540F00A0A8C3 /* geometry_serialization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340D91A3F540F00A0A8C3 /* geometry_serialization.cpp */; };
- 6753412D1A3F540F00A0A8C3 /* geometry_serialization.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340DA1A3F540F00A0A8C3 /* geometry_serialization.hpp */; };
6753412E1A3F540F00A0A8C3 /* index_builder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340DB1A3F540F00A0A8C3 /* index_builder.cpp */; };
6753412F1A3F540F00A0A8C3 /* index_builder.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340DC1A3F540F00A0A8C3 /* index_builder.hpp */; };
675341301A3F540F00A0A8C3 /* index.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340DD1A3F540F00A0A8C3 /* index.cpp */; };
@@ -208,7 +200,6 @@
6753413F1A3F540F00A0A8C3 /* scale_index.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340ED1A3F540F00A0A8C3 /* scale_index.hpp */; };
675341401A3F540F00A0A8C3 /* scales.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340EE1A3F540F00A0A8C3 /* scales.cpp */; };
675341411A3F540F00A0A8C3 /* scales.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340EF1A3F540F00A0A8C3 /* scales.hpp */; };
- 6753414B1A3F540F00A0A8C3 /* tesselator_decl.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340F91A3F540F00A0A8C3 /* tesselator_decl.hpp */; };
6753414C1A3F540F00A0A8C3 /* tree_structure.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340FA1A3F540F00A0A8C3 /* tree_structure.hpp */; };
6753414D1A3F540F00A0A8C3 /* types_mapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 675340FB1A3F540F00A0A8C3 /* types_mapping.cpp */; };
6753414E1A3F540F00A0A8C3 /* types_mapping.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675340FC1A3F540F00A0A8C3 /* types_mapping.hpp */; };
@@ -283,6 +274,8 @@
34AF87D71DBE561400E5E7DC /* libindexer_tests_support.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libindexer_tests_support.a; sourceTree = BUILT_PRODUCTS_DIR; };
34AF87E31DBE565F00E5E7DC /* helpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = helpers.cpp; sourceTree = "<group>"; };
34AF87E41DBE565F00E5E7DC /* helpers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = helpers.hpp; sourceTree = "<group>"; };
+ 39F376BE207D32410058E8E0 /* cities_boundaries_serdes_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cities_boundaries_serdes_tests.cpp; sourceTree = "<group>"; };
+ 39F376C1207D324E0058E8E0 /* scale_index_reading_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scale_index_reading_tests.cpp; sourceTree = "<group>"; };
3D0AEAF41FBAF9E900AD042B /* test_with_classificator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_with_classificator.cpp; sourceTree = "<group>"; };
3D0AEAF51FBAF9E900AD042B /* test_with_custom_mwms.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = test_with_custom_mwms.hpp; sourceTree = "<group>"; };
3D0AEAF61FBAF9E900AD042B /* test_with_custom_mwms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_with_custom_mwms.cpp; sourceTree = "<group>"; };
@@ -322,7 +315,6 @@
456E1B151F90E5B6009C32E1 /* ftypes_sponsored.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ftypes_sponsored.cpp; sourceTree = "<group>"; };
456E1B161F90E5B6009C32E1 /* ftypes_sponsored.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ftypes_sponsored.hpp; sourceTree = "<group>"; };
456E1B171F90E5B7009C32E1 /* city_boundary.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = city_boundary.hpp; sourceTree = "<group>"; };
- 45C108AF1E9CFE3E000FE1F6 /* polyline_point_to_int64_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = polyline_point_to_int64_test.cpp; sourceTree = "<group>"; };
45C108BC1E9D0067000FE1F6 /* libicu.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libicu.a; path = "/Users/r.kuznetsov/Dev/Projects/omim/xcode/icu/../../../omim-build/xcode/Debug/libicu.a"; sourceTree = "<absolute>"; };
45C108BE1E9D008D000FE1F6 /* librouting_common.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = librouting_common.a; path = "/Users/r.kuznetsov/Dev/Projects/omim/xcode/routing_common/../../../omim-build/xcode/Debug/librouting_common.a"; sourceTree = "<absolute>"; };
56C74C121C749E4700B71B9F /* categories_holder_loader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = categories_holder_loader.cpp; sourceTree = "<group>"; };
@@ -366,16 +358,12 @@
670C60FB1AB065B100C38A8C /* cell_id_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cell_id_test.cpp; sourceTree = "<group>"; };
670C60FC1AB065B100C38A8C /* checker_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = checker_test.cpp; sourceTree = "<group>"; };
670C60FD1AB065B100C38A8C /* features_offsets_table_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = features_offsets_table_test.cpp; sourceTree = "<group>"; };
- 670C60FE1AB065B100C38A8C /* geometry_coding_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = geometry_coding_test.cpp; sourceTree = "<group>"; };
- 670C60FF1AB065B100C38A8C /* geometry_serialization_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = geometry_serialization_test.cpp; sourceTree = "<group>"; };
670C61001AB065B100C38A8C /* index_builder_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = index_builder_test.cpp; sourceTree = "<group>"; };
670C61011AB065B100C38A8C /* index_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = index_test.cpp; sourceTree = "<group>"; };
670C61021AB065B100C38A8C /* interval_index_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = interval_index_test.cpp; sourceTree = "<group>"; };
670C61041AB065B100C38A8C /* mwm_set_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mwm_set_test.cpp; sourceTree = "<group>"; };
670C61061AB065B100C38A8C /* scales_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scales_test.cpp; sourceTree = "<group>"; };
670C61071AB065B100C38A8C /* sort_and_merge_intervals_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sort_and_merge_intervals_test.cpp; sourceTree = "<group>"; };
- 670C61081AB065B100C38A8C /* test_polylines.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_polylines.cpp; sourceTree = "<group>"; };
- 670C61091AB065B100C38A8C /* test_polylines.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = test_polylines.hpp; sourceTree = "<group>"; };
670C610A1AB065B100C38A8C /* test_type.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_type.cpp; sourceTree = "<group>"; };
670C610B1AB065B100C38A8C /* visibility_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = visibility_test.cpp; sourceTree = "<group>"; };
670C611F1AB065E100C38A8C /* testingmain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testingmain.cpp; path = ../../testing/testingmain.cpp; sourceTree = "<group>"; };
@@ -396,8 +384,6 @@
675340AD1A3F540F00A0A8C3 /* classificator_loader.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = classificator_loader.hpp; sourceTree = "<group>"; };
675340AE1A3F540F00A0A8C3 /* classificator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = classificator.cpp; sourceTree = "<group>"; };
675340AF1A3F540F00A0A8C3 /* classificator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = classificator.hpp; sourceTree = "<group>"; };
- 675340B01A3F540F00A0A8C3 /* coding_params.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coding_params.cpp; sourceTree = "<group>"; };
- 675340B11A3F540F00A0A8C3 /* coding_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = coding_params.hpp; sourceTree = "<group>"; };
675340B21A3F540F00A0A8C3 /* data_factory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = data_factory.cpp; sourceTree = "<group>"; };
675340B31A3F540F00A0A8C3 /* data_factory.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = data_factory.hpp; sourceTree = "<group>"; };
675340B41A3F540F00A0A8C3 /* data_header.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = data_header.cpp; sourceTree = "<group>"; };
@@ -434,10 +420,6 @@
675340D41A3F540F00A0A8C3 /* features_vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = features_vector.hpp; sourceTree = "<group>"; };
675340D51A3F540F00A0A8C3 /* ftypes_matcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ftypes_matcher.cpp; sourceTree = "<group>"; };
675340D61A3F540F00A0A8C3 /* ftypes_matcher.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ftypes_matcher.hpp; sourceTree = "<group>"; };
- 675340D71A3F540F00A0A8C3 /* geometry_coding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = geometry_coding.cpp; sourceTree = "<group>"; };
- 675340D81A3F540F00A0A8C3 /* geometry_coding.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = geometry_coding.hpp; sourceTree = "<group>"; };
- 675340D91A3F540F00A0A8C3 /* geometry_serialization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = geometry_serialization.cpp; sourceTree = "<group>"; };
- 675340DA1A3F540F00A0A8C3 /* geometry_serialization.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = geometry_serialization.hpp; sourceTree = "<group>"; };
675340DB1A3F540F00A0A8C3 /* index_builder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = index_builder.cpp; sourceTree = "<group>"; };
675340DC1A3F540F00A0A8C3 /* index_builder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = index_builder.hpp; sourceTree = "<group>"; };
675340DD1A3F540F00A0A8C3 /* index.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = index.cpp; sourceTree = "<group>"; };
@@ -450,7 +432,6 @@
675340ED1A3F540F00A0A8C3 /* scale_index.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scale_index.hpp; sourceTree = "<group>"; };
675340EE1A3F540F00A0A8C3 /* scales.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scales.cpp; sourceTree = "<group>"; };
675340EF1A3F540F00A0A8C3 /* scales.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scales.hpp; sourceTree = "<group>"; };
- 675340F91A3F540F00A0A8C3 /* tesselator_decl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = tesselator_decl.hpp; sourceTree = "<group>"; };
675340FA1A3F540F00A0A8C3 /* tree_structure.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = tree_structure.hpp; sourceTree = "<group>"; };
675340FB1A3F540F00A0A8C3 /* types_mapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = types_mapping.cpp; sourceTree = "<group>"; };
675340FC1A3F540F00A0A8C3 /* types_mapping.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = types_mapping.hpp; sourceTree = "<group>"; };
@@ -615,13 +596,14 @@
670C60F81AB0657700C38A8C /* indexer_tests */ = {
isa = PBXGroup;
children = (
+ 39F376C1207D324E0058E8E0 /* scale_index_reading_tests.cpp */,
+ 39F376BE207D32410058E8E0 /* cities_boundaries_serdes_tests.cpp */,
40C3C090205BF9F400CED188 /* bounds.hpp */,
40A1C309202B321000F71672 /* locality_index_test.cpp */,
3D74EF231F8F559D0081202C /* ugc_types_test.cpp */,
3D452AF71EE6D9F5009EAB9B /* wheelchair_tests.cpp */,
3D452AF81EE6D9F5009EAB9B /* feature_names_test.cpp */,
3D452AF91EE6D9F5009EAB9B /* centers_table_test.cpp */,
- 45C108AF1E9CFE3E000FE1F6 /* polyline_point_to_int64_test.cpp */,
3D489BF11D4F87740052AA38 /* osm_editor_test.cpp */,
3D489BF21D4F87740052AA38 /* osm_editor_test.hpp */,
3D489BA71D3D1F8A0052AA38 /* editable_map_object_test.cpp */,
@@ -642,16 +624,12 @@
670C60FB1AB065B100C38A8C /* cell_id_test.cpp */,
670C60FC1AB065B100C38A8C /* checker_test.cpp */,
670C60FD1AB065B100C38A8C /* features_offsets_table_test.cpp */,
- 670C60FE1AB065B100C38A8C /* geometry_coding_test.cpp */,
- 670C60FF1AB065B100C38A8C /* geometry_serialization_test.cpp */,
670C61001AB065B100C38A8C /* index_builder_test.cpp */,
670C61011AB065B100C38A8C /* index_test.cpp */,
670C61021AB065B100C38A8C /* interval_index_test.cpp */,
670C61041AB065B100C38A8C /* mwm_set_test.cpp */,
670C61061AB065B100C38A8C /* scales_test.cpp */,
670C61071AB065B100C38A8C /* sort_and_merge_intervals_test.cpp */,
- 670C61081AB065B100C38A8C /* test_polylines.cpp */,
- 670C61091AB065B100C38A8C /* test_polylines.hpp */,
670C610A1AB065B100C38A8C /* test_type.cpp */,
670C610B1AB065B100C38A8C /* visibility_test.cpp */,
);
@@ -759,8 +737,6 @@
675340AD1A3F540F00A0A8C3 /* classificator_loader.hpp */,
675340AE1A3F540F00A0A8C3 /* classificator.cpp */,
675340AF1A3F540F00A0A8C3 /* classificator.hpp */,
- 675340B01A3F540F00A0A8C3 /* coding_params.cpp */,
- 675340B11A3F540F00A0A8C3 /* coding_params.hpp */,
675340B21A3F540F00A0A8C3 /* data_factory.cpp */,
675340B31A3F540F00A0A8C3 /* data_factory.hpp */,
675340B41A3F540F00A0A8C3 /* data_header.cpp */,
@@ -800,10 +776,6 @@
675340D41A3F540F00A0A8C3 /* features_vector.hpp */,
675340D51A3F540F00A0A8C3 /* ftypes_matcher.cpp */,
675340D61A3F540F00A0A8C3 /* ftypes_matcher.hpp */,
- 675340D71A3F540F00A0A8C3 /* geometry_coding.cpp */,
- 675340D81A3F540F00A0A8C3 /* geometry_coding.hpp */,
- 675340D91A3F540F00A0A8C3 /* geometry_serialization.cpp */,
- 675340DA1A3F540F00A0A8C3 /* geometry_serialization.hpp */,
675340DB1A3F540F00A0A8C3 /* index_builder.cpp */,
675340DC1A3F540F00A0A8C3 /* index_builder.hpp */,
675340DD1A3F540F00A0A8C3 /* index.cpp */,
@@ -817,7 +789,6 @@
675340ED1A3F540F00A0A8C3 /* scale_index.hpp */,
675340EE1A3F540F00A0A8C3 /* scales.cpp */,
675340EF1A3F540F00A0A8C3 /* scales.hpp */,
- 675340F91A3F540F00A0A8C3 /* tesselator_decl.hpp */,
675340FA1A3F540F00A0A8C3 /* tree_structure.hpp */,
675340FB1A3F540F00A0A8C3 /* types_mapping.cpp */,
675340FC1A3F540F00A0A8C3 /* types_mapping.hpp */,
@@ -873,14 +844,12 @@
6726C1D21A49DAAC005EEA39 /* feature_meta.hpp in Headers */,
347F337F1C454242009758CC /* trie_builder.hpp in Headers */,
34664CF71D49FEC1003D7096 /* centers_table.hpp in Headers */,
- 6753412D1A3F540F00A0A8C3 /* geometry_serialization.hpp in Headers */,
6753414C1A3F540F00A0A8C3 /* tree_structure.hpp in Headers */,
F6DF5F311CD0FD9A00A87154 /* categories_index.hpp in Headers */,
347F337D1C454242009758CC /* succinct_trie_builder.hpp in Headers */,
675341381A3F540F00A0A8C3 /* mwm_set.hpp in Headers */,
456E1B181F90E5B7009C32E1 /* cities_boundaries_serdes.hpp in Headers */,
670EE56D1B60033A001E8064 /* unique_index.hpp in Headers */,
- 6753412B1A3F540F00A0A8C3 /* geometry_coding.hpp in Headers */,
675340FF1A3F540F00A0A8C3 /* cell_coverer.hpp in Headers */,
56C74C251C749E4700B71B9F /* search_string_utils.hpp in Headers */,
6753410C1A3F540F00A0A8C3 /* drawing_rule_def.hpp in Headers */,
@@ -900,7 +869,6 @@
670C615C1AB0691900C38A8C /* features_offsets_table.hpp in Headers */,
40009065201F5CB000963E18 /* locality_object.hpp in Headers */,
6758AED41BB4413000C26E27 /* drules_selector.hpp in Headers */,
- 675341061A3F540F00A0A8C3 /* coding_params.hpp in Headers */,
3D0AEAF91FBAF9E900AD042B /* test_with_custom_mwms.hpp in Headers */,
3D0AEAFB1FBAF9E900AD042B /* test_with_classificator.hpp in Headers */,
56C74C211C749E4700B71B9F /* edits_migration.hpp in Headers */,
@@ -910,7 +878,6 @@
675341321A3F540F00A0A8C3 /* interval_index_builder.hpp in Headers */,
40009062201F5CB000963E18 /* cell_value_pair.hpp in Headers */,
347F337C1C454242009758CC /* rank_table.hpp in Headers */,
- 6753414B1A3F540F00A0A8C3 /* tesselator_decl.hpp in Headers */,
F61F83071E4B187500B37B7A /* road_shields_parser.hpp in Headers */,
347F33801C454242009758CC /* trie_reader.hpp in Headers */,
675341191A3F540F00A0A8C3 /* feature_decl.hpp in Headers */,
@@ -1083,14 +1050,12 @@
670BAAA41D0B06E1000302DA /* visibility_test.cpp in Sources */,
670BAA931D0B06B4000302DA /* feature_metadata_test.cpp in Sources */,
670BAA941D0B06B4000302DA /* feature_xml_test.cpp in Sources */,
- 45C108B11E9CFE41000FE1F6 /* polyline_point_to_int64_test.cpp in Sources */,
670BAA901D0B06B4000302DA /* postcodes_matcher_tests.cpp in Sources */,
670BAA921D0B06B4000302DA /* drules_selector_parser_test.cpp in Sources */,
+ 39F376C3207D32510058E8E0 /* scale_index_reading_tests.cpp in Sources */,
+ 39F376C0207D32450058E8E0 /* cities_boundaries_serdes_tests.cpp in Sources */,
670BAA8F1D0B06A6000302DA /* rank_table_test.cpp in Sources */,
- 670BAAA21D0B06E1000302DA /* test_polylines.cpp in Sources */,
- 670BAA9A1D0B06E1000302DA /* geometry_serialization_test.cpp in Sources */,
670BAA981D0B06E1000302DA /* features_offsets_table_test.cpp in Sources */,
- 670BAA991D0B06E1000302DA /* geometry_coding_test.cpp in Sources */,
670BAAA01D0B06E1000302DA /* scales_test.cpp in Sources */,
670BAA9E1D0B06E1000302DA /* mwm_set_test.cpp in Sources */,
670BAA911D0B06B4000302DA /* categories_test.cpp in Sources */,
@@ -1126,7 +1091,6 @@
34664CF61D49FEC1003D7096 /* centers_table.cpp in Sources */,
56C74C201C749E4700B71B9F /* edits_migration.cpp in Sources */,
6753414D1A3F540F00A0A8C3 /* types_mapping.cpp in Sources */,
- 6753412A1A3F540F00A0A8C3 /* geometry_coding.cpp in Sources */,
34583BC71C88552100F94664 /* cuisines.cpp in Sources */,
3D452AFA1EE6D9F5009EAB9B /* wheelchair_tests.cpp in Sources */,
675341121A3F540F00A0A8C3 /* feature_algo.cpp in Sources */,
@@ -1141,10 +1105,8 @@
40009063201F5CB000963E18 /* locality_object.cpp in Sources */,
675341401A3F540F00A0A8C3 /* scales.cpp in Sources */,
6753411E1A3F540F00A0A8C3 /* feature_loader.cpp in Sources */,
- 675341051A3F540F00A0A8C3 /* coding_params.cpp in Sources */,
675341251A3F540F00A0A8C3 /* feature.cpp in Sources */,
675341091A3F540F00A0A8C3 /* data_header.cpp in Sources */,
- 6753412C1A3F540F00A0A8C3 /* geometry_serialization.cpp in Sources */,
F61F83061E4B187500B37B7A /* road_shields_parser.cpp in Sources */,
670EE56C1B60033A001E8064 /* features_vector.cpp in Sources */,
3D452AFB1EE6D9F5009EAB9B /* feature_names_test.cpp in Sources */,