MCPcopy Create free account
hub / github.com/comaps/comaps / GetType

Method GetType

libs/search/model.cpp:79–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77} // namespace
78
79Model::Type Model::GetType(FeatureType & feature) const
80{
81 // Check whether object is POI first to mark POIs with address tags as POI.
82 if (IsComplexPoiChecker::Instance()(feature))
83 return TYPE_COMPLEX_POI;
84 if (IsPoiChecker::Instance()(feature))
85 return TYPE_SUBPOI;
86
87 if (CustomIsBuildingChecker::Instance()(feature))
88 return TYPE_BUILDING;
89
90 if (IsStreetOrSquareChecker::Instance()(feature))
91 return TYPE_STREET;
92
93 if (IsSuburbChecker::Instance()(feature))
94 return TYPE_SUBURB;
95
96 auto const type = IsLocalityChecker::Instance().GetType(feature);
97 switch (type)
98 {
99 case LocalityType::State: return TYPE_STATE;
100 case LocalityType::Country: return TYPE_COUNTRY;
101 case LocalityType::City:
102 case LocalityType::Town: return TYPE_CITY;
103 case LocalityType::Village: return TYPE_VILLAGE;
104 case LocalityType::Count: ASSERT(false, ()); [[fallthrough]];
105 case LocalityType::None: return TYPE_UNCLASSIFIED;
106 }
107
108 ASSERT(false, ("Unknown locality type:", static_cast<int>(type)));
109 return TYPE_UNCLASSIFIED;
110}
111
112string DebugPrint(Model::Type type)
113{

Callers 15

GetNearbyPlacesMethod · 0.45
GetCountryNameMethod · 0.45
OrderCountriesMethod · 0.45
GoImplMethod · 0.45
FillVillageLocalitiesMethod · 0.45
ForEachCountryMethod · 0.45
MatchRegionsMethod · 0.45
MatchCitiesMethod · 0.45
MatchAroundPivotMethod · 0.45
GetTypeInGeocodingMethod · 0.45

Calls 1

ASSERTFunction · 0.85

Tested by

no test coverage detected