as the topic says I am trying to figure out how OSM generates the details we can see on the map, when we zoom closer to a city.
For example the roads are visualized as 2d white lanes.
I am asking because im trying to generate a city in a game engine based on OSM data. I noticed that in the world map on the homepage the individual road sections (which a road consists of) fit perfectly and form a seamless road. Whereas in the XML file export we get, some of the roads we see online on the map, have so little data (no name tag, etc)available and are split across the entire XML that its almost impossible to figure out which of the Way-Nodes belong to the same Way. The other case is that a couple of roads basically sit on top of each other (almost identical lat, long) because one of them apparently is a footway while the other is a highway but they both share the exact same tags or have so many tags ( footway, cycle, highway, patch, etc.) that I don’t know which one is which or how to filter one of them out. In my use-case the data is very difficult to work with, especially when it comes to the roads.
So basically my question is, does OSM internally use the same exact data we get with the xml export or do they have another way of visualizing the map as we see it online? I am thinking of just placing satellite pictures on the map and then extruding the different parts or whatever.
Thank you very much for any information about this.
The data that you get in an XML export is used to maintain a separate “rendering database” on PostgreSQL which is optimised to return data ready for map display, and when someone moves around the map (at OpenStreetMap.org or on one of the many other OSM-based maps) the web server (Apache) requests map tiles via a plugin (mod_tile) which in turn requests that map tiles be rendered (by “renderd”) which in turn reads the rendering database.
If you’d like to set up your own OSM-like tile server you can follow the instructions at https://switch2osm.org/manually-building-a-tile-server-18-04-lts/ and you can load the database with anything you want - either a small data extract from OSM or some other non-OSM data that you have created. The best way to familiarise yourself with how all the pieces fit together is to actually set up a tile server yourself - then you’ll be able to see how things connect to each other.
If you’d like to visualise data that you’ve got in a .osm file then JOSM is probably the easiest way to do that. Obviously don’t load test or game data into the live OSM server though.
If you’re a little confused about some data that you’ve got in an extract from OSM you’ll need to post the location of it so that someone else can look at the data.