maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [PATCH] Remove dead code about zoom_level


From: gael . utard
Subject: [Maposmatic-dev] [PATCH] Remove dead code about zoom_level
Date: Sun, 1 Apr 2012 01:12:17 +0200

From: Gael UTARD <address@hidden>

Signed-off-by: Gael UTARD <address@hidden>
---
 ocitysmap2-render                             |    3 +--
 ocitysmap2/__init__.py                        |    2 --
 ocitysmap2/layoutlib/abstract_renderer.py     |    4 +---
 ocitysmap2/layoutlib/multi_page_renderer.py   |    2 +-
 ocitysmap2/layoutlib/single_page_renderers.py |   19 +++++++------------
 ocitysmap2/maplib/map_canvas.py               |    1 -
 6 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/ocitysmap2-render b/ocitysmap2-render
index 8f34d6a..f7006b5 100755
--- a/ocitysmap2-render
+++ b/ocitysmap2-render
@@ -178,8 +178,7 @@ def main():
                      % ', '.join(KNOWN_PAPER_SIZE_NAMES))
 
     # Determine actual paper size
-    compat_papers = cls_renderer.get_compatible_paper_sizes(bbox,
-         stylesheet.zoom_level)
+    compat_papers = cls_renderer.get_compatible_paper_sizes(bbox)
     if not compat_papers:
         parser.error("No paper size compatible with this rendering.")
 
diff --git a/ocitysmap2/__init__.py b/ocitysmap2/__init__.py
index 8ab8460..2b0d084 100644
--- a/ocitysmap2/__init__.py
+++ b/ocitysmap2/__init__.py
@@ -137,7 +137,6 @@ class Stylesheet:
         self.name        = None # str
         self.path        = None # str
         self.description = '' # str
-        self.zoom_level  = Stylesheet.DEFAULT_ZOOM_LEVEL
 
         self.grid_line_color = 'black'
         self.grid_line_alpha = 0.5
@@ -169,7 +168,6 @@ class Stylesheet:
         s.name = parser.get(section_name, 'name')
         s.path = parser.get(section_name, 'path')
         assign_if_present('description')
-        assign_if_present('zoom_level', int)
 
         assign_if_present('grid_line_color')
         assign_if_present('grid_line_alpha', float)
diff --git a/ocitysmap2/layoutlib/abstract_renderer.py 
b/ocitysmap2/layoutlib/abstract_renderer.py
index 3811b5a..05b45d1 100644
--- a/ocitysmap2/layoutlib/abstract_renderer.py
+++ b/ocitysmap2/layoutlib/abstract_renderer.py
@@ -300,15 +300,13 @@ class Renderer:
         return [ "png", "svgz", "pdf", "csv" ]
 
     @staticmethod
-    def get_compatible_paper_sizes(bounding_box, zoom_level,
-                                   resolution_km_in_mm):
+    def get_compatible_paper_sizes(bounding_box, resolution_km_in_mm):
         """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.
-            zoom_level (int): the Mapnik zoom level to use, generally 16.
             resolution_km_in_mm (int): size of a geographic kilometer in
                 milimeters on the rendered map.
 
diff --git a/ocitysmap2/layoutlib/multi_page_renderer.py 
b/ocitysmap2/layoutlib/multi_page_renderer.py
index 12cdadc..67842c1 100644
--- a/ocitysmap2/layoutlib/multi_page_renderer.py
+++ b/ocitysmap2/layoutlib/multi_page_renderer.py
@@ -765,7 +765,7 @@ class MultiPageRenderer(Renderer):
     # sizes. The goal is to render booklets, not posters.
     # The default paper size is A4 portrait
     @staticmethod
-    def get_compatible_paper_sizes(bounding_box, zoom_level,
+    def get_compatible_paper_sizes(bounding_box,
                                    
resolution_km_in_mm=Renderer.DEFAULT_KM_IN_MM,
                                    index_position=None, hsplit=1, vsplit=1):
         valid_sizes = []
diff --git a/ocitysmap2/layoutlib/single_page_renderers.py 
b/ocitysmap2/layoutlib/single_page_renderers.py
index e329ddf..b0c19b5 100644
--- a/ocitysmap2/layoutlib/single_page_renderers.py
+++ b/ocitysmap2/layoutlib/single_page_renderers.py
@@ -452,7 +452,7 @@ class SinglePageRenderer(Renderer):
         cairo_surface.flush()
 
     @staticmethod
-    def _generic_get_compatible_paper_sizes(bounding_box, zoom_level,
+    def _generic_get_compatible_paper_sizes(bounding_box,
                                             
resolution_km_in_mm=Renderer.DEFAULT_KM_IN_MM, index_position = None):
         """Returns a list of the compatible paper sizes for the given bounding
         box. The list is sorted, smaller papers first, and a "custom" paper
@@ -460,7 +460,6 @@ class SinglePageRenderer(Renderer):
 
         Args:
             bounding_box (coords.BoundingBox): the map geographic bounding box.
-            zoom_level (int): the Mapnik zoom level to use, generally 16.
             resolution_km_in_mm (int): size of a geographic kilometer in
                 milimeters on the rendered map.
            index_position (str): None or 'side' (index on side),
