Cartography/imaging: understanding projection between heterogeneous 2D coordinate systems
Assumptions; the question is very agnostic to any languages or tooling, although I am approaching with
The world coordinate system is very large, 1.5M whole numbers, represented as
Thus far the naive attempt is to apply a simple world per bitmap ratio, or pixels per world, depending upon the point or rectangle bounds conversion. But there is always an error. Example image: the circle and points are accurate relative to themselves; but are inaccurate to the target bitmap in question, the scaling being something like 183 units per px error involved applying any ratios to the source coordinates. This error can vary depending on the source bitmap resolution, of course. So the algorithm should be robust keeping that in mind.
Overall, my goal is to gain the understanding, calculations involved, to do the projection more precisely regarding world to canvas, without the sort of translation issues. And adapt that into the implementation details.
CSharp and SkiaSharp specifically, but is neither here nor there concerning the core question. Which is: projecting between a world coordinate system and canvas resolution coordinates.The world coordinate system is very large, 1.5M whole numbers, represented as
decimal for centimeters and fractional cm precision; neither here nor there except to understand the A coordinate system. The B coordinate space of course is the target bitmap, in whatever resolution, may be 8K, 16K even 32K, bandwidth and memory permitting, square.Thus far the naive attempt is to apply a simple world per bitmap ratio, or pixels per world, depending upon the point or rectangle bounds conversion. But there is always an error. Example image: the circle and points are accurate relative to themselves; but are inaccurate to the target bitmap in question, the scaling being something like 183 units per px error involved applying any ratios to the source coordinates. This error can vary depending on the source bitmap resolution, of course. So the algorithm should be robust keeping that in mind.
Overall, my goal is to gain the understanding, calculations involved, to do the projection more precisely regarding world to canvas, without the sort of translation issues. And adapt that into the implementation details.
