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

Method GetFeatures

generator/coastlines_generator.cpp:282–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280};
281
282std::vector<feature::FeatureBuilder> CoastlineFeaturesGenerator::GetFeatures(size_t maxThreads)
283{
284 uint32_t const coastType = ftypes::IsCoastlineChecker::Instance().GetCoastlineType();
285
286 std::vector<feature::FeatureBuilder> features;
287 std::mutex featuresMutex;
288
289 RegionInCellSplitter::Process(
290 maxThreads, RegionInCellSplitter::kStartLevel, m_tree,
291 [&](RegionInCellSplitter::TCell const & cell, coastlines_generator::DoDifference & cellData)
292 {
293 feature::FeatureBuilder fb;
294 fb.SetCoastCell(cell.ToInt64(RegionInCellSplitter::kHighLevel + 1));
295
296 cellData.AssignGeometry(fb);
297 fb.SetArea();
298 fb.AddType(coastType);
299
300 // Should represent non-empty geometry
301 CHECK_GREATER(fb.GetPolygonsCount(), 0, ());
302 CHECK_GREATER_OR_EQUAL(fb.GetPointsCount(), 3, ());
303
304 std::lock_guard lock(featuresMutex);
305 features.emplace_back(std::move(fb));
306 });
307
308 return features;
309}

Callers 1

ProcessMethod · 0.80

Calls 10

ProcessFunction · 0.85
GetCoastlineTypeMethod · 0.80
SetCoastCellMethod · 0.80
ToInt64Method · 0.80
AssignGeometryMethod · 0.80
SetAreaMethod · 0.80
GetPolygonsCountMethod · 0.80
AddTypeMethod · 0.45
GetPointsCountMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected