2

我想在本地运行 Overpass API,而不需要在树莓派零 w 上访问互联网。

API 安装的解决方案不适合,因为它需要至少 1 GB RAM https://wiki.openstreetmap.org/wiki/Overpass_API/Installation

我如何在本地进行查询,这将只在一个城市。有没有从 OSM 文件或 XML 文件查询的解决方案?

QL 用于我的目的:

node(around:300,35.7576,51.4100)[amenity];
(._;>;);
out body;
4

2 回答 2

2

You cannot use the standard installation procedure, as even compiling will most likely produce code that crashes later on. Same applies to loading the data.

I put together a comprehensive guide for Raspberry PI 2, which you could use as a baseline: https://wiki.openstreetmap.org/wiki/User:Mmd/Overpass_API/Raspberry

You should use the source code http://dev.overpass-api.de/releases/osm-3s_v0.7.55.tar.gz as mentioned in the official guide. Also, be sure to change the configure options to

./configure CXXFLAGS="-Og -g -fno-omit-frame-pointer -march=native"

otherwise you will get random segmentation faults later on due to unaligned memory accesses (!).

For the update_database command, it's essential to limit the memory consumption by using --flush-size=1, otherwise this process will consume too much memory and will crash.

512MB is really a very limited amount of memory, it might still not be enough in your case.

于 2019-03-26T11:59:32.147 回答
0

如果您打算只将一个城市导入数据库,那么您可能会使用不到 1 GB 的 RAM。去尝试一下。但是,预计查询会很慢。

针对 OSM XML 或 PBF 文件的查询将不起作用。这些原始数据需要首先得到处理。

于 2019-03-26T09:17:25.857 回答