I have been trying to use a rest API to query my OSM data that I have already uploaded in my postgres DB. I have been trying to write a small javascript program, which makes use of a restful API (Like API 0.7 of OSM, XAPI, Overpass API - I do not know which is the best of these 3).
I would want to make queries to my postgres DB via an XHR from Javascript using some thin API on the server (which is either one among those 3). I have searched high and low on the internet, but there are no tutorials on this.
I have been thinking of using the overpass API, but I guess I might have to use the Overpass query language for this. How about using XPath for parsing these postgres queries?
Edit - I do not want to use any of the mapping libraries like leaflet, mapnik, etc. that already can produce tiled information. I am trying to produce map tiles on my own. Hence, as a first step,I need to know how to use a rest API to query for osm data on my postgres db.
Edit 2- My queries are something like getting all the places of interest within a bounding box. For example, i wrote a select query for postgres that returns the places through which a particular highway passes through, within a bounding box of lat and long.
Also, how can i use javascript to plot these points on a web browser?