Having problems with osm data structure

Hi all,

My name is Ibrahim and I’m new to this community.
I am currently working on my thesis, but I’m having some difficulties figuring out how the osm file is structured.
I downloaded the osm file for Belgium, and then I converted it to a postgis database using osm2pgsql.
I am supposed to build a routing application, so I should be able to select locations by coordinates, or by inserting a street name of location name.
What I don’t understand though, is how the data is structured in relation to each other.
The data is divided in 4 tables, Point, Road, Line, Polygon.
Now I figure that Point just symbolizes a POI with coordinates.
On the other hand, I don’t understand what the difference is between the Road table and the Line table, nor what the Polygon table really symbolizes.
And how are the tables linked? I just can’t seem to figure how I can find out which Points belong to which Road/Line/Polygon. (In other words, which column defines the foreign key?)
All in all, I have to say, is that I’m really confused by this.

Tnx in advance!

This is one lack of feature of osm2pgsql, because it is primarily designed for rendering maps and don’t care about foreign keys

Osmosis’s postGIS schema is maybe more suited for you needs (it is constructed to be a relationnal database schema)