It’s been awhile that I have been trying to understand and setup an Openstreetmap server. It’s easy, one can follow the tutorial at Switch2OSM and do it and I did the same like many others. While I was setting up the Openstreetmap server I was missing a lot of the basic concepts. Although Switch2OSM will get you started I would highly suggest not to follow this tutorial as it is missing a lot of tweaks and details. I found a better tutorial written by our friend Xiao Guoan on his blog post.
I will also suggest, although however lucrative it is, do not attempt to import the whole planet server on the first go, rather stick with a small section and try it first. Whole planet can take a long time to import depending on the hardware used. I tried it on a 24 thread HP DL360 G7 server and it took me over 3 days to find out I will have to start over again.
Most of the time we create our own map server is either for fun (like I did) or we don’t want to pay a service provider like Google Maps or we want to use the map data offline. Let’s look at the different building blocks of a map service so that we can make our own map server with some better understanding.
http://server-domain/zoom/lat/long.ext
Tile Servers don’t use the coordinate system we are familiar with. It uses a system called tile coordinate system. These coordinate system changes as the zoom level changes. Here is a nifty tool if you want to play with tile coordinate system. Client side libraries will also add more common features required for using the map service like for example to put a marker on the map or make a polygon etc. Most common client side libraries are Leaflet and MapBox GL JS Both of these are open source and free to use. Hear is a list of some other client side libraries.That’s it for today hope OpenStreetMap Made Easy was helpful!
https://github.com/mapbox/awesome-vector-tiles#servers
https://switch2osm.org/
https://git.siliconbrane.ml/kaushik_ray_1/gps-data-web-server
https://docs.mapbox.com/mapbox-gl-js/api/
https://info.crunchydata.com/blog/dynamic-vector-tiles-from-postgis
https://openlayers.org/
https://leafletjs.com/