void operator()(FeatureType const & ft) { static CarModel const carModel; if (ft.GetFeatureType() != feature::GEOM_LINE || !carModel.IsRoad(ft)) return; uint32_t const featureId = ft.GetID().m_index; for (auto const n : m_routingMapping.m_segMapping.GetNodeIdByFid(featureId)) n_nodeIds.push_back(n); }
void MapObject::SetFromFeatureType(FeatureType const & ft) { m_mercator = feature::GetCenter(ft); m_name = ft.GetNames(); m_types = feature::TypesHolder(ft); m_metadata = ft.GetMetadata(); m_featureID = ft.GetID(); ASSERT(m_featureID.IsValid(), ()); m_geomType = ft.GetFeatureType(); }
void StreetVicinityLoader::LoadStreet(uint32_t featureId, Street & street) { FeatureType feature; if (!m_context->GetFeature(featureId, feature)) return; if (feature.GetFeatureType() != feature::GEOM_LINE) return; vector<m2::PointD> points; feature.ForEachPoint(MakeBackInsertFunctor(points), FeatureType::BEST_GEOMETRY); ASSERT(!points.empty(), ()); for (auto const & point : points) street.m_rect.Add(MercatorBounds::RectByCenterXYAndSizeInMeters(point, m_offsetMeters)); covering::CoveringGetter coveringGetter(street.m_rect, covering::ViewportWithLowLevels); auto const & intervals = coveringGetter.Get(m_scale); m_context->ForEachIndex(intervals, m_scale, MakeBackInsertFunctor(street.m_features)); street.m_calculator = make_unique<ProjectionOnStreetCalculator>(points); }