@@ -532,7 +531,7 @@ class SinglePageRendererNoIndex(SinglePageRenderer):
 
 
     @staticmethod
-    def get_compatible_paper_sizes(bounding_box, zoom_level,
+    def get_compatible_paper_sizes(bounding_box,
                                    
resolution_km_in_mm=Renderer.DEFAULT_KM_IN_MM):
         """Returns a list of the compatible paper sizes for the given bounding
         box. The list is sorted, smaller papers first, and a "custom" paper
@@ -540,7 +539,6 @@ class SinglePageRendererNoIndex(SinglePageRenderer):
 
         Args:
             bounding_box (coords.BoundingBox): the map geographic bounding box.
-            zoom_level (int): the Mapnik zoom level to use, generally 16.
             resolution_km_in_mm (int): size of a geographic kilometer in
                 milimeters on the rendered map.
 
@@ -549,7 +547,7 @@ class SinglePageRendererNoIndex(SinglePageRenderer):
         portrait mode.
         """
         return SinglePageRenderer._generic_get_compatible_paper_sizes(
-            bounding_box, zoom_level, resolution_km_in_mm, None)
+            bounding_box, resolution_km_in_mm, None)
 
 
 class SinglePageRendererIndexOnSide(SinglePageRenderer):
@@ -568,7 +566,7 @@ class SinglePageRendererIndexOnSide(SinglePageRenderer):
         SinglePageRenderer.__init__(self, db, rc, tmpdir, dpi, street_index, 
'side')
 
     @staticmethod
-    def get_compatible_paper_sizes(bounding_box, zoom_level,
+    def get_compatible_paper_sizes(bounding_box,
                                    
resolution_km_in_mm=Renderer.DEFAULT_KM_IN_MM):
         """Returns a list of the compatible paper sizes for the given bounding
         box. The list is sorted, smaller papers first, and a "custom" paper
@@ -576,7 +574,6 @@ class SinglePageRendererIndexOnSide(SinglePageRenderer):
 
         Args:
             bounding_box (coords.BoundingBox): the map geographic bounding box.
-            zoom_level (int): the Mapnik zoom level to use, generally 16.
             resolution_km_in_mm (int): size of a geographic kilometer in
                 milimeters on the rendered map.
 
@@ -585,7 +582,7 @@ class SinglePageRendererIndexOnSide(SinglePageRenderer):
         portrait mode.
         """
         return SinglePageRenderer._generic_get_compatible_paper_sizes(
-            bounding_box, zoom_level, resolution_km_in_mm, 'side')
+            bounding_box, resolution_km_in_mm, 'side')
 
 
 class SinglePageRendererIndexBottom(SinglePageRenderer):
@@ -604,7 +601,7 @@ class SinglePageRendererIndexBottom(SinglePageRenderer):
         SinglePageRenderer.__init__(self, db, rc, tmpdir, dpi, file_prefix, 
'bottom')
 
     @staticmethod
-    def get_compatible_paper_sizes(bounding_box, zoom_level,
+    def get_compatible_paper_sizes(bounding_box,
                                    
resolution_km_in_mm=Renderer.DEFAULT_KM_IN_MM):
         """Returns a list of the compatible paper sizes for the given bounding
         box. The list is sorted, smaller papers first, and a "custom" paper
@@ -612,7 +609,6 @@ class SinglePageRendererIndexBottom(SinglePageRenderer):
 
         Args:
             bounding_box (coords.BoundingBox): the map geographic bounding box.
-            zoom_level (int): the Mapnik zoom level to use, generally 16.
             resolution_km_in_mm (int): size of a geographic kilometer in
                 milimeters on the rendered map.
 
@@ -621,7 +617,7 @@ class SinglePageRendererIndexBottom(SinglePageRenderer):
         portrait mode.
         """
         return SinglePageRenderer._generic_get_compatible_paper_sizes(
-            bounding_box, zoom_level, resolution_km_in_mm, 'bottom')
+            bounding_box, resolution_km_in_mm, 'bottom')
 
 
 if __name__ == '__main__':
@@ -655,7 +651,6 @@ if __name__ == '__main__':
             self.grid_line_color = 'black'
             self.grid_line_alpha = 0.9
             self.grid_line_width = 2
-            self.zoom_level = 16
             self.shade_color = 'black'
             self.shade_alpha = 0.7
 
diff --git a/ocitysmap2/maplib/map_canvas.py b/ocitysmap2/maplib/map_canvas.py
index 87fac62..444a5ff 100644
--- a/ocitysmap2/maplib/map_canvas.py
+++ b/ocitysmap2/maplib/map_canvas.py
@@ -200,7 +200,6 @@ if __name__ == '__main__':
     class StylesheetMock:
         def __init__(self):
             self.path = '/home/sam/src/python/maposmatic/mapnik-osm/osm.xml'
-            self.zoom_level = 16
 
     bbox = coords.BoundingBox(48.7148, 2.0155, 48.6950, 2.0670)
     canvas = MapCanvas(StylesheetMock(), bbox, 297.0/210)
-- 
1.7.5.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]