Why not ask your question on the new OpenStreetMap Community Forum?

What I need to do is to get the bounding box polygon for all airports worldwide. The only way I'm aware of do this, is by using esy.osm.pbf. I've written the following code:

osm = esy.osm.pbf.File(file_path)
lat_lons = OrderedDict()
index = 0
print("There are " + str(len(airport.refs)) + " nodes to go through.")
for ref in airport.refs:
    index = index + 1
    nodes = [entry for entry in osm if entry.id == ref]
    lonlat = nodes[0].lonlat
    lat_lons[ref] = ([lonlat[1], lonlat[0]])
return lat_lons

But it takes much too long to do this, that's just for a single airport, and I need to do it for all airports worldwide. Is there a better way of fetching the latitudes and longitudes for the polygons for all airports worldwide?

asked 20 May '21, 17:52

michaelnares's gravatar image

accept rate: 0%

Nominatim can fetch bboxes. Old thread. You can test some limited areas and then build a batch or requests.

permanent link

answered 25 May '21, 09:11

Cascafico's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 20 May '21, 17:52

question was seen: 842 times

last updated: 25 May '21, 09:11

powered by OSQA