Mon 23 Apr 2012 01:19:33 PM UTC, comment #4:
Hello Jeroen,
I agree that ocitysmap should be protected against such error.
But having a strong MapOSMatic web service is the first priority. So I'll try to fix the maposmatic front-end first. Feel free to submit a patch. ;-)
Regarding, the check of Lat1 - Lat2 == 0 or Lon1 - Lon2 == 0, I personally much prefer systems that are not too smart and just report the error. IMHO, it is better for the human user to let him/her know there is an issue rather than trying to silently fix it.
Regarding the minimum height/width in km of the mapped area, I don't see the usefulness of such restriction. Apart from exactly equal Lat1,Lat2, ocitysmap map is able to render any area, whatever small it is (and I used it from time to time to render just a few streets).
Best regards,
d.
|
Sat 21 Apr 2012 05:21:30 PM UTC, comment #3:
Apart from figuring out why MapOSMatic passed those parameters for this job and preventing that, I think this kind of error should probably also be checked for in OcitySMap.
Some people might prefer to use the latter with a different front-end or straight up from the command-line, in which case a fix in the former doesn't do anything.
As far as the OcitySMap part goes, rather than checking if Lat1 - Lat2 == 0 or Lon1 - Lon2 == 0, how about that bit of code that adjusts the bounding box to accommodate the paper size check for this error? Maybe it can also enforce a minimum height/width in km of the mapped area?
|
Sat 21 Apr 2012 10:25:37 AM UTC, original submission:
A division by zero occurred with following job:
"""
An error occured while rendering job #44517!
Traceback (most recent call last):
File "/home/maposmatic/maposmatic-prod/maposmatic/scripts/render.py", line 334, in run
output_formats, prefix)
File "/home/maposmatic/maposmatic-prod/ocitysmap/ocitysmap2/__init__.py", line 465, in render
file_prefix)
File "/home/maposmatic/maposmatic-prod/ocitysmap/ocitysmap2/__init__.py", line 520, in _render_one
renderer = renderer_cls(self._db, config, tmpdir, dpi, file_prefix)
File "/home/maposmatic/maposmatic-prod/ocitysmap/ocitysmap2/layoutlib/single_page_renderers.py", line 617, in _init_
SinglePageRenderer.__init__(self, db, rc, tmpdir, dpi, file_prefix, 'bottom')
File "/home/maposmatic/maposmatic-prod/ocitysmap/ocitysmap2/layoutlib/single_page_renderers.py", line 146, in _init_
dpi )
File "/home/maposmatic/maposmatic-prod/ocitysmap/ocitysmap2/layoutlib/abstract_renderer.py", line 202, in _create_map_canvas
width, height, dpi)
File "/home/maposmatic/maposmatic-prod/ocitysmap/ocitysmap2/maplib/map_canvas.py", line 84, in _init_
graphical_ratio)
File "/home/maposmatic/maposmatic-prod/ocitysmap/ocitysmap2/maplib/map_canvas.py", line 112, in _fix_bbox_ratio
cur_ratio = float(width)/height
ZeroDivisionError: float division
Job information:
administrative_city:
administrative_osmid: None
endofrendering_time: None
id: 44517
index_queue_at_submission: 2
lat_bottom_right: 49.16597
lat_upper_left: 49.16597
layout: single_page_index_bottom
lon_bottom_right: 6.11746
lon_upper_left: 6.08437
map_language: fr_FR.UTF-8
maptitle: Saulny, Moselle, Lorraine, 57140, France
nonce: XXXXXXXXXXXX
paper_height_mm: 297
paper_width_mm: 420
resultmsg: None
startofrendering_time: 2012-04-21 10:40:36.698110
status: 1
stylesheet: Default
submission_time: 2012-04-21 10:36:37.385867
submitterip: XXXXXXXXXXXX
You can view the job page at <http://www.maposmatic.org/jobs/44517>.
"""
|