@Override
    public void handleWayTags(int edgeId, EdgeIntAccess edgeIntAccess, ReaderWay way, IntsRef relationFlags) {
        PointList pointList = way.getTag("point_list", null);
        Double edgeDistance = way.getTag("edge_distance", null);
        if (pointList != null && edgeDistance != null && !pointList.isEmpty()) {
            double beeline = DistanceCalcEarth.DIST_EARTH.calcDist(pointList.getLat(0), pointList.getLon(0),
                    pointList.getLat(pointList.size() - 1), pointList.getLon(pointList.size() - 1));
            // For now keep the formula simple. Maybe later use quadratic value as it might improve the "resolution"
            double curvature = beeline / edgeDistance;
            curvatureEnc.setDecimal(false, edgeId, edgeIntAccess, Math.max(curvatureEnc.getMinStorableDecimal(), Math.min(curvatureEnc.getMaxStorableDecimal(),
                    curvature)));
        } else {
            curvatureEnc.setDecimal(false, edgeId, edgeIntAccess, 1.0);
        }
    }
@Test
    public void testCurvature() {
        CurvatureCalculator calculator = new CurvatureCalculator(em.getDecimalEncodedValue(Curvature.KEY));
        ArrayEdgeIntAccess intAccess = ArrayEdgeIntAccess.createFromBytes(em.getBytesForFlags());
        int edgeId = 0;
        calculator.handleWayTags(edgeId, intAccess, getStraightWay(), null);
        double valueStraight = em.getDecimalEncodedValue(Curvature.KEY).getDecimal(false, edgeId, intAccess);

        intAccess = ArrayEdgeIntAccess.createFromBytes(em.getBytesForFlags());
        calculator.handleWayTags(edgeId, intAccess, getCurvyWay(), null);
        double valueCurvy = em.getDecimalEncodedValue(Curvature.KEY).getDecimal(false, edgeId, intAccess);

        assertTrue(valueCurvy < valueStraight, "The bendiness of the straight road is smaller than the one of the curvy road");
    }