查找具有立交桥的区域的几何形状 API

Finding geometry of an area with overpass API

我试图从特定的纬度经度找到建筑物的几何形状。所以我的想法是使用坐标查询来获取经纬度所在的所有区域。使用 http://overpass.osm.rambler.ru/cgi/interpreter,我得到了所有区域,我可以过滤以仅获取建筑物节点。

现在我有一个区域,例如:

{ id: '2542062474',
    'addr:city': 'Nice',
    amenity: 'place_of_worship',
    building: 'yes',
    denomination: 'protestant',
    name: 'Église Protestante Unie de Nice Saint-Esprit',
    religion: 'christian',
    source: 'cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre. Mise à jour : 2011' }

我认为很容易得到这个区域的几何形状,但我找不到任何方法?我一定是遗漏了什么。

http://overpass-turbo.eu中,我输入脚本:

[out:json][timeout:25];
// gather results
(
  // query part for: “area”
  area(2542062474);
);
// print results
out body;
>;
out skel qt;

但结果不包括几何体。如何获取区域的几何形状?

谢谢!

这是我的脚本,目前:https://gist.github.com/ptbrowne/60d7338502de1d16ac46

Areas are an internal data type of Overpass. You can use pivot 获取几何:

[out:json][timeout:25];
area(2542062474);
way(pivot);
out body;
>;
out skel qt;

最后,我所做的是阅读更多的文档并找出与 area[=26= 关联的 way ], 我需要从区域 id.

中减去 2400000000

那我只能问路了。从区域 ID 2542062474,我减去 2400000000,我得到 142062474

[out:json][timeout:25];
way(142062474);
out body;
>;
out skel qt;

它有效,但我认为@Alex Morega 的 pivot 回答更好,因为 2400000000 可能有一天会改变。我不知道性能。