Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

python - downloading global OSM river names

I am Working on a project to download global river names from Open Street Map..

I am trying to decide whether it makes more sense to

  1. download global OSM files and query them locally or
  2. to script up a set of global queries (we just need the waterways).

Assuming we do option 1), we are trying to find the best way to do it.

Option 1A was to use our Overpass interfaces with our go-to languages (Matlab and Python), and both of those read entire OSM files into memory prior to querying (that’s how I read this anyway e.g. for Python: https://python-overpy.readthedocs.io/en/latest/api.html#overpy.Overpass.parse_xml).

Clearly, if the file is 100s of Gb in size, then it will be a challenge to read the entire thing into memory prior to performing queries, and will necessitate downloading a very large number of OSM files to make them small enough to load into memory. So option 1B is to set up a local OSM mirror (e.g. with OSM3S: https://wiki.openstreetmap.org/wiki/Overpass_API/Installation).

Before we invest the time in 1B, curious if you have any general comments or advice for us, and second if you can confirm that OSM3S will indeed query .osm (or better, either .pbf of .bz2) without reading the entire thing into memory first?

Or does anyone have other suggestions?? Using OSM 3S?

THANK YOU FOR THE HELP.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...