[GIS] How to query highways with overpass turbo

openstreetmapoverpass-api

I want to use overpass to show major highways for a US city. How can I query that from overpass turbo?

I tried the following code here and it returns tons of dots. I really want only lines showing the major highways

<!--
This has been generated by the overpass-turbo wizard.
The original search was:
“highway”
-->
<osm-script output="json" timeout="25">
  <!-- gather results -->
  <union>
    <!-- query part for: “highway” -->
    <query type="way">
      <has-kv k="highway"/>
      <bbox-query {{bbox}}/>
    </query>
  </union>
  <!-- print results -->
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

Best Answer

The query is all right. You are getting only nodes because your query area is big and the overpass server times out while processing nodes, it never gets to process the ways.

Either reduce your area or set larger timeout. And if you need only major highways, you should query for highway=primary or highway = trunk.