The online racing simulator
NASCAR measure the length of a track 15 feet from the outside wall (for ovals), the FIA do it as in the middle unless a track is really long.

NASCAR source, the F1 bit is in Appendix O but I'm not sure where
Interesting thanks!

If we could get a few people to help out, assign each of them five or so tracks to drive, then we could cover the full game very quickly. All a helper would need to post is their lap time driving with the speed limiter on and track they drove. The best idea would be to go with the FIA style measurement and drive as close as possible to the middle of the track, and at 48mph that won't be too hard. Hmm...

The measurements we get won't be perfect of course, but a lot more accurate than the current ones.
The way i was going to do it, is switch the racing line on(4 on kb) then follow that with the limiter on
just pick from the mci package the speed thats the most accurate.. (thats how the km's get calculated on j4f)
Quote from DarkTimes :The best idea would be to go with the FIA style measurement and drive as close as possible to the middle of the track, and at 48mph that won't be too hard. Hmm...

For the purposes of this request, wouldn't it make most sense to follow the racing line as rigidly as possible?

Edit: or just do what mcgas001 said 2 posts up
-
(mcgas001) DELETED by mcgas001
Take the world record hotlap, output .raf, read the positions from there and calculate the total distance.
I once wrote a java program to calculate track length with the pth files.

output for KY1 is
Number of Nodes: 250
FinishLine: 30
Track length: 2980m


import java.io.*;
import java.nio.ByteBuffer;

public class LFSTrackLength {
/*
1) X,Y,Z int : 32-bit fixed point world coordinates (1 metre = 65536)

X and Y are ground coordinates, Z is up.

2) float : 32 bit floating point number


FILE DESCRIPTION :
==================

num unit offset description
--- ---- ------ -----------

HEADER BLOCK :

6 char 0 LFSPTH : do not read file if no match
1 byte 6 version : 0 - do not read file if > 0
1 byte 7 revision : 0 - do not read file if > 0
1 int 8 num nodes : number
1 int 12 finish line : number
......NODE BLOCKS


NODE BLOCK :

1 int 0 centre X : fp
1 int 4 centre Y : fp
1 int 8 centre Z : fp
1 float 12 dir X : float
1 float 16 dir Y : float
1 float 20 dir Z : float
1 float 24 limit left : outer limit
1 float 28 limit right : outer limit
1 float 32 drive left : road limit
1 float 36 drive right : road limit
*/

/**
* @param args
*/
public static void main(String[] args) {
FileInputStream pth = null;
final int NodeLength = 40;
double length = 0;
byte[] buf = new byte[4000];
if(args.length < 1) {
System.out.println("Usage: java LFSTrackLength trackfile.pth");
System.exit(1);
}
try {
pth = new FileInputStream(args[0]);
} catch (IOException ioE) {
System.out.println( ioE );
System.exit(1);
}

if(pth == null) {
System.out.println( "Error gettin access to the file !");
System.exit(1);
}

// read header
try {
pth.read(buf,0,16);
} catch( IOException ioE ) {
System.out.println( ioE );
try {
pth.close();
} catch (IOException ioE2) {}
System.exit(1);
}
// check file description
if(!new String(buf,0,6).equals("LFSPTH") ||
buf[6] != 0 || buf[7] !=0) {
System.out.println("Wrong file type !");
try {
pth.close();
} catch (IOException ioE2) {}
System.exit(1);
}

ByteBuffer wrapper = ByteBuffer.wrap(buf);
wrapper.order(java.nio.ByteOrder.LITTLE_ENDIAN);
int NumNodes = wrapper.getInt(8);
System.out.println("Number of Nodes: " + NumNodes);
System.out.println("FinishLine: " + wrapper.getInt(12));
int NodesLeft = NumNodes;
int NodesRead = 0;
int[] StartPoint = null;
int[] LastPoint = null;
while(NodesLeft > 0) {
int NodesToRead = 0;
if(NodesLeft > 100) // read full buffer
NodesToRead = 100;
else
NodesToRead = NodesLeft;

try {
int BytesRead = pth.read(buf,0,NodesToRead * NodeLength);
NodesRead = BytesRead/40;
} catch( IOException ioE ) {
System.out.println( ioE );
try {
pth.close();
} catch (IOException ioE2) {}
System.exit(1);
}
for(int i = 0; i < NodesRead; i++) {
int offset = i * NodeLength;
int x = wrapper.getInt(offset);
int y = wrapper.getInt(offset + 4);
int z = wrapper.getInt(offset + 8);
// first point on path
if(StartPoint == null) {
StartPoint = new int[3];
StartPoint[0] = x;
StartPoint[1] = y;
StartPoint[2] = z;
LastPoint = new int[3];
} else { // measure distance between points
length += Math.sqrt(Math.pow(LastPoint[0] - x,2) + Math.pow(LastPoint[1] - y,2) + Math.pow(LastPoint[2] -z,2));

}
LastPoint[0] = x;
LastPoint[1] = y;
LastPoint[2] = z;
}
NodesLeft -= NodesRead;
}
length += Math.sqrt(Math.pow(LastPoint[0] - StartPoint[0],2) + Math.pow(LastPoint[1] - StartPoint[1],2) + Math.pow(LastPoint[2] - StartPoint[2],2));

System.out.println("Track length: " + Math.round(length/(double)65535) + "m");
}

}

Answer: 2980 m = 1.85168 mi.
Quote from yankman :I once wrote a java program to calculate track length with the pth files.

output for KY1 is
Number of Nodes: 250
FinishLine: 30
Track length: 2980m


So thats 1.85168615216 miles.

Cheers mate
Nice. So, with the help of yankman's code I wrote a little app that parsed the lengths of every pth file and converted them into miles and kilometers, here's the output:

Track: AS1 Meters: 1870 Miles: 1.16196412904 Kilometers: 1.87
Track: AS2 Meters: 3077 Miles: 1.911959157784 Kilometers: 3.077
Track: AS3 Meters: 5602 Miles: 3.480921417584 Kilometers: 5.602
Track: AS4 Meters: 8089 Miles: 5.026271572088 Kilometers: 8.089
Track: AS5 Meters: 8802 Miles: 5.469309231984 Kilometers: 8.802
Track: AS6 Meters: 8002 Miles: 4.972212278384 Kilometers: 8.002
Track: AS7 Meters: 5168 Miles: 3.211246320256 Kilometers: 5.168
Track: AU3 Meters: 2216 Miles: 1.376958561472 Kilometers: 2.216
Track: AU4 Meters: 2216 Miles: 1.376958561472 Kilometers: 2.216
Track: BL1 Meters: 3307 Miles: 2.054874531944 Kilometers: 3.307
Track: BL2 Meters: 1839 Miles: 1.142701622088 Kilometers: 1.839
Track: FE1 Meters: 1584 Miles: 0.984251968128 Kilometers: 1.584
Track: FE2 Meters: 3086 Miles: 1.917551498512 Kilometers: 3.086
Track: FE3 Meters: 3514 Miles: 2.183498368688 Kilometers: 3.514
Track: FE4 Meters: 6559 Miles: 4.075573648328 Kilometers: 6.559
Track: FE5 Meters: 2018 Miles: 1.253927065456 Kilometers: 2.018
Track: FE6 Meters: 745 Miles: 0.46292153804 Kilometers: 0.745
Track: KY1 Meters: 2980 Miles: 1.85168615216 Kilometers: 2.98
Track: KY2 Meters: 5138 Miles: 3.192605184496 Kilometers: 5.138
Track: KY3 Meters: 7377 Miles: 4.583855283384 Kilometers: 7.377
Track: SO1 Meters: 2033 Miles: 1.263247633336 Kilometers: 2.033
Track: SO2 Meters: 2048 Miles: 1.272568201216 Kilometers: 2.048
Track: SO3 Meters: 1334 Miles: 0.828909170128 Kilometers: 1.334
Track: SO4 Meters: 4029 Miles: 2.503504532568 Kilometers: 4.029
Track: SO5 Meters: 3146 Miles: 1.954833770032 Kilometers: 3.146
Track: SO6 Meters: 2917 Miles: 1.812539767064 Kilometers: 2.917
Track: WE1 Meters: 5180 Miles: 3.21870277456 Kilometers: 5.18

Please report any weirdness, I'm crap at maths.

Big thanks to yankman!
Saved me a lot of work *wipes sweat off forehead*
I realised there was a small bug, the updated results should be more accurate now.
Schmexellent
And so schmexellent I've put it in LFS Manual, but I can't be arsed to round them for miles at the moment, I might feel like it tomorrow
I rounded them to three decimal places. If you would prefer a different rounding, let me know. Thanks for adding it to the manual.

Track: AS1 Miles: 1.162
Track: AS2 Miles: 1.912
Track: AS3 Miles: 3.481
Track: AS4 Miles: 5.026
Track: AS5 Miles: 5.469
Track: AS6 Miles: 4.972
Track: AS7 Miles: 3.211
Track: AU3 Miles: 1.377
Track: AU4 Miles: 1.377
Track: BL1 Miles: 2.055
Track: BL2 Miles: 1.143
Track: FE1 Miles: 0.984
Track: FE2 Miles: 1.918
Track: FE3 Miles: 2.183
Track: FE4 Miles: 4.076
Track: FE5 Miles: 1.254
Track: FE6 Miles: 0.463
Track: KY1 Miles: 1.852
Track: KY2 Miles: 3.193
Track: KY3 Miles: 4.584
Track: SO1 Miles: 1.263
Track: SO2 Miles: 1.273
Track: SO3 Miles: 0.829
Track: SO4 Miles: 2.504
Track: SO5 Miles: 1.955
Track: SO6 Miles: 1.813
Track: WE1 Miles: 3.219

race line on, and AI . They follow very well. simple insim app that counts miles, sorted!

edit: should have noticed the second page before posting :P
Well of course measuring the track length with the nodes of the track is not really exact.
It is always in the middle of the track and should be quite inaccurate in tight bends.
On the other hand it is good to use it as some kind of standard cause it is defined through lfs itself and not some AI/WR racingline which might be changing in time.

But if it should be more accurate the direction vector between nodes i - 1 , i - 2 and i, i +1 could be calculated in. To get some kind of bezier curve between the nodes i and i - 1.
2

FGED GREDG RDFGDR GSFDG