2

I use following code for a OpenStreetMap-query (overpass-API). It works fine on smaller querys but on a bigger one, which takes around 10 min, it generates only a 504 gateway timeout response.

code:

var reqStr = "http://overpass.osm.rambler.ru/cgi/interpreter?data=...

console.time("query");
var stream = request(reqStr,{timeout: 3600000}).on('error', function(err) {
    console.log(err)
}).pipe(fs.createWriteStream('resultExport.json'));
stream.on('finish', function () {
    console.timeEnd("query");
});

response (resultExport.json):

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>504 Gateway Time-out</title>
</head><body>
<h1>Gateway Time-out</h1>
<p>The gateway did not receive a timely response
from the upstream server or application.</p>
</body></html>

The query command has a [timeout:3600] (seconds) and the request got {timeout: 3600000} (milliseconds). What else can i do prevent the timeout and get a proper response? I am a bit confused where this is coming from.

4

1 回答 1

2

这是一个已知问题,尚未在 Overpass API 服务器上解决/修复。

有关详细信息,请参阅此 Github 问题:https ://github.com/drolbr/Overpass-API/issues/220

于 2016-04-21T08:28:47.910 回答