4

I'm trying to construct a query of all 'highway=' ways in a specific area in overpass. I've been defaulting to using the {{bbox}} - but I really would prefer to do it by country.

I've tried using 'nominatimArea:' instead of {{bbox}} but I get a parse error ' line 8: parse error: ')' expected - '(' found. ' on the below:

/*
This shows the roads in nepal.
*/

[out:json];

(
  way ["highway"~"motorway|trunk|primary|motorway_link|trunk_link|primary_link|unclassified|tertiary|secondary|track|path"]({{nominatimArea:Nepal}});
);

out meta;
>;
out skel qt;

ALSO ... if I try this...I only (weirdly) get one area - no ways (maybe the relations are a mess?)

/*
This shows the roads in nepal.
*/

[out:json];

(area[name="Nepal"];
  way(area) ["highway"~"motorway|trunk|primary|motorway_link|trunk_link|primary_link|unclassified|tertiary|secondary|track|path|residential|service"];
);

out meta;
>;
out skel qt;

Returns this one item (and it is an area NOT a way)

Note: I know this is a large query - but I really just need the url to the raw JSON (like this) - not the actual overpass map result.

user14696
  • 657
  • 2
  • 10
  • 30

1 Answers1

8

Got it.

/*
This shows the roads in nepal.
*/

[out:json];

area[name="नेपाल"];
 (way["highway"~"motorway|trunk|primary|motorway_link|trunk_link|primary_link|unclassified|tertiary|secondary|track|path|residential|service|secondary_link|tertiary_link"](area);
);

out meta;
>;
out skel qt;
user14696
  • 657
  • 2
  • 10
  • 30