I'm now working on a project to know if vehicles are over-speeding based on the roads speed limits.for this,we need to get the type (highway,school road etc) of road on which my vehicle currently is on using the GPS obtained latitude and longitude.how can we obtain this from OSM.We are new to this ,so need a good description on this. Better if you can provide us the codes too.
You can use overpass-turbo to obtain this kind of data from OSM. Documentation is here. This example query will give you all roads in specified polygon
way(50.745,7.17,50.75,7.18)[highway];
(._;>;);
out;
Keep in mind that this is free service but has it's usage conditions. If you're planning making a lot of queries you should think about your own service or database...