mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-29 09:13:46 +00:00
Compare commits
2 Commits
map-per-co
...
map-per-di
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b74487278 | ||
|
|
1ccea5928f |
4610
data/countries.txt
4610
data/countries.txt
File diff suppressed because it is too large
Load Diff
@@ -45,9 +45,8 @@
|
||||
#
|
||||
# A C++ parser implementation used by the generator is in generator/utils.cpp::ParseMapCSS().
|
||||
# A python parser implementation used to compile *.mapcss style files is in tools/kothic/src/libkomwm.py::komap_mapswithme().
|
||||
# The rendering engine in the app doesn't use this file directly, it loads a data/types.txt
|
||||
# The app doesn't use this file directly, it loads a data/types.txt
|
||||
# which is derived from this file during style files compilation.
|
||||
# A C++ parser for matching types to OSM tags is implemented in editor/feature_type_to_osm.cpp.
|
||||
#
|
||||
# Types that don't have any style defined are discarded by the generator.
|
||||
# To prevent discarding, add them to the exceptions in indexer/feature_visibility.cpp::IsUsefulNondrawableType()
|
||||
@@ -1362,7 +1361,7 @@ historic|memorial|plaque;[historic=memorial][memorial=plaque],[historic=memorial
|
||||
historic|castle|defensive;[historic=castle][castle_type=defensive];;name;int_name;1234;
|
||||
historic|castle|stately;[historic=castle][castle_type=stately];;name;int_name;1235;
|
||||
attraction|animal;1236;
|
||||
disusedbusiness;[disused:shop?],[disused:amenity=restaurant],[disused:amenity=fast_food],[disused:amenity=cafe],[disused:amenity=pub],[disused:amenity=bar];;;;1237;
|
||||
disusedbusiness;[disused:shop?],[disused:amenity=restaurant],[disused:amenity=fast_food],[disused:amenity=cafe],[disused:amenity=pub],[disused:amenity=bar],[disused:amenity=ice_cream],[disused:amenity=pharmacy],[disused:amenity=post_office],[disused:amenity=bank],[disused:amenity=bureau_de_change],[disused:amenity=car_rental],[disused:amenity=motorcycle_rental],[disused:amenity=casino],[disused:amenity=gambling],[disused:amenity=internet_cafe],[disused:craft=confectionery],[disused:craft=electronics_repair],[disused:craft=shoemaker],[disused:craft=tailor],[disused:craft=key_cutter],[disused:craft=locksmith],[disused:office=estate_agent],[disused:office=insurance];;;;1237;
|
||||
cuisine|regional;1238;
|
||||
cuisine|pizza;1239;
|
||||
cuisine|burger;1240;
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 7 and column 16.
|
@@ -35,31 +35,24 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
|
||||
getline(s, line);
|
||||
strings::Trim(line);
|
||||
|
||||
// skip empty lines and comments
|
||||
if (line.empty() || line.front() == '#')
|
||||
// skip empty lines, comments, deprecated and moved types
|
||||
if (line.empty() || line.front() == '#' || line.starts_with("deprecated") || line.starts_with("moved") ||
|
||||
line.back() != ';')
|
||||
continue;
|
||||
|
||||
std::vector<std::string> rowTokens;
|
||||
strings::ParseCSVRow(line, ';', rowTokens);
|
||||
|
||||
// make sure entry is in full or short format
|
||||
if (rowTokens.size() != 3 && rowTokens.size() != 7)
|
||||
std::vector<std::string_view> const rowTokens = strings::Tokenize(line, ";");
|
||||
if (rowTokens.size() < 2)
|
||||
{
|
||||
ASSERT(false, ("Invalid feature type definition:", line));
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip deprecated and moved types
|
||||
if ((rowTokens.size() == 3 && !rowTokens[2].empty()) || (rowTokens.size() == 7 && rowTokens[2] == "x"))
|
||||
continue;
|
||||
|
||||
// Get internal feature type
|
||||
ASSERT(!rowTokens[0].empty(), ("No feature type found:", line));
|
||||
std::vector<std::string_view> const featureTypeTokens = strings::Tokenize(rowTokens[0], "|");
|
||||
uint32_t const type = classif().GetTypeByPathSafe(featureTypeTokens);
|
||||
ASSERT(type != IndexAndTypeMapping::INVALID_TYPE, ("Feature with invalid type:", line));
|
||||
|
||||
if (rowTokens.size() == 3)
|
||||
if (rowTokens.size() == 2)
|
||||
{
|
||||
// Derive OSM tags from type name
|
||||
ASSERT(featureTypeTokens.size() <= 2, ("OSM tags can not be inferred from name:", line));
|
||||
@@ -84,11 +77,6 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
|
||||
else
|
||||
{
|
||||
// OSM tags are listed in the feature type entry
|
||||
if (rowTokens[1].empty())
|
||||
{
|
||||
ASSERT(false, ("No OSM tags found:", line));
|
||||
continue;
|
||||
}
|
||||
std::vector<std::string_view> const osmTagTokens = strings::Tokenize(rowTokens[1], ",");
|
||||
|
||||
// First entry is the best practice way to tag a feature
|
||||
|
||||
@@ -104,6 +104,24 @@ bool EditableMapObject::CanMarkPlaceAsDisused() const
|
||||
"amenity-cafe",
|
||||
"amenity-pub",
|
||||
"amenity-bar",
|
||||
"amenity-ice_cream",
|
||||
"amenity-pharmacy",
|
||||
"amenity-post_office",
|
||||
"amenity-bank",
|
||||
"amenity-bureau_de_change",
|
||||
"amenity-car_rental",
|
||||
"amenity-motorcycle_rental",
|
||||
"amenity-casino",
|
||||
"amenity-gambling",
|
||||
"amenity-internet_cafe",
|
||||
"craft-confectionery",
|
||||
"craft-electronics_repair",
|
||||
"raft-shoemaker",
|
||||
"craft-tailor",
|
||||
"craft-key_cutter",
|
||||
"craft-locksmith",
|
||||
"office-estate_agent",
|
||||
"office-insurance",
|
||||
};
|
||||
|
||||
for (auto const & typePrefix : typePrefixes)
|
||||
|
||||
Reference in New Issue
Block a user