kopia lustrzana https://github.com/hholzgra/ocitysmap
Updated for compat with maposmatic
rodzic
d931e3571a
commit
f595f4520d
|
|
@ -90,7 +90,7 @@ import i18n
|
|||
from indexlib.indexer import StreetIndex
|
||||
from indexlib.commons import IndexDoesNotFitError
|
||||
|
||||
from layoutlib import renderers
|
||||
from layoutlib import PAPER_SIZES, renderers
|
||||
import layoutlib.commons
|
||||
|
||||
LOG = logging.getLogger('ocitysmap')
|
||||
|
|
@ -344,7 +344,7 @@ SELECT ST_AsText(ST_LongestLine(
|
|||
return renderers.get_renderers()
|
||||
|
||||
def get_all_paper_sizes(self):
|
||||
return renderers.get_paper_sizes()
|
||||
return PAPER_SIZES
|
||||
|
||||
def render(self, config, renderer_name, output_formats, file_prefix):
|
||||
"""Renders a job with the given rendering configuration, using the
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import math
|
||||
import datetime
|
||||
import cairo
|
||||
import mapnik
|
||||
|
|
@ -441,6 +442,10 @@ class SinglePageRenderer(Renderer):
|
|||
paper_height_mm /= (1. -
|
||||
SinglePageRenderer.MAX_INDEX_OCCUPATION_RATIO)
|
||||
|
||||
# Transform the values into integers
|
||||
paper_width_mm = int(math.ceil(paper_width_mm))
|
||||
paper_height_mm = int(math.ceil(paper_height_mm))
|
||||
|
||||
# Test both portrait and landscape orientations when checking for paper
|
||||
# sizes.
|
||||
valid_sizes = []
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue