地图不会显示建筑物编号(tileMill + OSM)

时间:2013-12-19 15:03:55

标签: map openstreetmap mapbox tilemill

我正在使用tileMill为我的iPhone应用程序创建离线地图,长话短说 - 我从here下载了乌克兰地区的OSM数据。我已经检查过在线地图(来自链接)正在显示建筑物编号,如图所示:

enter image description here

但在导入数据后,我已经下载了瓷砖厂没有建筑物编号:

enter image description here

知道为什么会这样吗?谢谢!

编辑:我弄清楚如何设置门牌号标签,但是当我将数据导入tilemill时(使用此tutorial)我找不到包含门牌号的图层。

设置门牌号码的代码:

#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;
    }
  }
}

3 个答案:

答案 0 :(得分:4)

来源:PostGIS

表或子查询

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

定型

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”来防止地图上的红点。

P.S。对于俄罗斯人,我在我的blog中写了这篇文章。

答案 1 :(得分:3)

您需要了解,OSM.org使用名为Mapnik的纯渲染引擎。 Tilemill是Mapnik的一个包装器,它简化了样式表。

正如@scai所说,你需要创建一个样式表来为housenumbers呈现标签。我不熟悉tilemill告诉你需要做什么,但通常这包括

  • 添加一个标签符号,用于查找addr:housenumber = *标签并以适当的字体和大小打印该值
  • (创建虚假节点,处理建筑物轮廓内的标签放置等)。

答案 2 :(得分:0)

对我而言,它适用于planet_osm_point而不是planet_osm_polygon

(SELECT方式," addr:housenumber"   来自planet_osm_polygon   在哪里" addr:housenumber"不是空的 )AS数据

相关问题