关于Mapnik渲染OSM地图数据的问题(好心的大神们能帮我解释一下,同样也在学习的朋友希望也能进来一起交流一下!)

好学的小桂子 2014-08-07 04:11:38
本人小白,最近接触OSM和postgresql,之前根据论坛里大神们的教学帖以及热心帮助成功地在windows系统里把OSM数据导入了postgresql数据库,由于机器配置的原因未能导入全球数据planet.osm。通过geoserver访问postgis数据能够发布并预览,但是缺少渲染工具,地图显示效果很差。网上都说用mapnik,而且OSM本身也用的是OSM。学习了论坛里大神分享的方法后也在windows上安装了mapnik,但是具体如何渲染这方面的资料很少,有的也只是在Ubuntu系统下实现的案例。
我的问题是,mapnik到底用在地图服务发布的哪一个环节?
1.是在导入数据库postgresql之前就渲染.osm文件,完成后再导入
2.还是在导入数据库之后mapnik渲染postgis数据;
3还是像Udig那样用mapnik生成一个.sld文件通过geoserver引用这个新建的style文件从而实现渲染
维基上给出的mapnik的例子是渲染shp格式的文件,这个倒是实验成功,而关于mapnik渲染OSM的例子维基上却给了一个.osm.xml文件渲染的例子而且是Ubuntu操作系统的,看的云里雾里。
关于我的这些疑问希望好心的大神们能帮我解释一下,同样也在学习的朋友希望也能进来一起交流一下!
...全文
1922 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
Little_Horse_01 2014-10-16
  • 打赏
  • 举报
回复
Little_Horse_01 2014-10-16
  • 打赏
  • 举报
回复
楼主您好,我这里和你一样的情况,将osm数据导入到postgresql中,利用uDig进行样式修改,进行适当的配置,能把一些osm数据区分开来,不知道你最近取得什么进展没有,咱们可以相互交流下。
QQ:83342001
xun398009587 2014-10-15
  • 打赏
  • 举报
回复
引用 1 楼 xzhui 的回复:
我当时也只是用mapnik渲染了shp数据 感觉不管什么数据源和格式,都有一个数据样式配置文件,将样式和数据层指定正确后 就可以渲染出图了 你这里我感觉可能是对数据源指定有点问题。但我没弄过这种格式,帮不上忙
请问我从openstreetmap官网导出的osm数据的数据样式配置文件从哪获得?
好学的小桂子 2014-10-08
  • 打赏
  • 举报
回复
引用 8 楼 liuyuan216814 的回复:
楼主,你好,你做的是室内地图还是室外地图呢,室内地图也需要导入到Postgis database中吗,地图为啥要上传到Postgis database里面呢。刚刚开始研究室内地图,求帮助
我下载的是室外地图,PostGIS是一个空间数据库用来存放和管理数据的,你的数据量要是不大其实也没必要用数据库
liuyuan216814 2014-09-17
  • 打赏
  • 举报
回复
楼主,你好,你做的是室内地图还是室外地图呢,室内地图也需要导入到Postgis database中吗,地图为啥要上传到Postgis database里面呢。刚刚开始研究室内地图,求帮助
好学的小桂子 2014-08-08
  • 打赏
  • 举报
回复
got it !
  • 打赏
  • 举报
回复
引用 5 楼 studiousdavid 的回复:
[quote=引用 3 楼 micropentium6 的回复:] ur post should be moved to GIS section under Enterprise software/development Postgresql with PostGIS is only the store for vector data. I don't think OSM keeps rendered tiles in raster format in PG, although PG supports doing so. The rendition of vector data either happens on the fly, such as the rendition engine in GeoServer for responding http request, or happens beforehand, AKA cache/tile. I am pretty sure that's OSM's approach. This is first time I heard of mapnik. From it's FAQ: It uses the AGG library and offers world class anti-aliasing rendering with subpixel accuracy for geographic data. It is written from scratch in modern C++ and doesn’t suffer from design decisions made a decade ago. AGG is also one of the rendition options (the other one is GD) for MapServer. Mapnik claimed everything was written by C++ from scratch but it's hard to convince me that the developers never browse MapServer source. As for SLD, it's a style file but has the ability to define queries for classifications (thematic map) . SLD file can be introduced in both scenarios I mentioned above.
thx!您这么一说清楚了很多,postgis不能导入渲染后的栅格文件,那么渲染环节就是在入库以后的了[/quote] Postgis actually can store raster data. I just say it is not for OSM data. OSM layer u saw online is tile cached for sure. OSM raw data. --> Postgis database --> mapnik. --> OSM tiles
好学的小桂子 2014-08-08
  • 打赏
  • 举报
