[classifier] Added boundary=protected_area.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako 2023-06-19 23:31:35 -03:00
parent b3d0b03178
commit 62ee98808d
7 changed files with 115 additions and 44 deletions

View file

@ -195,7 +195,7 @@ highway|path|bridge;[highway=path][bridge?];;name;int_name;194;
piste:type|nordic;195;
natural|beach|gravel;[natural=beach][surface=gravel];;name;int_name;196;
railway|crossing;197;
boundary|national_park;198;
boundary|protected_area;198;
natural|wood|deciduous;[natural=wood][wood=deciduous],[natural=wood][leaf_type=deciduous],[natural=wood][leaf_cycle=deciduous];x;name;int_name;199;landuse|forest|deciduous
waterway|dam;200;
amenity|charging_station|motorcar;[amenity=charging_station][motorcar?];;name;int_name;201;
@ -478,12 +478,12 @@ aerialway|platter;477;
deprecated|deprecated;478;x
deprecated|deprecated;479;x
railway|preserved|tunnel;[railway=preserved][tunnel?];;name;int_name;480;
deprecated|deprecated;481;x
deprecated|deprecated;482;x
deprecated|deprecated;483;x
deprecated|deprecated;484;x
deprecated|deprecated;485;x
deprecated|deprecated;486;x
boundary|protected_area|1;[boundary=protected_area][protect_class=1],[boundary=protected_area][protect_class=1a],[boundary=protected_area][protect_class=1b];;name;int_name;481;
boundary|protected_area|2;[boundary=protected_area][protect_class=2];;name;int_name;482;
boundary|protected_area|3;[boundary=protected_area][protect_class=3];;name;int_name;483;
boundary|protected_area|4;[boundary=protected_area][protect_class=4];;name;int_name;484;
boundary|protected_area|5;[boundary=protected_area][protect_class=5];;name;int_name;485;
boundary|protected_area|6;[boundary=protected_area][protect_class=6];;name;int_name;486;
leisure|park|permissive;[leisure=park][access=permissive];;name;int_name;487;
highway|bridleway|tunnel;[highway=bridleway][tunnel?];;name;int_name;488;
highway|motorway_link|tunnel;[highway=motorway_link][tunnel?];;name;int_name;489;
@ -837,7 +837,7 @@ deprecated|deprecated;836;x
deprecated|deprecated;837;x
deprecated|deprecated;838;x
landuse|military|danger_area;[landuse=military][military=danger_area][wikipedia?],[landuse=military][military=cordon][wikipedia?];;name;int_name;839;
boundary|military;840;
boundary|national_park;840;
deprecated|deprecated;841;x
deprecated|deprecated;842;x
deprecated|deprecated;843;x

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

View file

@ -5256,6 +5256,46 @@
zh-Hans = 国家公园
zh-Hant = 國家公園
[type.boundary.protected_area]
en = Protected Area
ar = منطقة محمية
be = Запаведная зона
bg = Защитена местност
ca = Àrea Protegida
cs = Chráněné území
da = Beskyttet område
de = Geschützter Bereich
el = Προστατευόμενη Περιοχή
es = Área protegida
et = Kaitseala
eu = Babestutako Eremua
fa = منطقه حفاظت شده
fi = Suojeltu alue
fr = Zone protégée
he = אזור מוגן
hu = Védett terület
id = Kawasan Lindung
it = Area protetta
ja = 保護区域
ko = 보호구역
mr = संरक्षित क्षेत्र
nb = Vernet område
nl = Beschermd gebied
pl = Strefa chroniona
pt = Área protegida
pt-BR = Área protegida
ro = Zonă protejată
ru = Заповедная зона
sk = Chránené územie
sv = Skyddat område
sw = Eneo Lindwa
th = พื้นที่คุ้มครอง
tr = Korunmuş bölge
uk = Заповідна зона
vi = Khu bảo tồn
zh-Hans = 保护区
zh-Hant = 保護區
[type.building]
en = Building
ar = مبنى

View file

@ -61,6 +61,7 @@ area[landuse=reservoir],
*/
area[leisure=nature_reserve],
area[boundary=national_park],
area[boundary=protected_area],
area[landuse=military],
{fill-position: foreground; z-index: 2;}
@ -180,9 +181,6 @@ node[waterway=lock_gate],
line[man_made=cutline]
{z-index: 120;}
line[boundary=military]
{z-index: 125;}
line[boundary=administrative]
{z-index: 130;}
@ -269,10 +267,6 @@ line|z9[boundary=administrative][admin_level=4]
line|z10-[boundary=administrative][admin_level=4]
{width: 1.2;dashes: 1.8,0.9;}
/* 3.3 Military */
line|z10-[boundary=military]
{color: @military;opacity: 1;dashes: 1.8,0.9;width: 1.2;}
/* 4.VEGETATION */
@ -352,6 +346,7 @@ area|z12-13[landuse=field],
/* Next types are hardcoded to have a hatching-style fill, see drape_frontend/stylist.cpp */
area|z10-[leisure=nature_reserve],
area|z10-[boundary=national_park],
area|z10-[boundary=protected_area][protect_class=1],
{fill-opacity: 0.2; fill-color: @green6;}
area|z10-[landuse=military][military=danger_area],

