OSM、TileCache 和 Mapnik
到目前为止,我已经尝试了两个半星期来获取在服务器上运行的 OpenStreetMap 的本地副本。我已经下载了行星文件并将其导入到名为“osm”的 PostGIS 数据库中。我使用 OSM Mapnik 工具生成 XML 样式表以供 Mapnik 使用。我已经使用 TileLite 来证明 Mapnik 可以从数据库渲染 OSM 图块。这些瓷砖甚至看起来就是我想要的样子。
我现在的问题是我无法让 TileCache 与 Mapnik 一起使用。我安装了一个 MapServer 实例,用于提供 Shapefile 服务。这适用于 TileCache。 TileCache 配置文件中的默认“基本”层也可以工作。请帮助我的 OSM 层:
[osm]
type=Mapnik
mapfile=/var/maps/bin/mapnik/osm.xml
spherical_mercator=true
bbox=-16697000,8610000,-16667000,8640000
maxResolution=156543.0339/4
levels=18
srs=EPSG:900913
我已经阅读了我能找到的所有最新博客文章、论坛文章和教程。任何帮助将不胜感激。我怀疑我要么错过了什么,要么做了一些愚蠢的事情。
I have been trying for two and a half weeks so far to get a local copy of OpenStreetMap running on a server. I have downloaded the planet file and imported it into a PostGIS database called 'osm'. I have used OSM Mapnik tools to generate an XML stylesheet for Mapnik to use. I have used TileLite to prove that Mapnik can render OSM tiles from the database. The tiles even look the way that I want them to look.
My problem now is that I cannot get TileCache to work with Mapnik. I have a MapServer instance installed that I am using to serve Shapefiles. This works with TileCache. The default 'basic' layer in the TileCache configuration file works as well. Please help with my OSM layer:
[osm]
type=Mapnik
mapfile=/var/maps/bin/mapnik/osm.xml
spherical_mercator=true
bbox=-16697000,8610000,-16667000,8640000
maxResolution=156543.0339/4
levels=18
srs=EPSG:900913
I have read every last blog post, forum post, and tutorial I can find. Any help would be appreciated. I suspect I have either missed something or I am doing something stupid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尼克,
我可以理解这里潜在的困难,并且你已经尝试了很多方法。但是,您没有说明您遇到了哪些具体问题,所以我猜这是您的问题:
那个?如果没有,请提供更多详细信息。
如果这是问题所在,那么您可能需要做的是确保在 OpenLayers 中使用“TMS”图层类型,并将其与 TileCache.cfg 图层参数相匹配。 “TMS”与 OSM 平铺方案非常相似,只是 y 值被翻转。
无论如何,类似这样的东西应该可以工作:
tilecache.cfg
OpenLayers Layer
我从第一次开始工作时从我的一个旧示例中提取了这个:http://mapnik-utils.googlecode.com/svn/example_code/tilecache/openlayers_osm.html
Nik,
I can understand the potential difficulties here and that you've tried a number of things. You did not say what exact problems you ran into however, so I'll guess that this is your problem:
That it? If not, please provide a bit more detail.
If that is the problem then likely what you need to do is to make sure to use a "TMS" layer type in OpenLayers and to match that with your TileCache.cfg layer params. "TMS" is very similar to the OSM tile scheme except that the y value is flipped.
Anyway, something like this should work:
tilecache.cfg
OpenLayers Layer
I pulled this from an old example of mine from the first time I got this working: http://mapnik-utils.googlecode.com/svn/example_code/tilecache/openlayers_osm.html