How to stop labels repeating so close to each other?

alastair's Avatar

alastair

06 Dec, 2011 04:19 PM

Hi guys,

First off, thanks for an amazing product. I'm having a great time experimenting with it. However, I've stumbled across a problem with my street labels- they repeat a little too much. I read the Q&A about merging the lines into one:

http://support.mapbox.com/discussions/tilemill/66-redundant-line-se...

which I've done, but I'm still seeing lots of repeats- take a look at the attached picture. I've doubled checked in the DB that there is, for example, only one 'Irving Place', but the names are still repeating close to each other. I've even tried setting:

text-min-distance: 5000;
text-spacing:5000;

which ought to mean they're incredibly far apart, right? I'm not sure what else I can do. Any help would be appreciated.

Thanks!

  1. Support Staff 2 Posted by AJ on 06 Dec, 2011 04:32 PM

    AJ's Avatar

    Hi Alastair,

    I suspect my PostGIS query suggestion in the discussion you linked to might not actually be enough to solve this problem. In addition to doing a union on your segmented roads try doing a linemerge.

    For already-unioned lines the query would be something like SELECT ST_LineMerge(the_geom) FROM your_roads_table;. To do this on a fresh table that has not been unioned yet do something like this:

    SELECT 
      street_name,
      ST_LineMerge(ST_Union(the_geom)) as the_geom
    FROM your_roads_table
    GROUP BY street_name;
    

    These queries are expensive so you'll probably want to do them as an update or an insert so you only need to do them once.

    Let me know if this improves things for you.

  2. 3 Posted by alastair on 06 Dec, 2011 04:45 PM

    alastair's Avatar

    Hm, I ran a:

    UPDATE my_test_table set the_geom = ST_LineMerge(the_geom)
    

    but it doesn't appear to have made a difference (and it ran surprisingly quickly). Does TileMill keep any kind of local cache of query results perhaps?

    Thanks for the help!

  3. Support Staff 4 Posted by Dane on 16 Dec, 2011 07:14 PM

    Dane's Avatar

    Hi Alastair,

    This may be a mapnik bug, or at least a lacking feature that this is not working for you. I'll put it in my queue to look at https://github.com/mapnik/mapnik/issues/995. Going to close this issue and track at mapnik issue tracker.

  4. Dane closed this discussion on 16 Dec, 2011 07:14 PM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

21 May, 2013 03:30 AM
21 May, 2013 01:44 AM
20 May, 2013 10:10 PM
20 May, 2013 01:46 PM
20 May, 2013 09:21 PM

 

20 May, 2013 04:20 AM