像 OpenStreetMap 一样显示地图
我喜欢 OpenStreetMap 显示地图的方式。它看起来几乎像谷歌地图。我已经在笔记本上安装了 GeoServer 和 PostGis。我还为我的国家印度尼西亚获得了这个cloudmade osm 文件。我下载了 indonesia.osm.bz2。
我成功地将它导入到我的 PostGis 中并在我的 GeoServer 上进行了设置,但它没有像 OpenStreetMap 那样显示地图。我选择 Planet_osm_polygon 作为 GeoServer 中的图层。最后,我用 openlayers 显示了这个。 alt text http://deerawan.com/blogimages/map_polygon.jpg
但我希望像这个 替代文本 http://deerawan.com/blogimages/map-indo.png
是吗我从 Cloudmade 使用了错误的 OSM 文件?
感谢您的帮助。
I like the way OpenStreetMap display its map. It almost looks like Google Map. I have already installed GeoServer and PostGis on my notebook. I also got this cloudmade osm file for my country, Indonesia. I downloaded indonesia.osm.bz2.
I successfully imported it into my PostGis and did setup it on my GeoServer but it didn't display map same like OpenStreetMap. I chose planet_osm_polygon as my layer in GeoServer. At the end, I got this one displayed with openlayers.
alt text http://deerawan.com/blogimages/map_polygon.jpg
But I expected to be like this one
alt text http://deerawan.com/blogimages/map-indo.png
was it wrong OSM file that I used from Cloudmade?
Thank you for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我建议遵循 Geoserver 博客中的本教程。
在那里,您将找到有关如何设置 OSM 数据的分步指南,包括数据库导入、样式设置等。
I would recommend to follow this tutorial from Geoserver blog.
There you'll find a step by step guide on how to setup OSM data, including database import, styling, etc.
您下载的文件仅包含数据。
没有有关其显示方式的信息...
您有 2 个解决方案:
- 通过 OpenLayers.Layer.OSM 直接在地图中使用 OSM ( http://openlayers.org /dev/examples/osm.html ),
- 使用制图服务器按照您想要的方式设置数据样式...(OSM 使用mapnik,或者您可以使用mapserver:http://trac.osgeo.org/mapserver/wiki/RenderingOsmData,不知道它们是否适用于 geoserver 的可用样式)
HTH,
The file you download contains just data.
No information about the way it's displayed…
You got 2 solutions:
- Use OSM directly in your map with a OpenLayers.Layer.OSM ( http://openlayers.org/dev/examples/osm.html ),
- Use a cartographic server to style your data the way you want… (OSM uses mapnik, or you can use mapserver : http://trac.osgeo.org/mapserver/wiki/RenderingOsmData , no idea if they're available styles for geoserver )
HTH,
GeoServer 需要两件事来渲染地图:
数据
仅导入 OSM 行星转储不足以获得漂亮的地图,您需要的不仅仅是道路和地标。 OpenStreetMap 添加了一个海岸线数据集(我认为它实际上源自 OpenStreetMap 数据,但出于性能原因进行了一些预处理)和来自 自然地球项目。
样式表
GeoServer使用OGC SLD 格式的样式,因此您需要查找或创建一些特定于 OpenStreetMap 数据集的 SLD 样式。以下是您可以查找它们的一些建议位置:
我也在开发 将 Mapnik 地图文件转换为 GeoServer 配置的工具。它可以与 MapQuest Open 中的样式配合使用,但与 openstreetmap.org 使用的样式仍然存在一些问题。如果您想尝试一下,欢迎报告错误。
GeoServer requires two things to render a map:
data
Just importing the OSM planet dump isn't enough to get a nice map, you need more than just roads and landmarks. OpenStreetMap adds a coastline dataset (which I think is actually derived from OpenStreetMap data, but pre-processed a bit for performance reasons) and some data from the Natural Earth project.
stylesheets
GeoServer uses the OGC SLD format for styles, so you'll need to find or create some SLD styles specific to the OpenStreetMap dataset. Here are a few suggestions of places you could look for them:
I'm also working on a tool to convert Mapnik map files to GeoServer configurations. It works okay with the styles from MapQuest Open but still has some issues with the ones used for openstreetmap.org. If you want to give it a try though, bug reports are welcome.
我认为你错过了海岸线和世界边界。 osm wiki 上有更多关于在哪里下载绘制海岸线的附加数据的信息。
I think that you are missing the coastlines and world boundaries. There is more information on the osm wiki about where to download the additional data to draw the coastlines.