View file

@ -555,8 +555,8 @@ area|z14-[natural=bare_rock],
node|z12-[boundary=national_park],
area|z12-[boundary=national_park],
node|z12-[boundary=national_park],
area|z12-[boundary=national_park],
node|z12-[boundary=protected_area],
area|z12-[boundary=protected_area],
node|z12-[leisure=nature_reserve],
area|z12-[leisure=nature_reserve]
{text: name;text-color: @park_label;text-halo-opacity: 0.8;text-halo-color: @label_halo_light;text-halo-radius:0.5;}
@ -627,29 +627,29 @@ area|z17-[leisure=beach_resort]
node|z11[boundary=national_park],
area|z11[boundary=national_park],
node|z11[boundary=national_park],
area|z11[boundary=national_park],
node|z11[boundary=protected_area],
area|z11[boundary=protected_area],
node|z11[leisure=nature_reserve],
area|z11[leisure=nature_reserve]
{icon-image: nparkf-outline-s.svg;icon-min-distance: 20;}
node|z12-13[boundary=national_park],
area|z12-13[boundary=national_park],
node|z12-13[boundary=national_park],
area|z12-13[boundary=national_park],
node|z12-13[boundary=protected_area],
area|z12-13[boundary=protected_area],
node|z12-13[leisure=nature_reserve],
area|z12-13[leisure=nature_reserve]
{icon-image: nparkf-outline-s.svg;text-offset: 1;font-size: 10;icon-min-distance: 12;}
node|z14[boundary=national_park],
area|z14[boundary=national_park],
node|z14[boundary=national_park],
area|z14[boundary=national_park],
node|z14[boundary=protected_area],
area|z14[boundary=protected_area],
node|z14[leisure=nature_reserve],
area|z14[leisure=nature_reserve]
{icon-image: nparkf-outline-s.svg;text-offset: 1;font-size: 11;}
node|z15-[boundary=national_park],
area|z15-[boundary=national_park],
node|z15-[boundary=national_park],
area|z15-[boundary=national_park],
node|z15-[boundary=protected_area],
area|z15-[boundary=protected_area],
node|z15-[leisure=nature_reserve],
area|z15-[leisure=nature_reserve]
{icon-image: nparkf-outline-m.svg;text-offset: 1;font-size: 12;text-halo-opacity: 0.9;}

View file

