drolbr / Overpass-API

A database engine to query the OpenStreetMap data.
http://overpass-api.de
GNU Affero General Public License v3.0
690 stars 90 forks source link

Overpass API default output format #713

Closed stalkerGH closed 6 months ago

stalkerGH commented 6 months ago

Maybe here I will find someone to answer my question...

I installed local Overpass API from Docker container. Everything works, server is accepting queries and is giving valid answers.

My local Overpass server gives responses in JSON format (Content-Type: application/json) but (probably) package expects them in OSM XML (Content-Type: application/osm3s+xml).

I see in my logs during making test query:

172.17.0.1 - - [13/Dec/2023:10:23:18 +0000] "POST /api/interpreter HTTP/1.1" 200 308 "-" "curl/7.81.0"
127.0.0.1 - - [13/Dec/2023:10:23:26 +0000] "GET /api/interpreter?data=[out:json];node(1);out; HTTP/1.1" 200 658 "-" "curl/7.74.0" 

"Asking" (from terminal) curl version is 7.81.0, "responding" curl (from Overpass API Docker container) is 7.74.0.

How can I force Overpass API server to give replies in osm3s+xml format? Which config files should I check? I have problems with some R packages to draw maps and have to eliminate every possible reason.

drolbr commented 6 months ago

Change [out:json]; to [out:xml]; (or leave it out entirely). With [out:json] in your request you are asking explicitly for JSON.

stalkerGH commented 6 months ago

@drolbr Thank you for reply. I wrote it too general. The thing is that my Overpass server in "idle mode" (waiting for a query) periodically shows messages like in the first post. From this I conclude that it also gives answers in JSON. I would like them to be in OSM3S+XML by default, but I don't know which configuration file I should check/change this in. The problem is that I don't use curl or any other simple mechanism directly, but rather packages of the R language, which I know at a very basic level. Queries to the remote Overpass server go out and are received correctly, but to my local server with errors. Since various tests show that the Overpass server itself is working properly, I am looking for a way to change the output data format.