【问题标题】:No map, only coastlines when browsing slippymap没有地图,浏览slippymap时只有海岸线
【发布时间】:2014-05-14 11:44:41
【问题描述】:

我正在 CentOS 6.4 上创建一个 OpenStreetMap 瓦片服务器。在为“本地瓷砖”图层加载 slippymap.html 页面时,我得到的只是一张地图,只有白色和蓝色两种颜色用于陆地和水。也就是说,我看到的基本上是海岸线的图像。 “mapnik”层工作正常。

这是我第一次做与地图相关的软件配置。 mapnik、osm2pgsql、postgis、tile 等所有术语对我来说都是新的。

据我从谷歌搜索结果中看到的,似乎没有关于在 CentOS 6.x 上创建此服务器的现成信息。所以,对我来说,主要的指令集是以下文档:

http://switch2osm.org/serving-tiles/manually-building-a-tile-server-12-04/[1]

所有组件要么必须从第三方 CentOS 存储库(如 ELGIS、RPMForge、EPEL 和 PGDG92)安装,要么从源代码编译。

几天前,我确实在 Ubuntu 12.04 上创建了相同的服务器,这很简单。遵循了这些说明:

http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/[2]

请注意,文档 [2] 提到了访问 slippymap.html,但 [1] 没有。在 [1] 中,提到的唯一测试是访问 yourserveraddress/osm_tiles/0/0/0.png,即使在我的 CentOS 6.4 设置中也可以正常工作。我通过从 Ubuntu 12.04 框中复制并进行少量编辑来创建了 slippymap.html。

另一个可能是关键线索的信息是渲染中的以下错误:

proj_init_error:无法初始化投影:'+init=epsg:4326'

我确实安装了 proj 和 proj-devel 软件包。

$ ldd /usr/local/bin/renderd | grep 项目 libproj.so.0 => /usr/lib64/libproj.so.0 (0x00007ffa42a0e000)

如何调试此问题?可能是什么问题呢?是否有任何清单来验证每个组件(如 osm2pgsql、postgres/postgis db、mod_tile 或 mapnik)的正常运行?

【问题讨论】:

标签: openstreetmap


【解决方案1】:

我调试了这个问题,并从 Git repo 的 2.0.x 分支 git://github.com/mapnik/mapnik 调用 pj_init_plus_ctx() 中了解了 mapnik 源,但失败了。看,代码被截断以获取更多信息。

/*
 * Demonstrate mapnik 2.0 against proj 4.8.0-2 bug.
 *
 * Mapnik makes use of pj_init_plus_ctx() if the PJ_VERSION macro is >= 480,
 * which fails. Otherwise, it calls pj_init_plus(), which succeeds.
 */

#include <proj_api.h>

int main(void)
{
    projCtx ctx = NULL;
    projPJ proj = NULL;
#if 0
    projPJ p = NULL;
#endif

    ctx = pj_ctx_alloc();
    /* proj is NULL after this call */
    proj = pj_init_plus_ctx(ctx, "+init=epsg:4326");

#if 0
    /* p is not NULL after this call */
    p = pj_init_plus("+init=epsg:4326");
#endif
    return 0;
}

我已经能够通过将 /usr/include/pj_api.h 中的 PJ_VERSION 更改为 470 来取得进展。确实遇到了另一个已修复的错误,即在 / 中将 font_dir 设置为“/usr/local/lib64/mapnik/fonts”等/renderd.conf。现在会显示地名、州界、道路等名称。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多