Closed Martin-Rey closed 6 years ago
Looks good overall... I wonder whether 'centroid' was more descriptive than 'point' though?
(i.e. I am suggesting maybe the three words should be 'index', 'coordinate' and 'centroid' rather than 'index', 'coordinate' and 'point')
Centroid is very clear when starting from a cell, but there are many points that return the same cell, not just the centroid.
The clearer, though it makes names longer, would probably be index, PixelCoordinate, BoxCoordinate.
I wonder whether the existing distinction between "centroid" (guaranteed to be the centroid) and "point" (any point in the cell) should be reinstated in that case. So you get an index from a point, but you get a centroid from an index. I realise there is then a lack of symmetry... but after all these are not really symmetric operations, so it seems accurate.
I don't find "pixel" descriptive, incidentally.
Sounds good to me.
A bit of refactoring for clarity following the logic that grid cells can be accessed through an index, a coordinate (pixel coordinate) or a point (box coordinate).
Let me know if you think the names are unclear or if you have better propositions.