presto-geospatial/src/main/java/io/prestosql/plugin/geospatial/GeoFunctions.java/GeoFunctions/interpolatePoints
class GeoFunctions:    private static List<Point> interpolatePoints(OGCGeometry geometry, double fractionStep, boolean repeated)
    {
        validateType("line_interpolate_point", geometry, EnumSet.of(LINE_STRING));
        if (fractionStep < 0 || fractionStep > 1) {
            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "fraction must be between 0 and 1");
        }

        MultiPath path = (MultiPath) geometry.getEsriGeometry();

        if (fractionStep == 0) {
            return Collections.singletonList(path.getPoint(0));
        }
        else if (fractionStep == 1) {
            return Collections.singletonList((path.getPoint(path.getPointCount() - 1)));
        }

        int pointCount = repeated ? (int) Math.floor(1 / fractionStep) : 1;
        List<Point> interpolatedPoints = new ArrayList<>(pointCount);

        double lineStringLength = path.calculateLength2D();
        Point previous = path.getPoint(0);
        double fractionConsumed = 0.0;
        double fractionIncrement = fractionStep;

        for (int i = 1; i < path.getPointCount() && interpolatedPoints.size() < pointCount; i++) {
            Point current = path.getPoint(i);
            double segmentLengthFraction = GeometryEngine.distance(previous, current, null) / lineStringLength;

            while (fractionStep < fractionConsumed + segmentLengthFraction && interpolatedPoints.size() < pointCount) {
                double segmentFraction = (fractionStep - fractionConsumed) / segmentLengthFraction;
                Point point = new Point();
                point.setX(previous.getX() + (current.getX() - previous.getX()) * segmentFraction);
                point.setY(previous.getY() + (current.getY() - previous.getY()) * segmentFraction);
                interpolatedPoints.add(point);
                fractionStep += fractionIncrement;
            }

            fractionConsumed += segmentLengthFraction;
            previous = current;
        }

        if (interpolatedPoints.size() < pointCount) {
            interpolatedPoints.add(path.getPoint(path.getPointCount() - 1));
        }

        return interpolatedPoints;
    }