Author Topic: Regional Statistics - Discrepancy on Total Clinchable Mileage  (Read 25613 times)

0 Members and 1 Guest are viewing this topic.

Offline bejacob

  • Full Member
  • ***
  • Posts: 233
  • Last Login:Today at 07:55:45 am
Something odd is going on here http://tm.teresco.org/user/region.php?units=miles&u=bejacob&rg=ABW

I picked ABW as a region because there is only one system so it's easy to see the issue. I'm guessing the same thing may be happening in other regions, though with multiple systems, it might be difficult to tell. This is a low priority fix, it's just something I noticed.

The first table "Overall ABW Region Statistics" shows a total of 53.76 clinchable miles

The second table "Statistics by System" shows 71.88 clinchable miles. I'm assuming concurrencies are not being correctly calculated on this table (i.e. the total is just the sum of the mileage from the route in the next table "Statistics by Route" without concern for concurrencies).

The last table once again has 53.76 total miles that could be clinched.

It's probably not a big deal that one part of this page is wrong, but it would be nice if all tables on this page show the same total possible mileage that could be clinched.

Again, low priority, just something I saw and thought to bring up.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #1 on: June 14, 2017, 08:56:27 pm »
Definitely something to check, out thanks.

https://github.com/TravelMapping/Web/issues/186

Offline the_spui_ninja

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 803
  • Last Login:Today at 10:12:22 am
  • THE Western SD Highway Nut
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #2 on: June 24, 2017, 11:24:08 am »
The second table "Statistics by System" shows 71.88 clinchable miles. I'm assuming concurrencies are not being correctly calculated on this table (i.e. the total is just the sum of the mileage from the route in the next table "Statistics by Route" without concern for concurrencies).
I think that's the case; I noticed the same thing in Idaho where adding up the statistics by system is more than the total clinchable mileage.
An adventure is only an inconvenience rightly considered. An inconvenience is only an adventure wrongly considered. - G.K. Chesterton

Offline new_friends_gr

  • Newbie
  • *
  • Posts: 7
  • Gender: Male
  • Last Login:July 29, 2017, 02:35:01 pm
  • A.J. Bertin
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #3 on: July 22, 2017, 03:11:59 pm »
I noticed a similar issue discrepancy with some of my travel data. We'll use the Interstate highways in Ohio as my example.

When I look at my table under Statistics by Region, it says that I have 15.39% of Ohio's highways traveled (I assume this incorporates all systems in Ohio). For the Interstate system within Ohio, it says I have 1476.33 miles of 1736.43 miles clinched (85.02%).

On the other hand, when I look at my table under Statistics by System, then go to Interstate Highways, and then Ohio as the region, it says I have 1317.50 of 1577.61 miles clinched (83.51%). I guess I'm not sure why these numbers don't match the ones above. Any idea?

Offline Ib3kii

  • Milwaukeye
  • Full Member
  • ***
  • Posts: 130
  • Gender: Male
  • Last Login:January 12, 2023, 02:02:21 pm
  • I want to be the first one to collect them all!
    • Travel Mapping User Page
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #4 on: July 23, 2017, 03:27:09 am »
I believe it has to do with concurring routes. I big example in Ohio is I-80/90, the two routes concur together for over 100 miles so I believe concurrences are where those extra miles come from.
-The journey of a thousand miles begins with a single step... on the gas.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #5 on: July 23, 2017, 04:25:32 am »
I big example in Ohio is I-80/90, the two routes concur together for over 100 miles so I believe concurrences are where those extra miles come from.

I-80/I-90 concurrency is NOT broken in Ohio.

Offline si404

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2067
  • Last Login:Today at 07:06:38 am
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #6 on: July 23, 2017, 08:48:43 am »
I big example in Ohio is I-80/90, the two routes concur together for over 100 miles so I believe concurrences are where those extra miles come from.

I-80/I-90 concurrency is NOT broken in Ohio.
The issue is with the processing of the data - one figure single counts the concurrency, the other double counts it.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #7 on: July 23, 2017, 09:25:52 am »
The issue is with the processing of the data - one figure single counts the concurrency, the other double counts it.

I've added my region mileages and it's exactly my total mileage (53524.17mi). If there is really a general bug that concurrent routes are (always?) counted twice, all stats would be... quite incorrect...

Offline mapmikey

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 1227
  • Last Login:Today at 08:51:15 am
    • Co-curator Virginia Highways Project
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #8 on: July 23, 2017, 10:31:27 am »
It appears to me this is what happens, using my Georgia file as an example http://tm.teresco.org/user/region.php?units=miles&u=mapmikey&rg=GA

The distance traveled at the top is the actual road mileage in the TM for Georgia, not the route mileage, meaning no concurrencies are counted twice or more.

I have not updated my Georgia file very far for the state route system, so most of my state route clinches in TM are associated with the US route overlays.  So most of my state route clinches do not contribute to the overall region total.

 Therefore looking at the state route clinched mileage it will include any state route's road mileage (includes concurrency routings with US routes), not the route mileage (concurrencies with other state routes).  If I go to the individual state route listings I would then get the mileage of that individual's route including any concurrencies.

TM at the region level or overall stats level is summing road miles, not route miles.






Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #9 on: July 23, 2017, 01:55:20 pm »
Thanks for the bump on this.  I just need to trace through where this is all calculated (possibly some combination of site update and web DB queries) to see where the double-counting is coming in.  Might be able to look tonight.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #10 on: July 23, 2017, 09:19:32 pm »
region.php has code that pulls from route-by-route mileages from the DB and adds them up without considering possible concurrencies.  system.php pulls the sums from the DB which does account for concurrencies during the site update process.  I need to change region.php's queries to use the numbers already computed and stored in the DB.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #11 on: July 23, 2017, 10:16:09 pm »
I have a possible fix for region.php on the tmtest server now.  It no longer will list devel systems, but I never thought they made sense on the stat pages anyway since we can't clinch them.  Please let me know how it looks.

Offline new_friends_gr

  • Newbie
  • *
  • Posts: 7
  • Gender: Male
  • Last Login:July 29, 2017, 02:35:01 pm
  • A.J. Bertin
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #12 on: July 24, 2017, 07:24:59 am »
As of this morning, the discrepancy still exists between the two places where I'm looking at my mileage on Ohio's interstates. But I think the fact that one of those calculations counts the concurrencies separately and the other calculation does not seems to explain it. The difference is about 158 miles which seems like a fairly accurate number of miles of Interstate highways in Ohio that have concurrencies.

Thanks for looking into this!

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #13 on: July 24, 2017, 07:34:37 am »
I have a possible fix for region.php on the tmtest server now.

http://tmtest.teresco.org/stat.php
http://tm.teresco.org/stat.php

Both output exactly the same figures. Single user stats for regions are also identical.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: Regional Statistics - Discrepancy on Total Clinchable Mileage
« Reply #14 on: July 24, 2017, 09:34:13 am »
As of this morning, the discrepancy still exists between the two places where I'm looking at my mileage on Ohio's interstates. But I think the fact that one of those calculations counts the concurrencies separately and the other calculation does not seems to explain it. The difference is about 158 miles which seems like a fairly accurate number of miles of Interstate highways in Ohio that have concurrencies.

Looks like they match when I bring them up.  Maybe you're looking at the production server instead of the test server. Here are the pages I'm looking at:

http://tmtest.teresco.org/user/region.php?units=miles&u=new_friends_gr&rg=OH

http://tmtest.teresco.org/user/system.php?units=miles&u=new_friends_gr&sys=usai

I'll push this to the production server some time today unless I hear of problems.