Nominatim 为同一请求检索不同的数据
Nominatim retrieving different data for the same request
我正在使用 Nominatim API 获取项目的一些当地街道的边界框和多边形点。
我发现的一个问题是,当我在网络浏览器上请求 URL 时,例如:
它检索这个边界框:
["32.6474594","32.64779","-16.8998967","-16.8993021"]
["32.6469257","32.6470059","-16.8981943","-16.8974107"]
["32.6478793","32.6478838","-16.9007069","-16.9005973"]
["32.6478902","32.647988","-16.9014895","-16.9007494"]
但是当我对使用 Node.js 应用程序的请求使用相同的 URL 时:
var request = require('request');
var url = encodeURI("http://nominatim.openstreetmap.org/search?" +
"q=Rua de Santa Maria,Madeira&format=json&polygon=1&addressdetails=1");
request({url: url, json: true}, function (err, res, json){
console.log(json);
});
它检索:
["32.6470059","32.647067","-16.8984633","-16.8981943"]
["32.6469257","32.6470059","-16.8981943","-16.8974107"]
["32.6480316","32.6480782","-16.9021559","-16.901742"]
["32.6478793","32.6478838","-16.9007069","-16.9005973"]
略有不同。检索到的多边形点也不同。有人知道为什么会这样吗?
请求很可能不一样。您的浏览器会在其请求 headers 中发送其他信息,例如首选语言。这些附加信息似乎会影响搜索结果。
我正在使用 Nominatim API 获取项目的一些当地街道的边界框和多边形点。
我发现的一个问题是,当我在网络浏览器上请求 URL 时,例如:
它检索这个边界框:
["32.6474594","32.64779","-16.8998967","-16.8993021"]
["32.6469257","32.6470059","-16.8981943","-16.8974107"]
["32.6478793","32.6478838","-16.9007069","-16.9005973"]
["32.6478902","32.647988","-16.9014895","-16.9007494"]
但是当我对使用 Node.js 应用程序的请求使用相同的 URL 时:
var request = require('request');
var url = encodeURI("http://nominatim.openstreetmap.org/search?" +
"q=Rua de Santa Maria,Madeira&format=json&polygon=1&addressdetails=1");
request({url: url, json: true}, function (err, res, json){
console.log(json);
});
它检索:
["32.6470059","32.647067","-16.8984633","-16.8981943"]
["32.6469257","32.6470059","-16.8981943","-16.8974107"]
["32.6480316","32.6480782","-16.9021559","-16.901742"]
["32.6478793","32.6478838","-16.9007069","-16.9005973"]
略有不同。检索到的多边形点也不同。有人知道为什么会这样吗?
请求很可能不一样。您的浏览器会在其请求 headers 中发送其他信息,例如首选语言。这些附加信息似乎会影响搜索结果。