How to render OSM tiles

2019-09-15 16:21发布

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条回答
2楼-- · 2019-09-15 17:05

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.

查看更多
登录 后发表回答