回复
引用 3 楼 micropentium6 的回复:
ur post should be moved to GIS section under Enterprise software/development Postgresql with PostGIS is only the store for vector data. I don't think OSM keeps rendered tiles in raster format in PG, although PG supports doing so. The rendition of vector data either happens on the fly, such as the rendition engine in GeoServer for responding http request, or happens beforehand, AKA cache/tile. I am pretty sure that's OSM's approach. This is first time I heard of mapnik. From it's FAQ: It uses the AGG library and offers world class anti-aliasing rendering with subpixel accuracy for geographic data. It is written from scratch in modern C++ and doesn’t suffer from design decisions made a decade ago. AGG is also one of the rendition options (the other one is GD) for MapServer. Mapnik claimed everything was written by C++ from scratch but it's hard to convince me that the developers never browse MapServer source. As for SLD, it's a style file but has the ability to define queries for classifications (thematic map) . SLD file can be introduced in both scenarios I mentioned above.
thx!您这么一说清楚了很多,postgis不能导入渲染后的栅格文件,那么渲染环节就是在入库以后的了
好学的小桂子 2014-08-08
  • 打赏
  • 举报
回复
引用 2 楼 xzhui 的回复:
http://www.cnblogs.com/bluegobin/archive/2010/09/18/1830445.html 上面帖子不知道看过没有,参考一下。。
请问帖子中提到的可以直接绘制OSM的mapnik插件是要单独下载吗?
  • 打赏
  • 举报
回复
ur post should be moved to GIS section under Enterprise software/development Postgresql with PostGIS is only the store for vector data. I don't think OSM keeps rendered tiles in raster format in PG, although PG supports doing so. The rendition of vector data either happens on the fly, such as the rendition engine in GeoServer for responding http request, or happens beforehand, AKA cache/tile. I am pretty sure that's OSM's approach. This is first time I heard of mapnik. From it's FAQ: It uses the AGG library and offers world class anti-aliasing rendering with subpixel accuracy for geographic data. It is written from scratch in modern C++ and doesn’t suffer from design decisions made a decade ago. AGG is also one of the rendition options (the other one is GD) for MapServer. Mapnik claimed everything was written by C++ from scratch but it's hard to convince me that the developers never browse MapServer source. As for SLD, it's a style file but has the ability to define queries for classifications (thematic map) . SLD file can be introduced in both scenarios I mentioned above.
传说中的堕落 2014-08-07
  • 打赏
  • 举报
回复
http://www.cnblogs.com/bluegobin/archive/2010/09/18/1830445.html 上面帖子不知道看过没有,参考一下。。
传说中的堕落 2014-08-07
  • 打赏
  • 举报
