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

Method FindBuildingAtPoint

libs/map/framework.cpp:2149–2168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2147}
2148
2149FeatureID Framework::FindBuildingAtPoint(m2::PointD const & mercator) const
2150{
2151 FeatureID featureId;
2152 if (GetDrawScale() >= m_minBuildingsTapZoom)
2153 {
2154 constexpr int kScale = scales::GetUpperScale();
2155 constexpr double kSelectRectWidthInMeters = 1.1;
2156 m2::RectD const rect = mercator::RectByCenterXYAndSizeInMeters(mercator, kSelectRectWidthInMeters);
2157 m_featuresFetcher.ForEachFeature(rect, [&](FeatureType & ft)
2158 {
2159 if (!featureId.IsValid() && ft.GetGeomType() == feature::GeomType::Area &&
2160 ftypes::IsBuildingChecker::Instance()(ft) && ft.GetLimitRect(kScale).IsPointInside(mercator) &&
2161 feature::GetMinDistanceMeters(ft, mercator) == 0.0)
2162 {
2163 featureId = ft.GetID();
2164 }
2165 }, kScale);
2166 }
2167 return featureId;
2168}
2169
2170void Framework::BuildTrackPlacePage(Track::TrackSelectionInfo const & trackSelectionInfo, place_page::Info & info)
2171{

Callers

nothing calls this directly

Calls 9

GetUpperScaleFunction · 0.85
GetMinDistanceMetersFunction · 0.85
ForEachFeatureMethod · 0.45
IsValidMethod · 0.45
GetGeomTypeMethod · 0.45
IsPointInsideMethod · 0.45
GetLimitRectMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected