Re: [Maposmatic-dev] ocitymap patch - grid label overlap

2013-11-18 Thread Maxime Petazzoni
* David MENTRÉ dmen...@linux-france.org [2013-11-17 12:14:50]:

 Maxime, can you deploy latest master to dev.maposmatic.org? Thanks!

Done.

/Max
-- 
Maxime Petazzoni http://www.bulix.org
 ``One by one, the penguins took away my sanity.''
Writing software in California


signature.asc
Description: Digital signature


Re: [Maposmatic-dev] ocitymap patch - grid label overlap

2013-11-18 Thread David MENTRÉ

Hello Maxime,

2013-11-18 18:29, Maxime Petazzoni:

Maxime, can you deploy latest master to dev.maposmatic.org? Thanks!

Done.


Cool, thanks!

 http://dev.maposmatic.org/results/001231_2013-11-18_18-33_RivadelGarda.png

Best regards,
david




Re: [Maposmatic-dev] ocitymap patch - grid label overlap

2013-11-17 Thread David MENTRÉ

Hello Florian,

2013-11-14 20:48, David MENTRÉ:

I haven't forgotten your patch. Unfortunately, I don't have a usable
MapOSMatic setup at hand so it is difficult for me to commit it. I'll
try it anyway.


OK, after recompiling mapnik...

Your patch is now applied:

http://git.savannah.gnu.org/cgit/maposmatic/ocitysmap.git/commit/?id=9ad808f224d939d6448aa2835a72f1450a155c35

git am chocked on your patch so I had to play with git apply and 
manually to the commit. Next time use git format-patch and git 
send-email.


Maxime, can you deploy latest master to dev.maposmatic.org? Thanks!

Best regards,
david




Re: [Maposmatic-dev] ocitymap patch - grid label overlap

2013-10-02 Thread Florian Lohoff

Hi David,

On Fri, Sep 27, 2013 at 07:55:19AM +0200, David MENTRE wrote:
 Hello Florian,
 
 2013/9/23 Florian Lohoff f...@zz.de:
  what do you think of this modification? IMHO its ugly that grid
  labels overlap in the grid corners.
 
 I agree on the approach. I wanted to check the current layout but
 maposmatic.org is currently down (big issue at the hosting company).
 
 On your patch, maybe you could add some short comments telling what
 are doing your if statements.
 
 Have you checked that your patch works correctly with the different
 kind of layouts?

I havent - But in the end whenever we put the labels in the corner
we want to avoid putting 2 of them in the same corner.

The example in the commit message shows which of them gets eliminated.

 Sorry for the late feedback, but better later than never. ;-)

Same patch - whitespace corrected (i used tabs) and with
a short comment.



commit dcc1351a26b0a385fa3c5ba8fb30c5d8ccef9317
Author: Florian Lohoff f...@vitroconnect.de
Date:   Wed Oct 2 08:08:42 2013 +

Clear the corners of duplicate labels

The grid corners typically get a vertical and a horizontal
label. These do overlap from a certain scale on.

Avoid by printing only one label:

  A B C 1
  2 2
  3 3
  4 B C D

diff --git a/ocitysmap/layoutlib/abstract_renderer.py 
b/ocitysmap/layoutlib/abstract_renderer.py
index 86a7483..6458566 100644
--- a/ocitysmap/layoutlib/abstract_renderer.py
+++ b/ocitysmap/layoutlib/abstract_renderer.py
@@ -196,11 +196,16 @@ class Renderer:
 else:
 continue
 
-draw_utils.draw_simpletext_center(ctx, label,
- x, grid_legend_margin_dots/2.0)
-draw_utils.draw_simpletext_center(ctx, label,
- x, map_area_height_dots -
- grid_legend_margin_dots/2.0)
+# At the top clear the right corner of the horizontal label
+if (i  map_grid.horiz_count-1):
+draw_utils.draw_simpletext_center(ctx, label,
+ x, grid_legend_margin_dots/2.0)
+
+# At the bottom clear the left corner of the horizontal label
+if (i  0):
+draw_utils.draw_simpletext_center(ctx, label,
+ x, map_area_height_dots -
+ grid_legend_margin_dots/2.0)
 
 for i, label in enumerate(map_grid.vertical_labels):
 y = i * step_vert
@@ -212,9 +217,14 @@ class Renderer:
 else:
 continue
 
-draw_utils.draw_simpletext_center(ctx, label,
+# On the left clear the upper corner of the vertical label
+if (i  0):
+draw_utils.draw_simpletext_center(ctx, label,
  grid_legend_margin_dots/2.0, y)
-draw_utils.draw_simpletext_center(ctx, label,
+
+# On the right clear the bottom corner of the vertical label
+if (i  map_grid.vert_count -1):
+draw_utils.draw_simpletext_center(ctx, label,
  map_area_width_dots -
  grid_legend_margin_dots/2.0, y)
 
-- 
Florian Lohoff f...@zz.de


signature.asc
Description: Digital signature


Re: [Maposmatic-dev] ocitymap patch - grid label overlap

2013-09-26 Thread David MENTRE
Hello Florian,

2013/9/23 Florian Lohoff f...@zz.de:
 what do you think of this modification? IMHO its ugly that grid
 labels overlap in the grid corners.

I agree on the approach. I wanted to check the current layout but
maposmatic.org is currently down (big issue at the hosting company).

On your patch, maybe you could add some short comments telling what
are doing your if statements.

Have you checked that your patch works correctly with the different
kind of layouts?

Sorry for the late feedback, but better later than never. ;-)

Best regards,
david