At the moment the intersection point is registered twice:
Once as the longitudinal crossing point
Once as the latitudinal crossing point
// In function findIntersections (grid.hpp)
// If pE.length() == pN.length() the else case is executed twice for point pE and pN
while (pE.length() <= length || pN.length() <= length) {
if (pE.length() < pN.length()) {
crossings.push_back(line.start + pE);
dE += double(east - 1) * cellsize_x;
pE = geometry::Vec2<double>(dE, dE * rise / run);
} else {
crossings.push_back(line.start + pN);
dN += double(north - 1) * cellsize_y;
pN = geometry::Vec2<double>(dN * run / rise, dN);
}
At the moment the intersection point is registered twice: