Calculate and display exported image dimensions from selected cm/px export resolutions
#1,320 opened on May 24, 2020
Repository metrics
- Stars
- (274 stars)
- PR merge metrics
- (PR metrics pending)
Description
Some maps are stalling and hitting on the right resolution isn't easy. See these 2 stalled maps:

Note we don't see output resolution until they're complete, and they probably crashed or stalled.
We should be able to calculate at least roughly what the output dimensions in pixels would look like for a given cm/px export, using the new cloud exporter.
Let's try to use the image collection bounds and the cm/px to estimate the output dimensions. We can even say that 10cm/px would result in HxW dimensions and 100 in HxW - in the dialog box where you enter the resolution.
Here is the calculation for x,y pixel dimensions in Ruby, from the exporter code:
The full exact calculation can be found in this file, using the Proj4.js library to calculate latitude,longitude => x,y projection:
This code is a bit tangled up but we could pull out the relevant portions into a JS function that accepts scale and a set of lat/lon bounds, and outputs x,y dimensions. This would be a great first step!