[classificator] Added route-ferry-motor_vehicle and railway-rail-motor_vehicle types to process this kind of routes in routing algorithm.

This commit is contained in:
vng 2015-03-30 19:46:51 +03:00 committed by Alex Zolotarev
parent 5874e598ea
commit fad3189ccb
7 changed files with 422 additions and 4 deletions

View file

@ -581,6 +581,7 @@ world +
proposed -
rail +
bridge -
motor_vehicle -
tunnel -
{}
razed -
@ -639,6 +640,7 @@ world +
{}
route +
ferry +
motor_vehicle -
motorcar -
{}
{}

Binary file not shown.

View file

@ -49776,6 +49776,265 @@ cont {
}
}
}
cont {
name: "railway-rail-motor_vehicle"
element {
scale: 10
lines {
width: 1.0
color: 13421772
priority: 1171
join: ROUNDJOIN
cap: ROUNDCAP
}
}
element {
scale: 11
lines {
width: 1.0
color: 13421772
priority: 1171
join: ROUNDJOIN
cap: ROUNDCAP
}
}
element {
scale: 12
lines {
width: 1.0
color: 13421772
priority: 1234
join: ROUNDJOIN
cap: ROUNDCAP
}
}
element {
scale: 13
lines {
width: 1.85
color: 12303291
priority: 1256
join: ROUNDJOIN
cap: ROUNDCAP
}
}
element {
scale: 14
lines {
width: 3.0
color: 8947848
priority: 1207
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 1.8
color: 15658734
priority: 1295
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 1.8
color: 8947848
dashdot {
dd: 4.5
dd: 4.5
}
priority: 1331
join: ROUNDJOIN
cap: BUTTCAP
}
path_text {
primary {
height: 12
color: 3364317
stroke_color: 16777215
}
priority: 16207
}
}
element {
scale: 15
lines {
width: 4.0
color: 6710886
priority: 1301
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 2.4
color: 15658734
priority: 1367
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 2.4
color: 6710886
dashdot {
dd: 9.0
dd: 9.0
}
priority: 1370
join: ROUNDJOIN
cap: BUTTCAP
}
path_text {
primary {
height: 12
color: 3364317
stroke_color: 16777215
}
priority: 16301
}
}
element {
scale: 16
lines {
width: 2.4
color: 15658734
priority: 1626
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 4.0
color: 6710886
priority: 1521
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 2.4
color: 6710886
dashdot {
dd: 12.0
dd: 12.0
}
priority: 1659
join: ROUNDJOIN
cap: BUTTCAP
}
path_text {
primary {
height: 12
color: 3364317
stroke_color: 16777215
}
priority: 16626
}
}
element {
scale: 17
lines {
width: 4.4
color: 6710886
priority: 1563
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 3.2
color: 15658734
priority: 1689
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 3.2
color: 6710886
dashdot {
dd: 12.0
dd: 12.0
}
priority: 1737
join: ROUNDJOIN
cap: BUTTCAP
}
path_text {
primary {
height: 12
color: 3364317
stroke_color: 16777215
}
priority: 16563
}
}
element {
scale: 18
lines {
width: 4.4
color: 6710886
priority: 1563
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 3.2
color: 15658734
priority: 1689
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 3.2
color: 6710886
dashdot {
dd: 12.0
dd: 12.0
}
priority: 1737
join: ROUNDJOIN
cap: BUTTCAP
}
path_text {
primary {
height: 12
color: 3364317
stroke_color: 16777215
}
priority: 16563
}
}
element {
scale: 19
lines {
width: 4.4
color: 6710886
priority: 1563
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 3.2
color: 15658734
priority: 1689
join: ROUNDJOIN
cap: ROUNDCAP
}
lines {
width: 3.2
color: 6710886
dashdot {
dd: 12.0
dd: 12.0
}
priority: 1737
join: ROUNDJOIN
cap: BUTTCAP
}
path_text {
primary {
height: 12
color: 3364317
stroke_color: 16777215
}
priority: 16563
}
}
}
cont {
name: "railway-razed"
element {
@ -56570,6 +56829,149 @@ cont {
}
}
}
cont {
name: "route-ferry-motor_vehicle"
element {
scale: 10
lines {
width: 1.0
color: 10075118
dashdot {
dd: 3.0
dd: 2.0
}
priority: 1174
join: ROUNDJOIN
cap: BUTTCAP
}
}
element {
scale: 11
lines {
width: 1.0
color: 10075118
dashdot {
dd: 3.0
dd: 2.0
}
priority: 1174
join: ROUNDJOIN
cap: BUTTCAP
}
}
element {
scale: 12
lines {
width: 1.0
color: 10075118
dashdot {
dd: 3.0
dd: 2.0
}
priority: 1376
join: ROUNDJOIN
cap: BUTTCAP
}
}
element {
scale: 13
lines {
width: 1.0
color: 10075118
dashdot {
dd: 3.0
dd: 2.0
}
priority: 1412
join: ROUNDJOIN
cap: BUTTCAP
}
}
element {
scale: 14
lines {
width: 1.0
color: 10075118
dashdot {
dd: 3.0
dd: 2.0
}
priority: 1475
join: ROUNDJOIN
cap: BUTTCAP
}
}
element {
scale: 15
lines {
width: 1.0
color: 10075118
dashdot {
dd: 7.0
dd: 5.0
}
priority: 1650
join: ROUNDJOIN
cap: BUTTCAP
}
}
element {
scale: 16
lines {
width: 2.0
color: 11193565
dashdot {
dd: 12.0
dd: 8.0
}
priority: 1837
join: ROUNDJOIN
cap: BUTTCAP
}
}
element {
scale: 17
lines {
width: 2.0
color: 11193565
dashdot {
dd: 12.0
dd: 8.0
}
priority: 1927
join: ROUNDJOIN
cap: BUTTCAP
}
}
element {
scale: 18
lines {
width: 2.0
color: 11193565
dashdot {
dd: 12.0
dd: 8.0
}
priority: 1927
join: ROUNDJOIN
cap: BUTTCAP
}
}
element {
scale: 19
lines {
width: 2.0
color: 11193565
dashdot {
dd: 12.0
dd: 8.0
}
priority: 1927
join: ROUNDJOIN
cap: BUTTCAP
}
}
}
cont {
name: "route-ferry-motorcar"
element {

View file

@ -991,3 +991,5 @@ junction|roundabout;[junction=roundabout];;name;int_name;990;
highway|speed_camera;[highway=speed_camera];;name;int_name;991;
shop|beauty;[shop=beauty];;name;int_name;992;
shop|sports;[shop=sports];;name;int_name;993;
route|ferry|motor_vehicle;[route=ferry];;name;int_name;994;
railway|rail|motor_vehicle;[railway=rail];;name;int_name;995;

Can't render this file because it has a wrong number of fields in line 371.

View file

@ -991,3 +991,5 @@ junction|roundabout
highway|speed_camera
shop|beauty
shop|sports
route|ferry|motor_vehicle
railway|rail|motor_vehicle

View file

@ -47,14 +47,21 @@ CarModel::CarModel()
VehicleModel::VehicleModel(Classificator const & c, vector<SpeedForType> const & speedLimits)
: m_maxSpeed(0),
m_onewayType(c.GetTypeByPath({ "hwtag", "oneway" })),
m_ferryType(c.GetTypeByPath({ "route", "ferry", "motorcar" }))
m_onewayType(c.GetTypeByPath({ "hwtag", "oneway" }))
{
for (size_t i = 0; i < speedLimits.size(); ++i)
{
m_maxSpeed = max(m_maxSpeed, speedLimits[i].m_speed);
m_types[c.GetTypeByPath(vector<string>(speedLimits[i].m_types, speedLimits[i].m_types + 2))] = speedLimits[i];
}
initializer_list<char const *> arr[] = {
{ "route", "ferry", "motorcar" },
{ "route", "ferry", "motor_vehicle" },
{ "railway", "rail", "motor_vehicle" },
};
for (size_t i = 0; i < ARRAY_SIZE(arr); ++i)
m_addRoadTypes.push_back(c.GetTypeByPath(arr[i]));
}
double VehicleModel::GetSpeed(FeatureType const & f) const
@ -109,7 +116,7 @@ bool VehicleModel::IsRoad(vector<uint32_t> const & types) const
bool VehicleModel::IsRoad(uint32_t type) const
{
return (type == m_ferryType ||
return (find(m_addRoadTypes.begin(), m_addRoadTypes.end(), type) != m_addRoadTypes.end() ||
m_types.find(ftypes::BaseChecker::PrepareToMatch(type, 2)) != m_types.end());
}

View file

@ -1,4 +1,6 @@
#pragma once
#include "../base/buffer_vector.hpp"
#include "../std/unordered_map.hpp"
#include "../std/utility.hpp"
#include "../std/vector.hpp"
@ -51,7 +53,8 @@ private:
typedef unordered_map<uint32_t, SpeedForType> TypesT;
TypesT m_types;
uint32_t m_onewayType, m_ferryType;
buffer_vector<uint32_t, 4> m_addRoadTypes;
uint32_t m_onewayType;
};
class CarModel : public VehicleModel