I want to get the type of road and location name from overpass turbo.Heres a code segment
way[highway](9.7471,76.7153,9.7474,76.7162)[highway];
(._;>;);
out;
when i make a query using the above code it gives me the data as
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2017-03-27T18:00:02Z"/>
<node id="1026148112" lat="9.7462997" lon="76.7135716"/>
<node id="1026148114" lat="9.7466238" lon="76.7140184"/>
<node id="1026148117" lat="9.7471504" lon="76.7150035"/>
<node id="1026148120" lat="9.7473103" lon="76.7154899"/>
<node id="1026148123" lat="9.7473949" lon="76.7162087"/>
<node id="1116474089" lat="9.7468330" lon="76.7143003"/>
<node id="1651751027" lat="9.7487008" lon="76.7231996"/>
<node id="1651751029" lat="9.7473639" lon="76.7167318"/>
<node id="1651751035" lat="9.7487643" lon="76.7223199"/>
<node id="1651751046" lat="9.7479929" lon="76.7182032"/>
<node id="1651751050" lat="9.7487225" lon="76.7229936"/>
<node id="1651751090" lat="9.7486583" lon="76.7233311"/>
<node id="1651751094" lat="9.7485956" lon="76.7196302"/>
<node id="1651751098" lat="9.7478975" lon="76.7176582"/>
<node id="1651751106" lat="9.7489440" lon="76.7238648"/>
<node id="1651751171" lat="9.7472843" lon="76.7169226"/>
<node id="1651751174" lat="9.7486961" lon="76.7199896"/>
<node id="1651751177" lat="9.7486802" lon="76.7215721"/>
<node id="1651751202" lat="9.7483889" lon="76.7189725"/>
<node id="1651751208" lat="9.7482361" lon="76.7185948"/>
<node id="1651751214" lat="9.7473943" lon="76.7166102"/>
<node id="1651751218" lat="9.7487119" lon="76.7206655"/>
<node id="1651751220" lat="9.7484629" lon="76.7193533"/>
<node id="1651751224" lat="9.7472906" lon="76.7169967"/>
<node id="1651751242" lat="9.7479506" lon="76.7178277"/>
<node id="1651751252" lat="9.7479506" lon="76.7180262"/>
<node id="1651751254" lat="9.7486931" lon="76.7234620"/>
<way id="270573607">
<nd ref="1026148112"/>
<nd ref="1026148114"/>
<nd ref="1116474089"/>
<nd ref="1026148117"/>
<nd ref="1026148120"/>
<nd ref="1026148123"/>
<nd ref="1651751214"/>
<nd ref="1651751029"/>
<nd ref="1651751171"/>
<nd ref="1651751224"/>
<nd ref="1651751098"/>
<nd ref="1651751242"/>
<nd ref="1651751252"/>
<nd ref="1651751046"/>
<nd ref="1651751208"/>
<nd ref="1651751202"/>
<nd ref="1651751220"/>
<nd ref="1651751094"/>
<nd ref="1651751174"/>
<nd ref="1651751218"/>
<nd ref="1651751177"/>
<nd ref="1651751035"/>
<nd ref="1651751050"/>
<nd ref="1651751027"/>
<nd ref="1651751090"/>
<nd ref="1651751254"/>
<nd ref="1651751106"/>
<tag k="comment" v="Motor Vehicle Speed as per Kerala Govt restriction"/>
<tag k="highway" v="secondary"/>
<tag k="is_in" v="kerala;india"/>
<tag k="maxspeed" v="70"/>
<tag k="maxspeed:bus" v="40"/>
<tag k="maxspeed:motorcar" v="70"/>
<tag k="maxspeed:motorcycle" v="50"/>
<tag k="maxspeed:taxi" v="60"/>
<tag k="name" v="Pravithanam Road"/>
</way>
</osm>
From the above data i want to get the value of key- 'name' (i.e Pravithanam Road) and 'highway' (i.e secondary).How should i edit the above code to do that?
Assuming you only want name and highway and nothing else in the result (no reference to nodes), you should turn to CSV output format:
[out:csv(name, highway)];
way[highway](9.7471,76.7153,9.7474,76.7162);
out;
Otherwise, please update your question and provide a bit more context!