@@ -308,8 +308,8 @@ collect_lengths(const Matrix<std::unique_ptr<Cell>>& cells)
308308 return lengths;
309309}
310310
311- void
312- traverse_cells (Matrix<std::unique_ptr<Cell>>& cells, std::vector<CoordinateXY>& coords, const Grid<infinite_extent>& ring_grid, bool areal)
311+ static void
312+ traverse_cells (Matrix<std::unique_ptr<Cell>>& cells, std::vector<CoordinateXY>& coords, const Grid<infinite_extent>& ring_grid, bool areal, const void * parentage )
313313{
314314 size_t pos = 0 ;
315315 size_t row = ring_grid.getRow (coords.front ().y );
@@ -323,7 +323,7 @@ traverse_cells(Matrix<std::unique_ptr<Cell>>& cells, std::vector<CoordinateXY>&
323323 const CoordinateXY* next_coord = last_exit ? last_exit : &coords[pos];
324324 const CoordinateXY* prev_coord = pos > 0 ? &coords[pos - 1 ] : nullptr ;
325325
326- cell.take (*next_coord, prev_coord);
326+ cell.take (*next_coord, prev_coord, parentage );
327327
328328 if (cell.getLastTraversal ().isExited ()) {
329329 // Only push our exit coordinate if it's not same as the
@@ -437,7 +437,7 @@ GridIntersection::processLine(const LineString& ls, bool exterior_ring)
437437 }
438438
439439 Matrix<std::unique_ptr<Cell>> cells (ring_grid.getNumRows (), ring_grid.getNumCols ());
440- traverse_cells (cells, coordsVec, ring_grid, m_areal);
440+ traverse_cells (cells, coordsVec, ring_grid, m_areal, &ls );
441441
442442 // Compute the fraction covered for all cells and assign it to
443443 // the area matrix
@@ -473,8 +473,8 @@ traverse_ring(Matrix<std::unique_ptr<Cell>>& cells, const Grid<infinite_extent>&
473473
474474 if (want_ccw != algorithm::Orientation::isCCW (&seq)) {
475475 std::reverse (coords.begin (), coords.end ());
476- }
477- traverse_cells (cells, coords, grid, true );
476+ }
477+ traverse_cells (cells, coords, grid, true , &g );
478478}
479479
480480void
0 commit comments