Shohreh
(Shohreh)
August 18, 2017, 9:13pm
#1
Hello,
This works fine in Overpass Turbo:
[out:json][timeout:25];
rel(123);map_to_area -> .searchArea;
(
node["highway"="traffic_signals"](area.searchArea);
way["highway"="traffic_signals"](area.searchArea);
relation["highway"="traffic_signals"](area.searchArea);
);
out body;
>;
out skel qt;
But it fails when copy/pasted into JOSM (File > Download from Overpass API):
rel(123);map_to_area -> .searchArea;
(
node["highway"="traffic_signals"](area.searchArea);
way["highway"="traffic_signals"](area.searchArea);
relation["highway"="traffic_signals"](area.searchArea);
);
out body;
>;
out skel qt;
What’s wrong with the query?
Thank you.
mmd
August 19, 2017, 7:35am
#2
There are multiple issues with your query:
JOSM requires XML format, JSON format will not work
JOSM requires metadata, out body; >; out skel qt; will not do as they don’t include object version numbers. Use (._;>;);out meta; instead
In general it’s probably best to use Export → load data into an OSM editor: JOSM and have your query automatically fixed.
Shohreh
(Shohreh)
August 19, 2017, 9:12am
#3
Thanks much.
I agree, but I needed to download a subset of the data from OSM, not everything in a given area, hence my using a query to Overpass.
escada
(Escada)
August 19, 2017, 10:05am
#4
The method mmd describes will also only load the data defined by the Overpass Query. You do not have to load any other data with JOSM in that case.
mmd
August 19, 2017, 11:01am
#5
Shohreh:
I agree, but I needed to download a subset of the data from OSM, not everything in a given area, hence my using a query to Overpass.
Maybe not clear enough, “Export → load data into an OSM editor: JOSM” refers to overpass turbo, not openstreetmap.org . Hence, JOSM will download exactly the same data as you get in overpass turbo via your query. in fact, your Overpass query will be transferred to JOSM and run again on the JOSM side.
Please also check the overpass turbo documentation for further details: http://wiki.openstreetmap.org/wiki/Overpass_turbo#Exporting_Results