kopia lustrzana https://github.com/hholzgra/ocitysmap
renderers: add a get_compatible_output_formats() method
The single page renderers can output PNG, SVGZ, PDF and CSV, but by design, the multi page renderer can only output PDF and CSV. So we introduce a get_compatible_output_formats() in the renderer class so that users of OcitySMap2 can find out which formats are possible depending on the choosen layout. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>stable
rodzic
58beafb881
commit
1869b9c5fd
|
|
@ -295,6 +295,10 @@ class Renderer:
|
|||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
@staticmethod
|
||||
def get_compatible_output_formats():
|
||||
return [ "png", "svgz", "pdf", "csv" ]
|
||||
|
||||
@staticmethod
|
||||
def get_compatible_paper_sizes(bounding_box, zoom_level,
|
||||
resolution_km_in_mm):
|
||||
|
|
|
|||
|
|
@ -664,6 +664,11 @@ class MultiPageRenderer(Renderer):
|
|||
def _paper_pt_to_geo_m(self, paper_pt):
|
||||
return self._paper_mm_to_geo_m(commons.convert_pt_to_mm(paper_pt))
|
||||
|
||||
# In multi-page mode, we only render pdf and csv formats
|
||||
@staticmethod
|
||||
def get_compatible_output_formats():
|
||||
return [ "pdf", "csv" ]
|
||||
|
||||
# In multi-page mode, we only accept A4, A5 and US letter as paper
|
||||
# sizes. The goal is to render booklets, not posters.
|
||||
@staticmethod
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue