Replace magic number with described constant
This commit is contained in:
parent
3deb55cc5f
commit
846e961b05
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue