stamen / terrain-classic

World-wide CartoCSS port of Stamen's classic terrain style
ISC License
144 stars 35 forks source link

dymo labels need help #4

Closed almccon closed 8 years ago

almccon commented 9 years ago

Because the labels files we are using were generated for Helvetica, not the narrower font we want to use for Terrain, the alignment of city labels looks bad.

By default, the labels are centered within the label polygon, and are usually way too far from the city dots.

screen shot 2015-06-19 at 6 27 50 pm

If I try to text-align using the justified field in the data, like so...

  [justified='left'] {
    text-horizontal-alignment: left;
    text-dx: 15;
  }

  [justified='right'] {
    text-horizontal-alignment: right;
    text-dx: -15;
  }

...I can never get things to line up correctly. screen shot 2015-06-19 at 6 37 09 pm

(these examples include the following debugging code, to see the text polygon in the background)

  ::outline {
    polygon-fill: #fff;
    polygon-opacity: 0.3;
  }
almccon commented 9 years ago

Specifically: The original Terrain style used Dymo to carefully position all the city labels at low zooms, taking font size into account. The result of the Dymo placement can be found here: https://github.com/Citytracking/Terrain/tree/master/mapnik/cities Unfortunately these only cover North America, so they aren’t really useful for a worldwide Terrain layer. So far I tried borrowing the Dymo labels from Toner (https://github.com/stamen/toner-carto/tree/master/shp/labels_admin) but these were designed for Helvetica, not PT Sans, which Terrain uses. Need to find another approach.

almccon commented 9 years ago

Probably we should just give up on Dymo and see how well the default Mapnik label placement does the job.

clhenrick commented 9 years ago

@almccon would it be worth trying to re-run Dymo with the new font we are using?

clhenrick commented 9 years ago

@almccon also perhaps PostGIS could help, Mapbox has a post about this in their advanced label placement guide

almccon commented 9 years ago

Good idea. Since @mojodna would like us to migrate all the shapefiles into PostGIS anyway, we have the opportunity to do whatever processing we want in the database import step.

clhenrick commented 8 years ago

@almccon going to close this one as we agreed to resolve using data from aries and Mapnik label placement. Will open a new ticket to add place labels with the new data.