Exemplo n.º 1
0
    def __init__(self, db, rc, tmpdir, dpi, file_prefix):
        """
        Create the renderer.

        Args:
           rc (RenderingConfiguration): rendering parameters.
           tmpdir (os.path): Path to a temp dir that can hold temp files.
        """
        SinglePageRenderer.__init__(self, db, rc, tmpdir, dpi, file_prefix, 'bottom')
Exemplo n.º 2
0
    def get_compatible_paper_sizes(bounding_box, render_context,
                                   scale=Renderer.DEFAULT_SCALE):
        """Returns a list of the compatible paper sizes for the given bounding
        box. The list is sorted, smaller papers first, and a "custom" paper
        matching the dimensions of the bounding box is added at the end.

        Args:
            bounding_box (coords.BoundingBox): the map geographic bounding box.
            paper_sizes (list): the complete list of configured paper sizes
            scale (int): minimum mapnik scale of the map.

        Returns a list of tuples (paper name, width in mm, height in
        mm, portrait_ok, landscape_ok). Paper sizes are represented in
        portrait mode.
        """
        return SinglePageRenderer._generic_get_compatible_paper_sizes(
            bounding_box, render_context.get_all_paper_sizes(), scale, 'bottom')
Exemplo n.º 3
0
 def get_minimal_paper_size(bounding_box, scale=Renderer.DEFAULT_SCALE):
     return SinglePageRenderer._generic_get_minimal_paper_size(
         bounding_box, scale, 'side')