hholzgra / ocitysmap

Fork of ocitysmap repository at savannah.nongnu.org
Other
35 stars 12 forks source link

Skip index generation instead of failing when index gets too large #37

Closed hholzgra closed 2 years ago

hholzgra commented 2 years ago

Currently fails with:

Mar 16 11:22:45 print python3[3971885]: ocitysmap.indexlib.commons.IndexDoesNotFitError: Index does not fit in area
Mar 16 11:22:45 print python3[3971885]:     raise IndexDoesNotFitError("Index does not fit in area")
Mar 16 11:22:45 print python3[3971885]:   File "/home/maposmatic/ocitysmap/ocitysmap/indexlib/StreetIndex.py", line 724, in precompute_occupation_area
Mar 16 11:22:45 print python3[3971885]:     index_area = index_renderer.precompute_occupation_area(
Mar 16 11:22:45 print python3[3971885]:   File "/home/maposmatic/ocitysmap/ocitysmap/layoutlib/single_page_renderers.py", line 264, in _create_index_rendering
Mar 16 11:22:45 print python3[3971885]:     = self._create_index_rendering(index_position)
Mar 16 11:22:45 print python3[3971885]:   File "/home/maposmatic/ocitysmap/ocitysmap/layoutlib/single_page_renderers.py", line 135, in __init__
Mar 16 11:22:45 print python3[3971885]:     SinglePageRenderer.__init__(self, db, rc, tmpdir, dpi, file_prefix, 'side')
Mar 16 11:22:45 print python3[3971885]:   File "/home/maposmatic/ocitysmap/ocitysmap/layoutlib/single_page_renderer/side_index.py", line 18, in __init__
Mar 16 11:22:45 print python3[3971885]:     renderer = renderer_cls(self._db, config, tmpdir, dpi, file_prefix)
Mar 16 11:22:45 print python3[3971885]:   File "/home/maposmatic/ocitysmap/ocitysmap/__init__.py", line 613, in _render_one
Mar 16 11:22:45 print python3[3971885]:     self._render_one(config, tmpdir, renderer_cls,
Mar 16 11:22:45 print python3[3971885]:   File "/home/maposmatic/ocitysmap/ocitysmap/__init__.py", line 586, in render
Mar 16 11:22:45 print python3[3971885]:     output_count = renderer.render(config, self.job.layout,
Mar 16 11:22:45 print python3[3971885]:   File "/home/maposmatic/maposmatic/scripts/render.py", line 508, in run

See e.g.:

https://print.get-map.org/maps/210143

hholzgra commented 2 years ago

fixed by catching exception and resetting the layout to "no index" on failure

https://github.com/hholzgra/ocitysmap/commit/57dfe1b46c36505286cdcd4de3eaddec7177a7bf