我下载了澳大利亚OSM摘录并使用osm2pgsql将其移动到名为gis的数据库中。
我已将generate_tiles.py更改为仅为澳大利亚生成切片:
bbox = (-180.0,-90.0, 180.0,90.0)
render_tiles(bbox, mapfile, tile_dir, 0, 5, "World")
minZoom = 10
maxZoom = 16
bbox = (101.1,-6.9,165.5,-45.9)
render_tiles(bbox, mapfile, tile_dir, minZoom, maxZoom)
当我尝试使用以下内容生成切片时: 导出MAPNIK_MAP_FILE =“osm.xml”&&导出MAPNIK_TILE_DIR =“/ tmp / tilecache /”&& ./z0generate_tiles.py
在/ tmp / tilecache中使用png tiles创建了很多目录。瓷砖有州界和国家名称,似乎有高速公路。 但是..当我导航到地址时: http://localhost/osm/tilecache-2.11/index.html 我只看到国家和州,但没有标签,没有街道。我认为这可能是访问postgis数据的权限问题。我已经进入psql并发布: 授予数据库gis to PUBLIC
的所有特权在/etc/tilecache.cfg我有:
[cache]
type=Disk
base=/tmp/tilecache
[osm]
type=Mapnik
mapfile=/home/(my user_name)/bin/mapnik/my_osm.xml
spherical_mercator=true
tms_type=google
metatile=yes
[basic]
type=WMS
url=http://labs.metacarta.com/wms/vmap0
extension=png
似乎mapnik无法与postgis通信。我已登录postgres并执行:
GRANT ALL PRIVILEGES ON DATABASE gis TO PUBLIC
我使用以下内容生成了my_osm.xml文件:
./generate_xml.py osm.xml my_osm.xml --dbname gis --user (uname) --password (pword) --accept-none
它生成没有任何错误。
这就是我可以接受的。当通过网络访问时,正在创建新文件,他们只是没有任何道路信息。 有什么想法吗?
答案 0 :(得分:1)
一条评论:
在错过的道路上检查一些事情:
旧地理库的某些时候出现问题会导致缺少osm2pgsql导入的数据,因此请确保plant_osm_line表中有很多行:
从planet_osm_line中选择count(*);
此外,请确保您运行的是最新的Mapnik版本,至少为0.7.0,理想情况下为0.7.1。
尝试使用nik2img.py渲染一些地图,并确保mapnik现在输出可能导致此问题的任何警告 - 常见问题可能是缺少EPSG的proj4 epsg定义:900913