NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the 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:
    print(str(index))
    index = index + 1
    nodes = [entry for entry in osm if entry.id == ref]
    lonlat = nodes[0].lonlat
    print(lonlat)
    print(type(lonlat[1]))
    print(type(lonlat[0]))
    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

michaelnares
11112
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

Cascafico
283202329
accept rate: 0%

Follow this question

By Email:

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

By RSS:

Answers

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:

×92
×78

question asked: 20 May '21, 17:52

question was seen: 1,250 times

last updated: 25 May '21, 09:11

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum