getting track length from coordinates