Replace magic number with described constant

This commit is contained in:
Jiri Drbalek 2018-05-08 16:50:19 +00:00
parent 3deb55cc5f
commit 846e961b05

View file

@ -34,7 +34,11 @@ static const double meters_per_degree = EARTH_CIRCUMFERENCE / 360;
double scale_denominator(double map_scale, bool geographic)
{
double denom = map_scale / 0.00028;
// Pixel size in meters.
// Corresponding approximate resolution is 90.71 DPI.
constexpr double pixel_size = 0.00028;
double denom = map_scale / pixel_size;
if (geographic) denom *= meters_per_degree;
return denom;
}