如何渲染OSM切片 [英] How to render OSM tiles

查看:249
本文介绍了如何渲染OSM切片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置一个图块服务器.

I would like to setup a tiles server.

我在网上找到了一些文档,并遵循了本教程.

I found some documentation on the net and followed this tutorial.

现在看来,我的数据库中配置的服务器很好,带有一个小地图(圭亚那),太酷了!

Now it seems like I have a well configured server with a small map (Guyana) in my database, that's cool !

但是现在,我仍然不了解如何获取和配置显示我的地图的界面... 该教程提供了一些建议,并提供了一些指向OpenLayers和Leaflet的链接,但它似乎使用了在线地图,但是我想渲染本地文件.

But now, I still don't understand how to get and configure an interface to display my map... The tutorial suggests and give some links to OpenLayers and Leaflet but it seems to use online maps but I want to render my local files.

此外,该教程还说"mapnik"是渲染的内容,但不知道如何使用它!

Also, the tutorial say that "mapnik" is what does the rendering, but no idea how to use it !

我在virtualbox中使用Ubuntu 14.04,apache2,Mod_tile,rendered,mapnik,osm2pgsql和一个postgresql/postgis数据库.

I'm using Ubuntu 14.04, apache2, Mod_tile, renderd, mapnik, osm2pgsql and a postgresql/postgis database in virtualbox.

如果您有一些建议,不客气!谢谢

If you have some tips you're welcome ! Thanks

推荐答案

如果您已经将shapefile导入到Postgis数据库中,则可以创建样式或使用 Mapbox Studio TIlemill 工具,然后导入到mapnik.xml文件.

If you already imported a shapefile to a postgis database, you can create a style or use the OSM default style with the Mapbox Studio or TIlemill tool and then import to a mapnik.xml file.

使用mapnik样式文件,您可以按照指南以使用Renderd和mod_tile服务图块.

With the mapnik style file you can follow the guide to serve the tiles using Renderd and mod_tile.

如果可以致电,请浏览至http://您的服务器地址/osm_tiles/0/0/0. png ,并且可以毫无问题地查看世界图块,如果没有发生问题,则说明您的Tile Server配置正确.

If you can call browse to http://yourserveraddress/osm_tiles/0/0/0.png and see the world tile without problems your Tile Server has been configured correctly, if not something went wrong.

此后,您可以在 Leaflet 之类的前端框架. org/using-tiles/getting-started-with-leaflet/"rel =" nofollow>指南" .

After this, you can use frontend frameworks like Leaflet following this guide.

要了解有关OSM世界的一种好方法,是通过<创建自己的 API 一个href ="https://github.com/openstreetmap/openstreetmap-website" rel ="nofollow"> OSM API存储库.

A good way to learn more about the OSM world is create your own API by the OSM API repository.

这篇关于如何渲染OSM切片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