Author Topic: stat tables in untraveled regions & systems  (Read 783 times)

0 Members and 1 Guest are viewing this topic.

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2056
  • Last Login:Yesterday at 11:38:09 pm
stat tables in untraveled regions & systems
« on: May 23, 2018, 12:55:40 am »
http://tm.teresco.org/user/region.php?units=miles&u=yakra&rg=ESP-CL
                            Overall ESP-CL Region Statistics                           
Active SystemsActive + Preview Systems
Distance Traveled     0.00 of 0.00 miles (%) Rank: 5     0.00 of 0.00 miles (%) Rank: 5
Routes Drivenof 111 (%) Rank: 7of 150 (%) Rank: 7
Routes Clinchedof 111 (%) Rank: 7of 150 (%) Rank: 7

Routes Driven & Clinched should read "0 of 111 (0%) Rank: N/A", etc.
For Distance Traveled, note that my rank here is 5, not 7. There are 6 travelers listed in the table at the bottom of the page.

http://tm.teresco.org/user/system.php?units=miles&u=yakra&sys=espa
  System Statistics for Spain Autopista / Autovia 
Distance Traveled     0.00 of 8801.73 miles (0.00%) Rank: 17
Routes Traveledof 269 (0%)
Routes Clinchedof 269 (0%) Rank: 18

Distance Traveled: Per espa-all.csv there are 17 travelers on the espa system, so at 0 miles I would be tied for 18th place.
Routes Driven:
  • 0 of 269 (0%)
  • No rank is shown. (Same for a system I have traveled.)
  • This stat is "Driven" on region.php and "Traveled" on system.php. It should be consistent between the two. (Was it discussed & decided to move from "Driven" to "Traveled" once upon a time?)
Routes Clinched: 0 of 269 (0%) Rank: N/A

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2056
  • Last Login:Yesterday at 11:38:09 pm
Re: stat tables in untraveled regions & systems
« Reply #1 on: June 15, 2018, 03:30:47 pm »
Note also that region.php incorrectly reports 0 miles total in Active Systems and Active + Preview Systems.

See also:
http://travelmapping.net/user/region.php?units=miles&u=the_spui_ninja&rg=ME
http://travelmapping.net/user/region.php?units=miles&u=oscar&rg=GU

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 1609
  • Last Login:Today at 02:28:11 am
Re: stat tables in untraveled regions & systems
« Reply #2 on: June 15, 2018, 03:57:33 pm »
There are a lot bugs like this......................

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2056
  • Last Login:Yesterday at 11:38:09 pm
Re: stat tables in untraveled regions & systems
« Reply #3 on: July 12, 2019, 06:25:41 pm »
Possibly related, possibly not:
http://forum.travelmapping.net/index.php?topic=2152
We'll have to keep an eye on the one thing as we fix the other thing...

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2056
  • Last Login:Yesterday at 11:38:09 pm
Re: stat tables in untraveled regions & systems
« Reply #4 on: Yesterday at 12:15:03 pm »
region.php

Why total mileage is listed as 0:
$activeTotalMileage = $row['totalActiveMileage'];
when
$row = tm_fetch_user_row_with_rank($activeClinchedRes, 'activeClinched');
when there is no actual user row to fetch in $activeClinchedRes.
Using a separate query to get total mileage before the main query that gets our results, similar to what's done elsewhere on the site, should clear this up.

Why Distance Traveled Rank is n out of n travelers:
In tm_fetch_user_row_with_rank, the while loop is executed 8 times, once for each traveler. $rank is set to $nextRank for values of 1 to 8 inclusive.

Why Routes Traveled/Clinched Rank is n+1 out of n travelers:
If I query
SELECT traveler, SUM(cr.clinched) AS clinched, ROUND(sum(cr.clinched) / 112 * 100, 2) as clinchedPct FROM routes AS r LEFT JOIN clinchedRoutes AS cr ON cr.route = r.root LEFT JOIN systems ON r.systemName = systems.systemName WHERE (r.region = 'ESP-CT' AND systems.level = 'active') GROUP BY traveler ORDER BY clinched DESC;
I get an extra 9th row in my results where all fields are NULL, allowing for one more iteration of the while loop in tm_fetch_user_row_with_rank.
Changing the first LEFT JOIN to a RIGHT JOIN eliminates this extra row. (Do we want to do this?)
Technically, I am in a 238-way tie for 9th place here, along with everyone else traveling 0 routes. Do we prefer to present this information that way, or as N/A as suggested in the OP?