OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

Announcement

A fix has been applied to the login system for the forums - if you have trouble logging in please contact support@openstreetmap.org with both your forum username and your OpenStreetMap username so we can make sure your accounts are properly linked.

#1 2017-08-18 22:13:44

Shohreh
Member
Registered: 2012-12-15
Posts: 94

[SOLVED] [JOSM] Query works in OverpassTurbo, but fails in JOSM

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;

JOSM.rel.query.fails.png

What's wrong with the query?

Thank you.

Last edited by Shohreh (2017-08-19 10:12:46)

Offline

#2 2017-08-19 08:35:31

mmd
Member
Registered: 2010-11-06
Posts: 1,135

Re: [SOLVED] [JOSM] Query works in OverpassTurbo, but fails in JOSM

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.

Last edited by mmd (2017-08-19 08:38:11)


Overpass API by Example - mit vielen neuen Beispielen für Version 0.7.54!

Online

#3 2017-08-19 10:12:30

Shohreh
Member
Registered: 2012-12-15
Posts: 94

Re: [SOLVED] [JOSM] Query works in OverpassTurbo, but fails in JOSM

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.

Offline

#4 2017-08-19 11:05:38

escada
Moderator
Registered: 2011-08-13
Posts: 1,161

Re: [SOLVED] [JOSM] Query works in OverpassTurbo, but fails in JOSM

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.

Offline

#5 2017-08-19 12:01:10

mmd
Member
Registered: 2010-11-06
Posts: 1,135

Re: [SOLVED] [JOSM] Query works in OverpassTurbo, but fails in JOSM

Shohreh wrote:

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/Over … ng_Results

Last edited by mmd (2017-08-19 12:04:51)


Overpass API by Example - mit vielen neuen Beispielen für Version 0.7.54!

Online

Board footer

Powered by FluxBB