How to render OSM tiles

瘦欲@ 提交于 2020-01-16 18:07:10

问题


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 !

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.

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

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


回答1:


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.

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

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.

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

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



来源:https://stackoverflow.com/questions/38871978/how-to-render-osm-tiles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!