@ -48,6 +48,8 @@ area[shop=supermarket],
node[boundary=national_park],
area[boundary=national_park],
node[boundary=protected_area],
area[boundary=protected_area],
node[leisure=nature_reserve],
area[leisure=nature_reserve]
{z-index: 2700;}
@ -175,6 +177,8 @@ node|z12-[landuse=forest][name],
area|z12-[landuse=forest][name],
node|z12-[boundary=national_park],
area|z12-[boundary=national_park],
node|z12-[boundary=protected_area],
area|z12-[boundary=protected_area],
node|z12-[leisure=nature_reserve],
area|z12-[leisure=nature_reserve]
{text: name;text-color: @park_label;text-halo-opacity: 0.75;text-halo-color: @label_halo_light;text-halo-radius:0.4;}
@ -183,17 +187,23 @@ area|z12-[leisure=nature_reserve]
node|z14-[highway=ford]
{icon-image: dot-m.svg;icon-min-distance: 20;}
/*node|z11[landuse=forest][name],
/*
node|z11[landuse=forest][name],
area|z11[landuse=forest][name],
node|z11[boundary=national_park],
area|z11[boundary=national_park],
node|z11[boundary=protected_area],
area|z11[boundary=protected_area],
node|z11[leisure=nature_reserve],
area|z11[leisure=nature_reserve]
{icon-image: nparkf-outline-s.svg;icon-min-distance: 20;}*/
{icon-image: nparkf-outline-s.svg;icon-min-distance: 20;}
*/
node|z12-13[landuse=forest][name],
area|z12-13[landuse=forest][name],
node|z12-13[boundary=national_park],
area|z12-13[boundary=national_park],
node|z12-13[boundary=protected_area],
area|z12-13[boundary=protected_area],
node|z12-13[leisure=nature_reserve],
area|z12-13[leisure=nature_reserve]
{icon-image: nparkf-outline-s.svg;text-offset: 1;font-size: 11;icon-min-distance: 12;}
@ -201,6 +211,8 @@ node|z14[landuse=forest][name],
area|z14[landuse=forest][name],
node|z14[boundary=national_park],
area|z14[boundary=national_park],
node|z14[boundary=protected_area],
area|z14[boundary=protected_area],
node|z14[leisure=nature_reserve],
area|z14[leisure=nature_reserve]
{icon-image: nparkf-outline-m.svg;text-offset: 1;font-size: 12.25;}
@ -208,6 +220,8 @@ node|z15-16[landuse=forest][name],
area|z15-16[landuse=forest][name],
node|z15-16[boundary=national_park],
area|z15-16[boundary=national_park],
node|z15-16[boundary=protected_area],
area|z15-16[boundary=protected_area],
node|z15-16[leisure=nature_reserve],
area|z15-16[leisure=nature_reserve]
{icon-image: nparkf-outline-m.svg;text-offset: 1;font-size: 12.5;text-halo-opacity: 0.85;}
@ -215,6 +229,8 @@ node|z17-[landuse=forest][name],
area|z17-[landuse=forest][name],
node|z17-[boundary=national_park],
area|z17-[boundary=national_park],
node|z17-[boundary=protected_area],
area|z17-[boundary=protected_area],
node|z17-[leisure=nature_reserve],
area|z17-[leisure=nature_reserve]
{icon-image: nparkf-outline-m.svg;text-offset: 1;font-size: 13.75;text-halo-opacity: 0.9;}
@ -1030,6 +1046,8 @@ node|z19-[amenity=parking],
area|z19-[amenity=parking]
{icon-image: parking-m.svg;icon-min-distance: 6;}
/*node|z17-[amenity=bicycle_parking],
/*
node|z17-[amenity=bicycle_parking],
area|z17-[amenity=bicycle_parking]
{icon-image: bike-parking-m.svg;icon-min-distance: 20;}*/
{icon-image: bike-parking-m.svg;icon-min-distance: 20;}
*/

View file

@ -186,11 +186,14 @@ private:
IsHatchingTerritoryChecker::IsHatchingTerritoryChecker()
{
Classificator const & c = classif();
char const * arr[][2] = {{"leisure", "nature_reserve"},
{"boundary", "national_park"},
{"landuse", "military"}};
for (auto const & p : arr)
m_types.push_back(c.GetTypeByPath({p[0], p[1]}));
base::StringIL arr[] = {
{"leisure", "nature_reserve"},
{"boundary", "national_park"},
{"landuse", "military"},
{"boundary", "protected_area", "1"},
};
for (auto const & sl : arr)
m_types.push_back(c.GetTypeByPath(sl));
}
void CaptionDescription::Init(FeatureType & f, int8_t deviceLang, int const zoomLevel,

View file

@ -679,18 +679,32 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_Ferry)
UNIT_CLASS_TEST(TestWithClassificator, OsmType_Boundary)
{
Tags const tags = {
{ "admin_level", "4" },
{ "boundary", "administrative" },
{ "admin_level", "2" },
{ "boundary", "administrative" },
};
{
Tags const tags = {
{ "admin_level", "4" },
{ "boundary", "administrative" },
{ "admin_level", "2" },
{ "boundary", "administrative" },
};
auto const params = GetFeatureBuilderParams(tags);
auto const params = GetFeatureBuilderParams(tags);
TEST_EQUAL(params.m_types.size(), 2, (params));
TEST(params.IsTypeExist(GetType({"boundary", "administrative", "2"})), ());
TEST(params.IsTypeExist(GetType({"boundary", "administrative", "4"})), ());
TEST_EQUAL(params.m_types.size(), 2, (params));
TEST(params.IsTypeExist(GetType({"boundary", "administrative", "2"})), ());
TEST(params.IsTypeExist(GetType({"boundary", "administrative", "4"})), ());
}
{
Tags const tags = {
{ "protect_class", "1b" },
{ "boundary", "protected_area" },
};
auto const params = GetFeatureBuilderParams(tags);
TEST_EQUAL(params.m_types.size(), 1, (params));
TEST(params.IsTypeExist(GetType({"boundary", "protected_area", "1"})), ());
}
}
UNIT_CLASS_TEST(TestWithClassificator, OsmType_Dibrugarh)
@ -1759,6 +1773,7 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_SimpleTypesSmoke)
{"barrier", "toll_booth"},
{"barrier", "wall"},
{"boundary", "national_park"},
{"boundary", "protected_area"},
{"building", "has_parts"},
{"building", "train_station"},
{"cemetery", "grave"},