/usr/lib/python2.7/dist-packages/mapnik/printing/conversions.py is in python-mapnik 1:0.0~20180130-804a7947d-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | """Unit conversion helpers."""
def m2pt(x, pt_size=0.0254/72.0):
"""Converts distance from meters to points. Default value is PDF point size."""
return x / pt_size
def pt2m(x, pt_size=0.0254/72.0):
"""Converts distance from points to meters. Default value is PDF point size."""
return x * pt_size
def m2in(x):
"""Converts distance from meters to inches."""
return x / 0.0254
def m2px(x, resolution):
"""Converts distance from meters to pixels at the given resolution in DPI/PPI."""
return m2in(x) * resolution
|