I worked this out once but I forgot how I did it. Somehow the grid size created a whole number of cells.
I have a map with the following extents:
xmin = -20037508.3427892439067364
xmax = 20037508.3427892439067364
ymin = -20037508.3427892439067364
ymax = 20037508.3427892439067364
I want to generate a grid where each cell is 500 by 500 pixels (at 1:250,000 scale). How do I convert the extent values from metres to pixels (at 1:250,000 scale)?