On Dec 3, 2010, at 6:54 AM, Pablo Carreira wrote:

> Hi Dane,
> 
> > Very cool you are experimenting with typographic maps and mapnik. We should 
> > be able to get this working better.
> > One thing I noticed right off is that label_position_tolerance should help 
> > a bit, but it appears that somehow it is not being parsed via XML.
> > So, I fixed this in the 0.7.2 development branch (code for next release in 
> > 0.7.x series) and in trunk:
> > Can you rebuild mapnik from: http://svn.mapnik.org/branches/0.7.2-dev/ and 
> > try setting label_position_tolerance="100" and see if that helps with more 
> > regular spacing?
> 
> I had some trouble rebuilding it. 

Can you explain?

> So I drawn the map with a xml/python mixture in order to use the 
> label_position_tolerance.
> 

Okay.

> Indeed the label_position_tolerance has a lot of influence in the spacing and 
> with some tunnig the problem was solved for me.

Ah, great!

> Something I realized is that the  line angle is the fundamental factor. 
> Horizontal a Vertical lines results in close labels. Angular lines results is 
> spaced labels.
> 
> I've opened a tiket: #678
> 

Okay, thanks.


> Thank you again.
> 
> Here is the code and some images in annex.
> 
> import mapnik
> #import cairo
> 
> mapfile='mapa_postgis.xml'
> m = mapnik.Map(5600, 2400)
> mapnik.load_map(m, mapfile)
> bbox = mapnik.Envelope(225007,7480769,234934,7487527)
> s = mapnik.Style()
> r=mapnik.Rule()
> 
> t = mapnik.TextSymbolizer('name', 'DejaVu Sans Book', 10, 
> mapnik.Color('black'))
> t.allow_overlap=1
> #t.force_odd_labels=0
> t.label_placement=mapnik.label_placement.line
> t.minimum_distance=0
> t.label_spacing=1
> t.max_char_angle_delta=90
> #t.label_position_tolerance=100
> #t.avoid_edges=0
> 
> r.symbols.append(t)
> s.rules.append(r)
> m.append_style('My Style',s)
> lay=m.layers[1]
> lay.styles.append('My Style')
> m.zoom_to_box(bbox)
> mapnik.render_to_file(m, 'temp_teste.png','png')
> 
> 
> 
> Pablo Torres Carreira 
> 
> Pablo Torres Carreira 
> 
> 
> 
> > Subject: Re: [Mapnik-users] TextSymbolizer - Place labels close to each 
> > other.
> > From: [email protected]
> > Date: Wed, 1 Dec 2010 09:47:28 -0800
> > CC: [email protected]
> > To: [email protected]
> > 
> > Hi Pablo,
> > 
> > Welcome to mapnik!
> > 
> > Very cool you are experimenting with typographic maps and mapnik. We should 
> > be able to get this working better.
> > 
> > One thing I noticed right off is that label_position_tolerance should help 
> > a bit, but it appears that somehow it is not being parsed via XML.
> > 
> > So, I fixed this in the 0.7.2 development branch (code for next release in 
> > 0.7.x series) and in trunk:
> > 
> > http://trac.mapnik.org/changeset/2440
> > 
> > Can you rebuild mapnik from:
> > 
> > http://svn.mapnik.org/branches/0.7.2-dev/
> > 
> > and try setting label_position_tolerance="100" and see if that helps with 
> > more regular spacing?
> > 
> > You will still see gaps between labels - likely more than you are aiming 
> > for. Fixing this looks tricky, so I would encourage you to file a ticket at 
> > trac.mapnik.org so this request does not get lost.
> > 
> > Dane
> > 
> > On Nov 26, 2010, at 9:38 AM, Pablo Carreira wrote:
> > 
> > > 
> > > Hi,
> > > I'm new to mapnik. And I'm having a good time with it, making beautiful 
> > > maps.
> > > 
> > > Now I want to draw a typographic map.So, I want the labels to be very 
> > > close to each other along a line.
> > > The problem is that at some intervals there is a "hole" in the label 
> > > placement.
> > > Is the any sugestion on how to solve that problem?
> > > Here is the code and there is an image in anex.
> > > <TextSymbolizer name="nome" max_char_angle_delta="90" 
> > > allow_overlap="true" face_name="DejaVu Sans Bold" size="25" 
> > > fill="rgb(0,0,0)" placement="line" spacing="1" min_distance="0" 
> > > avoid_edges="0"></TextSymbolizer>
> > > 
> > > 
> > > Regards,
> > > 
> > > 
> > > Pablo Torres Carreira
> > > 
> > > 
> > > <mapnikexample.jpg>_______________________________________________
> > > Mapnik-users mailing list
> > > [email protected]
> > > https://lists.berlios.de/mailman/listinfo/mapnik-users
> > 
> <tolerance10000.jpg><tolerance 100.jpg><no_setting.jpg>

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to