I would like to divide the globe into 1000 $\times$ 1000 meter geodesic squares, and then map any long / lat to the applicable square.
The altitude of each block would be the altitude of the earth at the block's center.
Could someone point me in the right direction please as to how to calculate the flat grid and map long/lat to it.
EDIT
Since squares don't map onto a sphere, a solution I thought of is to calculate the circumference for a given latitude (taking into account the 1000 m grid), and divide it into 1000 m blocks (rounded up). So the number of blocks that map around the earth will decrease as we move away from the equator.
The squares will be slightly narrower at the top as we go North, and at the bottom as we go South.