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:
-rw-r--r--defines.hpp1
-rw-r--r--generator/altitude_generator.cpp86
-rw-r--r--generator/altitude_generator.hpp8
-rw-r--r--generator/feature_builder.cpp6
-rw-r--r--generator/generator.pro2
-rw-r--r--generator/generator_tool/generator_tool.cpp7
-rw-r--r--generator/routing_generator.cpp3
-rw-r--r--indexer/feature.cpp11
-rw-r--r--indexer/feature.hpp13
-rw-r--r--indexer/feature_altitude.hpp49
-rw-r--r--indexer/feature_loader.cpp42
-rw-r--r--indexer/feature_loader.hpp17
-rw-r--r--indexer/feature_loader_base.cpp5
-rw-r--r--indexer/feature_loader_base.hpp2
-rw-r--r--indexer/indexer.pro1
-rw-r--r--indexer/old/feature_loader_101.hpp18
-rw-r--r--routing/bicycle_model.cpp7
-rw-r--r--routing/bicycle_model.hpp3
-rw-r--r--routing/features_road_graph.cpp5
-rw-r--r--routing/pedestrian_model.cpp7
-rw-r--r--routing/pedestrian_model.hpp2
-rw-r--r--routing/road_graph.hpp2
-rw-r--r--routing/routing.pro2
-rw-r--r--routing/routing_helpers.hpp17
-rwxr-xr-xtools/unix/generate_mwm.sh2
25 files changed, 292 insertions, 26 deletions
diff --git a/defines.hpp b/defines.hpp
index c23dc901cc..7adc3c8c1e 100644
--- a/defines.hpp
+++ b/defines.hpp
@@ -25,6 +25,7 @@
#define VERSION_FILE_TAG "version"
#define METADATA_FILE_TAG "meta"
#define METADATA_INDEX_FILE_TAG "metaidx"
+#define ALTITUDE_TAG "altitude"
#define FEATURE_OFFSETS_FILE_TAG "offs"
#define RANKS_FILE_TAG "ranks"
#define REGION_INFO_FILE_TAG "rgninfo"
diff --git a/generator/altitude_generator.cpp b/generator/altitude_generator.cpp
new file mode 100644
index 0000000000..06ef4941a9
--- /dev/null
+++ b/generator/altitude_generator.cpp
@@ -0,0 +1,86 @@
+#include "generator/routing_generator.hpp"
+#include "generator/srtm_parser.hpp"
+
+#include "defines.hpp"
+
+#include "routing/routing_helpers.hpp"
+
+#include "indexer/feature.hpp"
+#include "indexer/feature_altitude.hpp"
+#include "indexer/feature_data.hpp"
+#include "indexer/feature_processor.hpp"
+
+#include "coding/file_container.hpp"
+#include "coding/varint.hpp"
+
+#include "coding/internal/file_data.hpp"
+
+#include "base/assert.hpp"
+#include "base/logging.hpp"
+#include "base/string_utils.hpp"
+
+#include "std/map.hpp"
+#include "std/type_traits.hpp"
+
+using namespace feature;
+
+namespace
+{
+static_assert(is_same<TAltitude, generator::SrtmTile::THeight>::value, "");
+static_assert(kInvalidAltitude == generator::SrtmTile::kInvalidHeight, "");
+
+class Processor
+{
+public:
+ Processor(string const & srtmPath) : m_srtmManager(srtmPath) {}
+ map<uint32_t, Altitudes> const & GetFeatureAltitudes() const { return m_featureAltitudes; }
+
+ void operator()(FeatureType const & f, uint32_t const & id)
+ {
+ f.ParseTypes();
+ f.ParseHeader2();
+ if (!routing::IsRoad(feature::TypesHolder(f)))
+ return;
+
+ f.ParseGeometry(FeatureType::BEST_GEOMETRY);
+ size_t const pointsCount = f.GetPointsCount();
+ if (pointsCount == 0)
+ return;
+
+ Altitudes alts(m_srtmManager.GetHeight(MercatorBounds::ToLatLon(f.GetPoint(0))),
+ m_srtmManager.GetHeight(MercatorBounds::ToLatLon(f.GetPoint(pointsCount - 1))));
+ m_featureAltitudes[id] = alts;
+ }
+
+private:
+ generator::SrtmTileManager m_srtmManager;
+ map<uint32_t, Altitudes> m_featureAltitudes;
+};
+} // namespace
+
+namespace routing
+{
+void BuildRoadFeatureAltitude(string const & srtmPath, string const & baseDir, string const & countryName)
+{
+ LOG(LINFO, ("srtmPath =", srtmPath, "baseDir =", baseDir, "countryName =", countryName));
+ string const altPath = baseDir + countryName + "." + ALTITUDE_TAG;
+ string const mwmPath = baseDir + countryName + DATA_FILE_EXTENSION;
+
+ // Writing section with altitude information.
+ {
+ FilesContainerW altCont(mwmPath, FileWriter::OP_WRITE_EXISTING);
+ FileWriter w = altCont.GetWriter(ALTITUDE_TAG);
+
+ Processor processor(srtmPath);
+ feature::ForEachFromDat(mwmPath, processor);
+ map<uint32_t, Altitudes> const & featureAltitudes = processor.GetFeatureAltitudes();
+
+ for (auto const & a : featureAltitudes)
+ {
+ Altitude altitude(a.first /* feature id */, a.second /* feature altitudes */);
+ altitude.Serialize(w);
+ }
+ LOG(LINFO, ("Altitude was written for", featureAltitudes.size(), "features."));
+ }
+}
+} // namespace routing
diff --git a/generator/altitude_generator.hpp b/generator/altitude_generator.hpp
new file mode 100644
index 0000000000..0881724df2
--- /dev/null
+++ b/generator/altitude_generator.hpp
@@ -0,0 +1,8 @@
+#pragma once
+
+#include "std/string.hpp"
+
+namespace routing
+{
+void BuildRoadFeatureAltitude(string const & srtmPath, string const & baseDir, string const & countryName);
+} // namespace routing
diff --git a/generator/feature_builder.cpp b/generator/feature_builder.cpp
index 62c165788c..33013febb3 100644
--- a/generator/feature_builder.cpp
+++ b/generator/feature_builder.cpp
@@ -2,6 +2,7 @@
#include "routing/bicycle_model.hpp"
#include "routing/car_model.hpp"
+#include "routing/routing_helpers.hpp"
#include "routing/pedestrian_model.hpp"
#include "indexer/feature_impl.hpp"
@@ -230,10 +231,7 @@ namespace
bool FeatureBuilder1::IsRoad() const
{
- static routing::PedestrianModel const pedModel;
- static routing::BicycleModel const bicModel;
- return routing::CarModel::Instance().HasRoadType(m_params.m_Types) ||
- pedModel.HasRoadType(m_params.m_Types) || bicModel.HasRoadType(m_params.m_Types);
+ return routing::IsRoad(m_params.m_Types);
}
bool FeatureBuilder1::PreSerialize()
diff --git a/generator/generator.pro b/generator/generator.pro
index 3ac4cdfacd..2a2d3289d7 100644
--- a/generator/generator.pro
+++ b/generator/generator.pro
@@ -15,6 +15,7 @@ INCLUDEPATH *= $$ROOT_DIR/3party/gflags/src \
QT *= core
SOURCES += \
+ altitude_generator.cpp \
booking_dataset.cpp \
booking_scoring.cpp \
borders_generator.cpp \
@@ -41,6 +42,7 @@ SOURCES += \
unpack_mwm.cpp \
HEADERS += \
+ altitude_generator.hpp \
booking_dataset.hpp \
booking_scoring.hpp \
borders_generator.hpp \
diff --git a/generator/generator_tool/generator_tool.cpp b/generator/generator_tool/generator_tool.cpp
index 0aff559f45..34298623ac 100644
--- a/generator/generator_tool/generator_tool.cpp
+++ b/generator/generator_tool/generator_tool.cpp
@@ -1,3 +1,4 @@
+#include "generator/altitude_generator.hpp"
#include "generator/borders_generator.hpp"
#include "generator/borders_loader.hpp"
#include "generator/check_model.hpp"
@@ -63,13 +64,14 @@ DEFINE_bool(fail_on_coasts, false, "Stop and exit with '255' code if some coastl
DEFINE_bool(generate_addresses_file, false, "Generate .addr file (for '--output' option) with full addresses list.");
DEFINE_string(osrm_file_name, "", "Input osrm file to generate routing info");
DEFINE_bool(make_routing, false, "Make routing info based on osrm file");
-DEFINE_bool(make_cross_section, false, "Make corss section in routing file for cross mwm routing");
+DEFINE_bool(make_cross_section, false, "Make cross section in routing file for cross mwm routing");
DEFINE_string(osm_file_name, "", "Input osm area file");
DEFINE_string(osm_file_type, "xml", "Input osm area file type [xml, o5m]");
DEFINE_string(user_resource_path, "", "User defined resource path for classificator.txt and etc.");
DEFINE_string(booking_data, "", "Path to booking data in .tsv format");
DEFINE_string(booking_reference_path, "", "Path to mwm dataset for match booking addresses");
DEFINE_uint64(planet_version, my::SecondsSinceEpoch(), "Version as seconds since epoch, by default - now");
+DEFINE_string(srtm_path, "", "Path to srtm directory. If it's set generates section with altitude information about road features.");
int main(int argc, char ** argv)
{
@@ -245,6 +247,9 @@ int main(int argc, char ** argv)
if (FLAGS_dump_feature_names != "")
feature::DumpFeatureNames(datFile, FLAGS_dump_feature_names);
+ if (!FLAGS_srtm_path.empty())
+ routing::BuildRoadFeatureAltitude(FLAGS_srtm_path, path, FLAGS_output);
+
if (FLAGS_unpack_mwm)
UnpackMwm(datFile);
diff --git a/generator/routing_generator.cpp b/generator/routing_generator.cpp
index 8d1f345726..35395e17f7 100644
--- a/generator/routing_generator.cpp
+++ b/generator/routing_generator.cpp
@@ -15,12 +15,13 @@
#include "indexer/feature.hpp"
#include "indexer/ftypes_matcher.hpp"
#include "indexer/index.hpp"
-#include "geometry/mercator.hpp"
#include "geometry/distance_on_sphere.hpp"
+#include "geometry/mercator.hpp"
#include "coding/file_container.hpp"
#include "coding/read_write_utils.hpp"
+
#include "coding/internal/file_data.hpp"
#include "base/logging.hpp"
diff --git a/indexer/feature.cpp b/indexer/feature.cpp
index b05151515a..7153bc6476 100644
--- a/indexer/feature.cpp
+++ b/indexer/feature.cpp
@@ -302,7 +302,7 @@ void FeatureType::Deserialize(feature::LoaderBase * pLoader, TBuffer buffer)
m_pLoader->InitFeature(this);
- m_header2Parsed = m_pointsParsed = m_trianglesParsed = m_metadataParsed = false;
+ m_header2Parsed = m_pointsParsed = m_trianglesParsed = m_metadataParsed = m_altitudeParsed = false;
m_innerStats.MakeZero();
}
@@ -375,6 +375,15 @@ void FeatureType::ParseMetadata() const
m_metadataParsed = true;
}
+void FeatureType::ParseAltitude() const
+{
+ if (m_altitudeParsed)
+ return;
+
+ m_pLoader->ParseAltitude();
+ m_altitudeParsed = true;
+}
+
StringUtf8Multilang const & FeatureType::GetNames() const
{
return m_params.name;
diff --git a/indexer/feature.hpp b/indexer/feature.hpp
index 1913cd3465..108857dba1 100644
--- a/indexer/feature.hpp
+++ b/indexer/feature.hpp
@@ -1,5 +1,6 @@
#pragma once
#include "indexer/cell_id.hpp"
+#include "indexer/feature_altitude.hpp"
#include "indexer/feature_data.hpp"
#include "geometry/point2d.hpp"
@@ -201,6 +202,7 @@ public:
uint32_t ParseTriangles(int scale) const;
void ParseMetadata() const;
+ void ParseAltitude() const;
//@}
/// @name Geometry.
@@ -243,6 +245,12 @@ public:
return m_points[i];
}
+ inline feature::Altitudes const & GetAltitudes() const
+ {
+ ASSERT(m_altitudeParsed, ());
+ return m_altitudes;
+ }
+
template <typename TFunctor>
void ForEachTriangle(TFunctor && f, int scale) const
{
@@ -361,10 +369,15 @@ private:
mutable points_t m_points, m_triangles;
mutable feature::Metadata m_metadata;
+ // @TODO |m_altitudes| should be exchanged with vector<TAltitude>.
+ // If the vector is empty no altitude information is available for this feature.
+ mutable feature::Altitudes m_altitudes;
+
mutable bool m_header2Parsed = false;
mutable bool m_pointsParsed = false;
mutable bool m_trianglesParsed = false;
mutable bool m_metadataParsed = false;
+ mutable bool m_altitudeParsed = false;
mutable inner_geom_stat_t m_innerStats;
diff --git a/indexer/feature_altitude.hpp b/indexer/feature_altitude.hpp
new file mode 100644
index 0000000000..54894f0047
--- /dev/null
+++ b/indexer/feature_altitude.hpp
@@ -0,0 +1,49 @@
+#pragma once
+
+#include "coding/varint.hpp"
+
+#include "std/vector.hpp"
+
+namespace feature
+{
+using TAltitude = int16_t;
+using TAltitudeVec = vector<feature::TAltitude>;
+static TAltitude constexpr kInvalidAltitude = -32768;
+
+struct Altitudes
+{
+ Altitudes() = default;
+ Altitudes(TAltitude b, TAltitude e) : begin(b), end(e) {}
+
+ TAltitude begin = 0;
+ TAltitude end = 0;
+};
+
+class Altitude
+{
+public:
+ Altitude() = default;
+ Altitude(uint32_t featureId, Altitudes const & altitudes) : m_featureId(featureId), m_altitudes(altitudes) {}
+
+ template <class TSink>
+ void Serialize(TSink & sink) const
+ {
+ sink.Write(&m_featureId, sizeof(uint32_t));
+ sink.Write(&m_altitudes.begin, sizeof(TAltitude));
+ sink.Write(&m_altitudes.end, sizeof(TAltitude));
+ }
+
+ /// @TODO template <class TSource> void Deserialize(TSource & src) should be implement here.
+ /// But now for test purposes deserialization is done with DDVector construction.
+
+ uint32_t GetFeatureId() const { return m_featureId; }
+ Altitudes const & GetAltitudes() const { return m_altitudes; }
+
+private:
+ /// @TODO Note. Feature id is located here because there's no index for altitudes.
+ /// There's only pairs sorted by feature id. Before merging to master some index has to be implemented.
+ /// Don't forget to remove |m_featureId|.
+ uint32_t m_featureId = 0;
+ Altitudes m_altitudes;
+};
+} // namespace feature
diff --git a/indexer/feature_loader.cpp b/indexer/feature_loader.cpp
index 37093182e8..950f134959 100644
--- a/indexer/feature_loader.cpp
+++ b/indexer/feature_loader.cpp
@@ -292,6 +292,48 @@ void LoaderCurrent::ParseMetadata()
}
}
+void LoaderCurrent::ParseAltitude()
+{
+ // @TODO Index and should be used here before merging to master.
+
+ if (m_Info.GetMWMFormat() < version::Format::v8)
+ return;
+
+ struct TAltitudeIndexEntry
+ {
+ uint32_t featureId;
+ feature::TAltitude beginAlt;
+ feature::TAltitude endAlt;
+ };
+
+ try
+ {
+ DDVector<TAltitudeIndexEntry, FilesContainerR::TReader> idx(m_Info.GetAltitudeReader());
+ auto it = lower_bound(
+ idx.begin(), idx.end(),
+ TAltitudeIndexEntry{static_cast<uint32_t>(m_pF->m_id.m_index), 0, 0},
+ [](TAltitudeIndexEntry const & v1, TAltitudeIndexEntry const & v2)
+ {
+ return v1.featureId < v2.featureId;
+ });
+ if (it == idx.end())
+ return;
+
+ if (m_pF->m_id.m_index != it->featureId)
+ return;
+
+ if (it->beginAlt == kInvalidAltitude || it->endAlt == kInvalidAltitude)
+ return;
+
+ m_pF->m_altitudes.begin = it->beginAlt;
+ m_pF->m_altitudes.end = it->endAlt;
+ }
+ catch (Reader::OpenException const &)
+ {
+ // Now ignore exception because not all mwm have needed sections.
+ }
+}
+
int LoaderCurrent::GetScaleIndex(int scale) const
{
int const count = m_Info.GetScalesCount();
diff --git a/indexer/feature_loader.hpp b/indexer/feature_loader.hpp
index 693cb9a451..513ca984c3 100644
--- a/indexer/feature_loader.hpp
+++ b/indexer/feature_loader.hpp
@@ -21,13 +21,14 @@ namespace feature
public:
LoaderCurrent(SharedLoadInfo const & info) : BaseT(info) {}
- virtual uint8_t GetHeader();
-
- virtual void ParseTypes();
- virtual void ParseCommon();
- virtual void ParseHeader2();
- virtual uint32_t ParseGeometry(int scale);
- virtual uint32_t ParseTriangles(int scale);
- virtual void ParseMetadata();
+ /// LoaderBase overrides:
+ virtual uint8_t GetHeader() override;
+ void ParseTypes() override;
+ void ParseCommon() override;
+ void ParseHeader2() override;
+ uint32_t ParseGeometry(int scale) override;
+ uint32_t ParseTriangles(int scale) override;
+ void ParseMetadata() override;
+ void ParseAltitude() override;
};
}
diff --git a/indexer/feature_loader_base.cpp b/indexer/feature_loader_base.cpp
index 8aa9d8422e..349ea8055e 100644
--- a/indexer/feature_loader_base.cpp
+++ b/indexer/feature_loader_base.cpp
@@ -44,6 +44,11 @@ SharedLoadInfo::TReader SharedLoadInfo::GetMetadataIndexReader() const
return m_cont.GetReader(METADATA_INDEX_FILE_TAG);
}
+SharedLoadInfo::TReader SharedLoadInfo::GetAltitudeReader() const
+{
+ return m_cont.GetReader(ALTITUDE_TAG);
+}
+
SharedLoadInfo::TReader SharedLoadInfo::GetGeometryReader(int ind) const
{
return m_cont.GetReader(GetTagForIndex(GEOMETRY_FILE_TAG, ind));
diff --git a/indexer/feature_loader_base.hpp b/indexer/feature_loader_base.hpp
index 46f68f1597..2a2b2ff617 100644
--- a/indexer/feature_loader_base.hpp
+++ b/indexer/feature_loader_base.hpp
@@ -32,6 +32,7 @@ namespace feature
TReader GetDataReader() const;
TReader GetMetadataReader() const;
TReader GetMetadataIndexReader() const;
+ TReader GetAltitudeReader() const;
TReader GetGeometryReader(int ind) const;
TReader GetTrianglesReader(int ind) const;
@@ -78,6 +79,7 @@ namespace feature
virtual uint32_t ParseGeometry(int scale) = 0;
virtual uint32_t ParseTriangles(int scale) = 0;
virtual void ParseMetadata() = 0;
+ virtual void ParseAltitude() = 0;
inline uint32_t GetTypesSize() const { return m_CommonOffset - m_TypesOffset; }
diff --git a/indexer/indexer.pro b/indexer/indexer.pro
index 26a2499e36..6602f18ddf 100644
--- a/indexer/indexer.pro
+++ b/indexer/indexer.pro
@@ -81,6 +81,7 @@ HEADERS += \
edits_migration.hpp \
feature.hpp \
feature_algo.hpp \
+ feature_altitude.hpp \
feature_covering.hpp \
feature_data.hpp \
feature_decl.hpp \
diff --git a/indexer/old/feature_loader_101.hpp b/indexer/old/feature_loader_101.hpp
index a18c8913da..7c07657013 100644
--- a/indexer/old/feature_loader_101.hpp
+++ b/indexer/old/feature_loader_101.hpp
@@ -29,15 +29,15 @@ namespace old_101 { namespace feature
public:
LoaderImpl(::feature::SharedLoadInfo const & info) : BaseT(info) {}
- virtual uint8_t GetHeader();
-
- virtual void ParseTypes();
- virtual void ParseCommon();
- virtual void ParseHeader2();
- virtual uint32_t ParseGeometry(int scale);
- virtual uint32_t ParseTriangles(int scale);
- virtual void ParseMetadata() {} /// not supported in this version
-
+ /// LoaderBase overrides:
+ uint8_t GetHeader() override;
+ void ParseTypes() override;
+ void ParseCommon() override;
+ void ParseHeader2() override;
+ uint32_t ParseGeometry(int scale) override;
+ uint32_t ParseTriangles(int scale) override;
+ void ParseMetadata() override {} /// not supported in this version
+ void ParseAltitude() override {} /// not supported in this version
};
}
}
diff --git a/routing/bicycle_model.cpp b/routing/bicycle_model.cpp
index 458bdced2b..5d629bf18a 100644
--- a/routing/bicycle_model.cpp
+++ b/routing/bicycle_model.cpp
@@ -638,6 +638,13 @@ bool BicycleModel::IsOneWay(FeatureType const & f) const
return VehicleModel::IsOneWay(f);
}
+// static
+BicycleModel const & BicycleModel::DefaultInstance()
+{
+ static BicycleModel const instance;
+ return instance;
+}
+
BicycleModelFactory::BicycleModelFactory()
{
m_models[string()] = make_shared<BicycleModel>(g_bicycleLimitsDefault);
diff --git a/routing/bicycle_model.hpp b/routing/bicycle_model.hpp
index 85820d4344..3765abb9f3 100644
--- a/routing/bicycle_model.hpp
+++ b/routing/bicycle_model.hpp
@@ -17,6 +17,8 @@ public:
/// VehicleModel overrides:
bool IsOneWay(FeatureType const & f) const override;
+ static BicycleModel const & DefaultInstance();
+
protected:
RoadAvailability GetRoadAvailability(feature::TypesHolder const & types) const override;
@@ -45,5 +47,4 @@ public:
private:
unordered_map<string, shared_ptr<IVehicleModel>> m_models;
};
-
} // namespace routing
diff --git a/routing/features_road_graph.cpp b/routing/features_road_graph.cpp
index 602d0a2d37..8d0d1dcd22 100644
--- a/routing/features_road_graph.cpp
+++ b/routing/features_road_graph.cpp
@@ -277,6 +277,11 @@ IRoadGraph::RoadInfo const & FeaturesRoadGraph::GetCachedRoadInfo(FeatureID cons
ri.m_speedKMPH = GetSpeedKMPHFromFt(ft);
ft.SwapPoints(ri.m_points);
+ ft.ParseAltitude();
+ // @TODO It's better to use swap here when altitudes is kept in a vector.
+ ri.m_altitudes = ft.GetAltitudes();
+ LOG(LINFO, ("ri.m_altitudes.begin =", ri.m_altitudes.begin, "ri.m_altitudes.end =", ri.m_altitudes.end));
+
LockFeatureMwm(featureId);
return ri;
diff --git a/routing/pedestrian_model.cpp b/routing/pedestrian_model.cpp
index 678a4064d9..7947e0b999 100644
--- a/routing/pedestrian_model.cpp
+++ b/routing/pedestrian_model.cpp
@@ -642,6 +642,13 @@ IVehicleModel::RoadAvailability PedestrianModel::GetRoadAvailability(feature::Ty
return RoadAvailability::Unknown;
}
+// static
+PedestrianModel const & PedestrianModel::DefaultInstance()
+{
+ static PedestrianModel const instance;
+ return instance;
+}
+
PedestrianModelFactory::PedestrianModelFactory()
{
m_models[string()] = make_shared<PedestrianModel>(g_pedestrianLimitsDefault);
diff --git a/routing/pedestrian_model.hpp b/routing/pedestrian_model.hpp
index c00df62db8..db0b392451 100644
--- a/routing/pedestrian_model.hpp
+++ b/routing/pedestrian_model.hpp
@@ -17,6 +17,8 @@ public:
/// VehicleModel overrides:
bool IsOneWay(FeatureType const &) const override { return false; }
+ static PedestrianModel const & DefaultInstance();
+
protected:
RoadAvailability GetRoadAvailability(feature::TypesHolder const & types) const override;
diff --git a/routing/road_graph.hpp b/routing/road_graph.hpp
index b995a3e2d8..528f471131 100644
--- a/routing/road_graph.hpp
+++ b/routing/road_graph.hpp
@@ -4,6 +4,7 @@
#include "base/string_utils.hpp"
+#include "indexer/feature_altitude.hpp"
#include "indexer/feature_data.hpp"
#include "std/initializer_list.hpp"
@@ -106,6 +107,7 @@ public:
RoadInfo & operator=(RoadInfo const &) = default;
buffer_vector<m2::PointD, 32> m_points;
+ feature::Altitudes m_altitudes;
double m_speedKMPH;
bool m_bidirectional;
};
diff --git a/routing/routing.pro b/routing/routing.pro
index 0c9579602b..6d676f711c 100644
--- a/routing/routing.pro
+++ b/routing/routing.pro
@@ -49,6 +49,7 @@ SOURCES += \
turns_tts_text.cpp \
vehicle_model.cpp \
+
HEADERS += \
async_router.hpp \
base/astar_algorithm.hpp \
@@ -79,6 +80,7 @@ HEADERS += \
router.hpp \
router_delegate.hpp \
routing_algorithm.hpp \
+ routing_helpers.hpp \
routing_mapping.hpp \
routing_result_graph.hpp \
routing_session.hpp \
diff --git a/routing/routing_helpers.hpp b/routing/routing_helpers.hpp
new file mode 100644
index 0000000000..45f8fa7b3c
--- /dev/null
+++ b/routing/routing_helpers.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "routing/bicycle_model.hpp"
+#include "routing/car_model.hpp"
+#include "routing/pedestrian_model.hpp"
+
+namespace routing
+{
+/// \returns true if a feature with |types| can be used for any kind of routing.
+template <class TList>
+bool IsRoad(TList const & types)
+{
+ return CarModel::Instance().HasRoadType(types)
+ || PedestrianModel::DefaultInstance().HasRoadType(types)
+ || BicycleModel::DefaultInstance().HasRoadType(types);
+}
+} // namespace rouing
diff --git a/tools/unix/generate_mwm.sh b/tools/unix/generate_mwm.sh
index cededb574e..b0939000a6 100755
--- a/tools/unix/generate_mwm.sh
+++ b/tools/unix/generate_mwm.sh
@@ -103,7 +103,7 @@ if [ "$SOURCE_TYPE" == "pbf" -o "$SOURCE_TYPE" == "bz2" -o "$SOURCE_TYPE" == "os
fi
if [ "$SOURCE_TYPE" == "o5m" ]; then
$GENERATOR_TOOL $INTDIR_FLAG --osm_file_type=o5m --osm_file_name="$SOURCE_FILE" --preprocess=true || fail "Preprocessing failed"
- $GENERATOR_TOOL $INTDIR_FLAG --osm_file_type=o5m --osm_file_name="$SOURCE_FILE" --data_path="$TARGET" --user_resource_path="$DATA_PATH" $GENERATE_EVERYTHING --output="$BASE_NAME"
+ $GENERATOR_TOOL $INTDIR_FLAG --osm_file_type=o5m --osm_file_name="$SOURCE_FILE" --data_path="$TARGET" --user_resource_path="$DATA_PATH" $GENERATE_EVERYTHING --output="$BASE_NAME" --srtm_path="./../../maps/srtm/2000.02.11/"
else
fail "Unsupported source type: $SOURCE_TYPE"
fi