>> I'm curious about your uses for this. In what kind of situation would >> somebody know a runway code but not what airport?
if you download OSM data (using the API) within a bounding box, you will get nodes, ways, and relations within that bounding box. One of the ways can be a runway. The airport node can be outside that bounding box. Now in order to know the airport name, the bounding box needs to padded up and the download API needs to be rerun. This is exactly what am doing right now. It's not bad either, because the second API call runs on my local OSM source which contains only the airports. I agree with your other notes. This is a very generic problem. Not sure how others have solved this issue with other entities you mentioned. Thanks Madhav -----Original Message----- From: Alan Millar [mailto:[email protected]] Sent: Tuesday, June 23, 2009 10:21 PM To: Madhav Vodnala Cc: [email protected] Subject: RE: [OSM-talk] how are runways related to an airport/aerodrome > All that runway 'way' XML contains is one tag > that says it's a runway. The problem is there is no easy way to > correlate a runway to its airport. This is a generalized problem that reaches far beyond just runways. For any given way (of any kind), how do you associate it or characterize it as belonging to a larger area? An airport is a larger area, even if it has only be marked as a node in OSM; that is just a shortcut placeholder for the area. You certainly could use a relation. That seems like a lot of work to me. I would suggest looking at the ways other people have done it for other entities in OSM. How do you know a bike trail belongs to a park? How do you know a street belongs to a town? How do you know a foot path belongs to a university campus? The simple answer for all of them is the geometry. Short of that, the "is_in" tag is the most common one in use for this sort of thing. But really, matching geometry will be the simplest. You will pretty much always find the aerodrome area or node within 0.0020 degrees lat/lon of the runway, and most often within 0.0012 degrees, based on my experience in looking at them in OSM. It's not a visual problem, it's a math problem, and it's already been solved by others. Sort by distance, it becomes quite obvious which airport the runway belongs to. You can google for the calculations; you don't need to understand them to paste them into your script. (I don't understand the math, but it still works great for me.) > For eg. Entering 30L in a search window should bring up "SJC" as > the result. Note there can be multiple runways named 30L. Multiple? You bet. You're going to have a dozen or more. There are only 18 number sets to work with, plus L or R and sometimes C. If the runway is correctly named, it will be "12R/30L". 12R will always be the same runway as 30L. If you search for "30", you're likely to get a hundred matches or more. I've drawn or verified runways on about 3000 airports so far, and I think there are about 5000 or more airports listed in the English wikipedia. That's going to be a long search list. I'm curious about your uses for this. In what kind of situation would somebody know a runway code but not what airport? Perhaps there is other information or other ways to solve the problem that could help. Good luck on the project! - Alan _______________________________________________ talk mailing list [email protected] http://lists.openstreetmap.org/listinfo/talk

