Map won't show building numbers (tileMill + OSM)

不想你离开。 提交于 2019-12-30 07:55:10

问题


i'm using tileMill for creating offline map for my iPhone app, long story short - i've downloaded OSM data for Ukraine region from here. I've checked that online map(from link) is showing building numbers as you can see in picture:

but after importing data, that i've download, to tile mill there's no building numbers:

any idea why this is happening? Thanks!

EDIT: I figure out how to set up house numbers label, but when i'm importing data to tilemill (with this tutorial) i can't find layer that contains house numbers.

Code for setting label for house numbers:

#housenumbers {
  [zoom >= 17] {
    text-name: "[addr:housenumber]";
    text-placement: interior;
    text-min-distance: 1;
    text-wrap-width: 0;
    text-face-name: @book-fonts;
    text-fill: #444;
    text-size: 9;
  }
}

#housenames {
  [zoom >= 17] {
    text-name: "[addr:housename]";
    text-placement: interior;
    text-wrap-width: 20;
    text-face-name: @book-fonts;
    text-size: 8;
    text-fill: #444;
    [zoom >= 18] {
      text-size: 9;
    }
  }
}

回答1:


You need to understand, that OSM.org uses a pure rendering engine called Mapnik. Tilemill is a wrapper around Mapnik by simplifying stylesheets.

As @scai say, you need to create a stylesheet that renders a label for housenumbers. I'm not familar with tilemill to tell you what need to be done, but usually this consist of

  • Adding a label symbolizer that looksup the addr:housenumber=* tag and prints the value in a appropriate font and size
  • (creating fake nodes that deal with the placement of that labels within building outlines etc.)



回答2:


Layer

Source: PostGIS

Table or subquery

( SELECT way, "addr:housenumber" 
  FROM planet_osm_polygon
  WHERE  "addr:housenumber"  IS NOT NULL
) AS data

Styling

label.mss

#housenumbers[zoom >= 17] {
  ::label {
    text-name: '[addr:housenumber]';
    text-face-name:@sans;
    text-size: 9;   
    text-placement:interior;
    text-min-distance: 1;
    text-wrap-width: 0;
    text-fill: #444;
  }    
}

"::label" is needed for prevent red points on the map.

p.s. for russians, I wrote about it in my blog.




回答3:


for me it worked with planet_osm_point instead of planet_osm_polygon

( SELECT way, "addr:housenumber" FROM planet_osm_polygon WHERE "addr:housenumber" IS NOT NULL ) AS data



来源:https://stackoverflow.com/questions/20685006/map-wont-show-building-numbers-tilemill-osm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!