21 void df028_SQliteIPLocation() {
23 auto rdf = ROOT::RDF::MakeSqliteDataFrame(
"http://root.cern/files/root_download_stats.sqlite",
"SELECT * FROM accesslog;" );
25 auto f = TFile::Open(
"http://root.cern.ch/files/WM.root");
26 auto worldMap = f->Get<TH2Poly>(
"WMUSA");
28 auto fillIPLocation = [&worldMap] (
const std::string &sLongitude,
const std::string &sLatitude ) {
29 if (!( sLongitude ==
"" ) && !( sLatitude ==
"" )) {
30 auto latitude = std::stof(sLatitude);
31 auto longitude = std::stof(sLongitude);
32 worldMap->Fill(longitude, latitude);
36 rdf.Foreach( fillIPLocation, {
"IPLongitude",
"IPLatitude" } );
38 auto worldMapCanvas =
new TCanvas();
39 worldMapCanvas->SetLogz();
40 worldMap->SetTitle(
"ROOT Downloads per Location (GitHub exluded);Longitude;Latitude");
41 worldMap->DrawClone(
"colz");