回复
我当时也只是用mapnik渲染了shp数据 感觉不管什么数据源和格式,都有一个数据样式配置文件,将样式和数据层指定正确后 就可以渲染出图了 你这里我感觉可能是对数据源指定有点问题。但我没弄过这种格式,帮不上忙
离线地图_openstreetmap_postgresql_postgis_mapnik_osm2pgsql_osm数据(等软件)切~ 写于20150414 关于软件地址 事先说明这其实就是我全部放到百度网盘空间里了。 所以万一一不小心我手抖删了,请mail我。 haibinzhagncn@qq.com 软件包括 leaflet osm里面中国和台湾的数据 openlayers geoserver mabox_studio mapnik 和生成瓦片工具需要的前置包等 postgresql osm2pgsql postgis python 一次只能上传一份那我就少点多几份吧: 介绍(免积分) http://download.csdn.net/detail/a137015127302/8594877 如果懒得自己慢慢找,我想你不介意花点积分的吧。 1.postgreSql_1.&postgis_install http://download.csdn.net/detail/a137015127302/8594903 2.postgreSql_2.mapnik&python_install http://download.csdn.net/detail/a137015127302/8594915 3.postgreSql_3.环境变量配置_osm数据导入 http://download.csdn.net/detail/a137015127302/8594919 4.postgreSql_4.生成图片瓦片byMapnik http://download.csdn.net/detail/a137015127302/8594921 其他:postgreSql_psql_乱码问题 http://download.csdn.net/detail/a137015127302/8594937 上传什么的好烦-- 我再试一次要是还是不能上传我就不玩了。切~ 核心内容(英文版公开资料):http://wiki.openstreetmap.org/wiki/Creating_your_own_tiles 以下本人写的中文版本的核心:只要注意这个基本上就没什么大问题了。 当然你要是懒得自己一步一步走,我想你应该也不介意多花点积分的。 摘录 首先版本请用 postgresql-9.3.6-2-windows.exe + postgis-bundle-pg93x32-setup-2.1.5-1.exe 因为至少如果是 postgresql-9.4.1-3-windows.exe + postgis-bundle-pg94x32-setup-2.1.7-1.exe 存在sample数据库无法创建问题。 同时32位下中文客户端提示信息异常问题,你只能改为英文显示,但是又会有warn信息提示你与本地不符(很烦不是么) 所以结论最新的未必就是最好的。 而且貌似他们已经开始放弃32位了。 还有这个2.1.7貌似是赶工出来的,因为提示信息写的是支援9.3而事实是否定的。 以上是我重装了n多遍的结论。
离线地图_openstreetmap_postgresql_postgis_mapnik_osm2pgsql_osm数据 写于20150414 关于软件地址 事先说明这其实就是我全部放到百度网盘空间里了。 所以万一一不小心我手抖删了,请mail我。 haibinzhagncn@qq.com 软件包括 leaflet osm里面中国和台湾的数据 openlayers geoserver mabox_studio mapnik 和生成瓦片工具需要的前置包等 postgresql osm2pgsql postgis python 一次只能上传一份那我就少点多几份吧: 介绍(免积分) http://download.csdn.net/detail/a137015127302/8594877 如果懒得自己慢慢找,我想你不介意花点积分的吧。 1.postgreSql_1.&postgis_install http://download.csdn.net/detail/a137015127302/8594903 2.postgreSql_2.mapnik&python_install http://download.csdn.net/detail/a137015127302/8594915 3.postgreSql_3.环境变量配置_osm数据导入 http://download.csdn.net/detail/a137015127302/8594919 4.postgreSql_4.生成图片瓦片byMapnik http://download.csdn.net/detail/a137015127302/8594921 其他:postgreSql_psql_乱码问题 http://download.csdn.net/detail/a137015127302/8594937 上传什么的好烦-- 我再试一次要是还是不能上传我就不玩了。切~ 核心内容(英文版公开资料):http://wiki.openstreetmap.org/wiki/Creating_your_own_tiles 以下本人写的中文版本的核心:只要注意这个基本上就没什么大问题了。 当然你要是懒得自己一步一步走,我想你应该也不介意多花点积分的。 摘录 首先版本请用 postgresql-9.3.6-2-windows.exe + postgis-bundle-pg93x32-setup-2.1.5-1.exe 因为至少如果是 postgresql-9.4.1-3-windows.exe + postgis-bundle-pg94x32-setup-2.1.7-1.exe 存在sample数据库无法创建问题。 同时32位下中文客户端提示信息异常问题,你只能改为英文显示,但是又会有warn信息提示你与本地不符(很烦不是么) 所以结论最新的未必就是最好的。 而且貌似他们已经开始放弃32位了。 还有这个2.1.7貌似是赶工出来的,因为提示信息写的是支援9.3而事实是否定的。 以上是我重装了n多遍的结论。

951

社区成员

发帖
与我相关
我的任务
社区描述
PostgreSQL相关内容讨论
sql数据库数据库架构 技术论坛(原bbs)
社区管理员
  • PostgreSQL社区
  • yang_z_1
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