private void loadCachedDistances() {
        try (InputStream fileStream = new FileInputStream(new File(LocalStorage.getFirstExternalPrivateCgeoDirectory(), CACHED_DISTANCES_FILENAME))) {
            cachedDistances = new ObjectMapper().readValue(fileStream, CachedDistances.class);
            if (cachedDistances.version != CACHED_DISTANCES_FILEVERSION || cachedDistances.routingMode != Settings.getRoutingMode()) {
                Log.i("discarding tsp cache due to different routing mode or wrong file version");
                resetCachedDistances();
            }
        } catch (final IOException e) {
            Log.w("Error reading tsp cache file: " + e.getMessage());
        }
    }
returns length in meters for the given route
main/src/main/java/cgeo/geocaching/maps/routing/RouteOptimizationHelper.java