Modify

Opened 7 years ago

Closed 7 years ago

#12547 closed defect (fixed)

Overpass API "Build query" does not work

Reported by: anonymous Owned by: team
Priority: normal Milestone: 16.02
Component: Core Version:
Keywords: java7 Cc: simon04

Description

File -> Download from Overpass API... -> Build query

I had to remove "[out:json]" an replace "out geom;" with "out meta;" to make it work.

Attachments (0)

Change History (19)

comment:1 Changed 7 years ago by Klumbumbus

Owner: changed from team to anonymous
Status: newneedinfo

works for me. Please give more information:

  • the text you write in the build query box
  • the information as asked on newticket

comment:2 Changed 7 years ago by anonymous

Latest JOSM (9842).

build query box text:
amenity=waste_disposal

Generates:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“amenity=waste_disposal”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “amenity=waste_disposal”
  node["amenity"="waste_disposal"];
  way["amenity"="waste_disposal"];
  relation["amenity"="waste_disposal"];
);
// print results
out geom;

Answer from server is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" lang="en"/>
  <title>OSM3S Response</title>
</head>
<body>

<p>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: Unknown type "[" </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: static error: For the attribute "type" of the element "query" the only allowed values are "node", "way", "relation" or "area". </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: ; expected - out found. </p>

</body>
</html>>
org.openstreetmap.josm.io.OsmApiException: ResponseCode=400, Error Header=<line 6: parse error: Unknown type "[">, Error Body=<<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" lang="en"/>
  <title>OSM3S Response</title>
</head>
<body>

<p>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: Unknown type "[" </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: static error: For the attribute "type" of the element "query" the only allowed values are "node", "way", "relation" or "area". </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: ; expected - out found. </p>

</body>
</html>>

comment:3 Changed 7 years ago by Klumbumbus

Do you create the query in josm or at the overpass turbo website?

comment:4 Changed 7 years ago by anonymous

In JOSM.
I just enter amenity=waste_disposal into the JOSM build query box.

comment:5 Changed 7 years ago by anonymous

This is the whole message, which includes the URL:

INFO: GET http://overpass-api.de/api/interpreter?data=%5Bbbox%5D%3B%2F*%0AThis+has+been+generated+by+the+overpass-turbo+wizard.%0AThe+original+search+was%3A%0A%E2%80%9Camenity%3Dwaste_disposal%E2%80%9D%0A*%2F%0A%5Bout%3Ajson%5D%5Btimeout%3A25%5D%3B%0A%2F%2F+gather+results%0A%28%0A++%2F%2F+query+part+for%3A+%E2%80%9Camenity%3Dwaste_disposal%E2%80%9D%0A++node%5B%22amenity%22%3D%22waste_disposal%22%5D%3B%0A++way%5B%22amenity%22%3D%22waste_disposal%22%5D%3B%0A++relation%5B%22amenity%22%3D%22waste_disposal%22%5D%3B%0A%29%3B%0A%2F%2F+print+results%0Aout+geom%3B&bbox=7.420181,51.5166413,7.4236626,51.5188345 -> 400 (504 B)
Fehler: org.openstreetmap.josm.io.OsmApiException: ResponseCode=400, Error Header=<line 6: parse error: Unknown type "[">, Error Body=<<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" lang="en"/>
  <title>OSM3S Response</title>
</head>
<body>

<p>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: Unknown type "[" </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: static error: For the attribute "type" of the element "query" the only allowed values are "node", "way", "relation" or "area". </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: ; expected - out found. </p>

</body>
</html>>
org.openstreetmap.josm.io.OsmApiException: ResponseCode=400, Error Header=<line 6: parse error: Unknown type "[">, Error Body=<<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" lang="en"/>
  <title>OSM3S Response</title>
</head>
<body>

<p>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: Unknown type "[" </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: static error: For the attribute "type" of the element "query" the only allowed values are "node", "way", "relation" or "area". </p>
<p><strong style="color:#FF0000">Error</strong>: line 6: parse error: ; expected - out found. </p>

</body>
</html>>
        at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:168)
        at org.openstreetmap.josm.io.OverpassDownloadReader.getInputStreamRaw(OverpassDownloadReader.java:95)
        at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:97)
        at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:61)
        at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:44)
        at org.openstreetmap.josm.io.BoundingBoxDownloader.parseOsm(BoundingBoxDownloader.java:184)
        at org.openstreetmap.josm.io.OverpassDownloadReader.parseOsm(OverpassDownloadReader.java:149)
        at org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask$DownloadTask.parseDataSet(DownloadOsmTask.java:325)
        at org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask$DownloadTask.realRun(DownloadOsmTask.java:333)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:161)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

comment:6 Changed 7 years ago by Klumbumbus

I get this when I click on build query in josm:

[out:xml][timeout:25];
(
  node["amenity"="waste_disposal"];
  way["amenity"="waste_disposal"];
  relation["amenity"="waste_disposal"];
);
(._;>;);
out meta;
Last edited 7 years ago by Klumbumbus (previous) (diff)

comment:7 Changed 7 years ago by anonymous

Strange.
What can I do to help you to find the problem?

comment:8 Changed 7 years ago by Klumbumbus

Please add your statusreport. See newticket

comment:9 Changed 7 years ago by anonymous

I have a mirrored_download.jar in ~/.josm/plugins folder.
But the plug-in is not listed in the statusreport and not listed under Help -> About -> Plugins.

comment:10 Changed 7 years ago by anonymous

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-02-20 02:10:49 +0100 (Sat, 20 Feb 2016)
Build-Date:2016-02-20 02:31:54
Revision:9842
Relative:URL: ^/trunk

Identification: JOSM/1.5 (9842 en) Linux Debian GNU/Linux 8.3 (jessie)
Memory Usage: 551 MB / 3200 MB (187 MB allocated, but free)
Java version: 1.7.0_95-b00, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: openjdk-7-jre:amd64-7u95-2.6.4-1~deb8u1
VM arguments: [-Djava.net.preferIPv4Stack=true]

Plugins:
- FastDraw (31895)
- HouseNumberTaggingTool (31772)
- Mapillary (32040)
- OpeningHoursEditor (31772)
- PicLayer (31895)
- RoadSigns (31895)
- alignways (31895)
- apache-commons (31895)
- apache-http (31895)
- buildings_tools (31895)
- ejml (31895)
- geotools (31895)
- gson (31895)
- jts (31772)
- mapdust (31772)
- public_transport (31895)
- reverter (32005)
- tageditor (31772)
- terracer (31895)
- turnlanes (31772)
- turnrestrictions (31895)
- undelete (31895)
- utilsplugin2 (32018)
- waydownloader (31772)
- wikipedia (32058)

comment:11 Changed 7 years ago by Klumbumbus

Owner: changed from anonymous to team
Status: needinfonew

comment:12 Changed 7 years ago by anonymous

I deleted mirrored_download.jar and restarted JOSM, but the problem still exists.

comment:13 Changed 7 years ago by anonymous

Now I tested with Kubuntu 15.10 (old system was Debian Jessie) and a completely new user account, which was never used before.
I did not install any JOSM plugins.
Problem still exists!

comment:14 Changed 7 years ago by anonymous

I found this in the source code:

            final Object result = ((Invocable) engine).invokeMethod(engine.get("global"),
                    "overpassWizard", search, new HashMap<String, Object>() { {
                        put("comment", false);
                        put("outputFormat", "xml");
                        put("outputMode", "recursive_meta");
                    } }
            );

https://github.com/openstreetmap/josm/blob/master/src/org/openstreetmap/josm/tools/OverpassTurboQueryWizard.java

comment is set to false and outputFormat is set to xml.
This is ok.
Is there something wrong with the build?

comment:15 Changed 7 years ago by anonymous

JOSM somehow uses the default values in my case (comment, geom, json):

var defaults={comment:true,outputMode:"geom",globalBbox:true,timeout:25,maxsize:undefined,outputFormat:"json"

https://github.com/openstreetmap/josm/blob/master/data/overpass-wizard.js

comment:16 Changed 7 years ago by anonymous

I found out how to reproduce this issue:
You need Java 7.

comment:17 Changed 7 years ago by Don-vip

Cc: simon04 added
Keywords: java7 added
Milestone: 16.02

OverpassTurboQueryWizardTest.testKeyValue fails (only with Java 7) likely for the same reason. I disabled the test in r9815 to avoid daily jenkins spam. It can be enabled again after this bug is fixed.

comment:18 in reply to:  16 Changed 7 years ago by Don-vip

Replying to anonymous:

You need Java 7.

That's exactly why there's a giant, yellow, flashy box in newreport asking to always add status report at ticket creation: it avoids spending a lot of time to guess your setup.

comment:19 Changed 7 years ago by simon04

Resolution: fixed
Status: newclosed

In 9856/josm:

fix #12547 see #12469 - Fix Overpass API "Build query" for Java 7

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.