You can now purchase a copy: here!
I guess we can call this part two of the global connectivity by flight experiment, which I have been working on the past couple of days. Once again, the data comes from openflights.org/data.html and is available for free to the public. It is a very detailed set of data that requires just a little bit of massaging to be usable in a desktop work environment. In this blog post I would like to take you through some quick helpful tips that should get you from downloading the data and cleaning it up to mapping it in ArcMap. In all honesty, I would have loved to completed this process in entirely open source applications but I had to resort to ArcMap’s “XY to Line” tool. I wish I could have replicated the result I’ve achieved using QGIS but alas, I am more familiar with ArcMap’s geoprocessing capabilities and so I fall back to my student licensed Arc product when I need to.
Fifty-eight thousand, two-hundred and eighty-eight flight routes
Yup! 58,288 flight routes… 1 Earth. If that’s not an impressive number I’m not sure what is! The number is almost as impressive as the map created by connecting all of the flight origins and destinations:
Without a basemap of the continents, we can clearly make out the shape of many major regions of the world. Also note that we can identify many unique spatial patterns of settlement and urbanization. Flights that leave or arrive in South America, Africa or Australia generally tend to fly to/from the coast. This is very reflective of the settlement patterns in these regions. The United States has flights arriving and departing all over the country, where as Canada has most flights located along the southern Canada-USA border (with a few continental flights travelling into the North). We can see that Australia has major urban centres spread out over its large land mass and that continental flights are very popular in Australia, connecting almost every coastal region to each other with very few flights landing in central Australia (what would be the point, right?).
We could talk about how flight routes reflect the settlement patterns all day but then I would never get to showing you how to make a map similar to this!
I will assume you have the following two applications installed on your computer:
- ArcMap 9.3x+ or 10.x+
- OpenOffice.org (OOo) or your favourite spreadsheet editor
Let's get started!
- download both airports.dat and routes.dat from openflights.org/data.html
- change the extension from ‘.dat’ to ‘.csv’ on both files
- create a new spreadsheet in OOo with two sheets/tabs
- open airports.csv, copy and paste the data into sheet 1
- re-name sheet 1 to airports
- open routes.csv and paste the data into sheet 2
- re-name sheet 2 to routes
Now to clean up the data:
- in sheet.airports: delete all columns BUT those containing the 3-letter IATA/FAA codes or 4-letter ICAO codes & latitude and longitude (columns 5–8)
- in sheet.routes: delete all columns BUT those containing origin and destination airport codes (columns 3 and 5)
- insert a new row above all existing data and input appropriate field names. ie sheet.airports{IATA_FAA, ICAO, Lat, Long}, sheet.routes{Orig, Dest}
Querying Route Origin and Destination XY Coordinates
What we are going to do is query sheet.airports from sheet.routes to obtain latitude and longitude values for each origin and destination of every route (wow, mouthful).
Working in sheet.routes:
- create 4 column field names {Orig_Lat, Orig_Long, Dest_Lat, Dest_Long} *should be cells C1:F:1*
- in cell C2, insert function:
=VLOOKUP($A2;airports.$A$2:$D$6630;3;0)
- ‘fill’ the equation down the table by double-clicking in the bottom right hand of the cell
- in cell D2, insert function:
=VLOOKUP($A2;airports.$A$2:$D$6630;4;0)
- ‘fill’ the equation down
- in cell E2, insert function:
=VLOOKUP($B2;airports.$A$2:$D$6630;3;0)
- ‘fill’ the equation down
- in cell F2, insert function:
=VLOOKUP($B2;airports.$A$2:$D$6630;4;0)
- ‘fill’ the equation down
The function VLOOKUP, allows us to ‘lookup’ cell values in arrays located inside your spreadsheet. In words =VLOOKUP($A2;aiports.$A$2:$D$6630;3;0)
means, identify the value in cell A2 and locate it in sheet.aiports within the array A2:D6630. If found, the expression returns the value located in the 3rd column (column C; where column 1 = A; the first column in your array). What we are attempting to do is locate the route origin code in A2 and find it in sheet.aiports array A2:D6630. If it finds a match, it will take the value located in the same row albeit the 3rd column over as the expressions value. A slight modification to the function is needed to calculate the latitude of route origins and lat/long of route destinations.
More info on VLOOKUP here.
Note:
There a few things we must do to combat a few issues that may arise later on when we begin geoprocessing. There are approx 500 entries which returned no lat/long values for route origin, destination or both. These need to be deleted before geoprocessing so go ahead and sort your columns numerically, find those #N/A entries and delete the entire row. Also, we will have some difficulty geoprocessing 58K entries at once, so its best we split up our table into 6 separate tables. I split my table up into 10,000 entry chunks. Make sure when you do this that you don’t leave the field headings (row 1) out by accident on each subsequent table! Saving the tables as .csv allows us to open them up in ArcMap and perform geoprocessing operations on them.
In ArcMap:
- create a new filegeodatabase and name it appropriately (I’ll call it openflights)
- add all 6 tables to a new project
- search for the tool “XY to Line”, located in the data management toolbox, open it up and fill it out like so:
- input table > table 1
- output file > ‘openflights.gdb/routes_1’
- Start X > Orig_Long
- Start Y > Orig_Lat
- End X > Dest_Long
- End Y > Dest_Lat
- Method > Great Circle
- Rinse and repeat for all 6 tables
- Using the ‘Merge’ tool located in the analysis toolbox, merge all 6 route polyline shapefiles
- input files > routes_1 to routes_6
- field map > right-click on ‘shape length’ > merge rule > join
- output file > ‘openflights.gdb/routes_merged’
With all that said and done, you should have a flight route network of 58 thousand polylines! Fiddle around with the symbology and have some fun producing an eye-catching map!
Cheers!
You can now purchase a copy: here!
If this post helped you and you enjoy my site I would happily accept Litecoin donations:
LKPfT772e9HxvXYcA8LVDctTmENoqQxQF3
Hey,
Nice post. Thanks for linking to the original data. I’m looking forward to exploring it.
While you link to the data works for the part 1 post, the link above is broken.
Regards,
Cyrille
Thanks Cyrille!
~ fixed the link
Howdy! This article could not be written any better! Looking at this post reminds me of my previous roommate! He constantly kept preaching about this. I’ll send this information to him. Fairly certain he’s going to have a good read. Thanks for sharing! kcbeeeaekeea
[…] out the update to this post here! Related Posts!4 Sep ’11 — Global Connectivity Revisited; mapping out 58,288 flight […]
Hi Michael,
Thank you to post this kind of tutorials.
I’m just starting with the whole GIS thing, so as a newbie I have some questions:
Can this be done using QGis?
if yes, Could you please take the time to make a version of this tutorial using QGis?
It is valid to use just some of the flights? for example, if I’m only interested in the flights from Venezuela to Cuba, how do I can use only that data to make the map?
Thanks in advance and sorry for bother you with this newbie questions.
Many
Hey Manuel,
Unfortunately, I don’t have a method for completing this in QGIS. I am not familiar with an equivalent QGIS tool for ArcGIS ‘xy to line’. But I can however direct you to this discussion which talks about mapping flight routes using a combination of QGIS and a PostGIS database http://underdark.wordpress.com/2011/08/20/visualizing-global-connections/
Cheers,
Michael
Manuel,
A follow up…
A combination of QGIS and GRASS will allow you to convert xy coordinates to line features. Take a look at this wiki page. http://grass.osgeo.org/wiki/Convert_points_to_lines
Hi Michael,
Thanks for sharing.
Chris
Hi Michael,
I really love this visualisation. It is possible you could post a much higher resolution version of it as I would love to print it out on a really big piece of paper (to stick on my wall for personal use).
Thanks
–Mike
Michael,
This is beautiful! Thanks so much for sharing your methodology and giving folks the opportunity to explore the tools.
I agree with “mike” above. Can you please post a link to download a higher resolution photo — I would LOVE to hang this on a wall, what a fantastic conversation piece!
Best,
Rachel
[…] […]
Hi Michael,
Absolutely stunning images… Like many of the people who have posted before me, I would love to print this as a canvas in my house, would you be able to upload a high resolution version?
Thanks
[…] Either that or a glowing Lite-Brite box. But instead of a toy the whole family can enjoy, this map shows which international cities will be destroyed in the coming zombie […]
[…] from the OpenFlights airport and airline route databases in September 2011 for his personal blog at http://www.spatialanalysis.ca/2011/global-connectivity-mapping-out-flight-routes/. On his parttime position with global transportation planning and engineering firm Arup’s […]
[…] of this information and turned it into the these fascinating images, you can check out his blog: Spatial Analysis. Michael has also crunched the numbers in a variety of other areas and spit them out into something […]
No ESRI s/w required.
http://en.wikipedia.org/wiki/Well-known_text
Add an index column for the rows.
example w/ lon,lat point pairs
row 1: oid;line
rows 2 through n: =CONCATENATE($J2,”;”,“LINESTRING(“,$L2,” “,$K2,”, “,$N2,” “,$M2,”)”)
import into qgis “Create a Layer from a Delimited Text File” (WKT pull-down, line as WKT field)
oid;line
1;LINESTRING(39.956589 43.449928, 37.906111 55.408611)
2;LINESTRING(48.006278 46.283333, 30.262503 59.800292)
3;LINESTRING(61.503333 55.305836, 37.906111 55.408611)
…
[…] Via Spatial Analysis. […]
[…] the land masses. More Images can be found at BBC News or visit Michael’s site at www.spatialanalysis.ca instructions on creating your own […]
michael,
thanks for the tutorial! when you’re merging the xy files, I don’t seem to have Join on the list of Merge Rules for Shape Length. Should I change the Field Type to Text?
Thanks!
Hey divesh,
What version of ArcMap are you using? Also, can you try using Merge without any join rules? I have a feeling it will still work.
Can you share what symbology settings you used in ArcGIS to get the final effect? Thanks
Hi Michael,
Any chance you could send me a high resolution version of this map? Would love to put it on my wall.
Thanks,
Paul
[…] Global Connectivity Revisited: mapping out 58,288 flight routes by Michael Markieta aka (@MichaelMarkieta) […]
You can actually play around with these routes and explore direct flights between countries, airports, and the world on this interactive map
[…] Air Travel Routes: Frequency in Popular Air Travel Routes: 58,288 Flight Routes: Spatial Analysis Global Connectivity Revisited; mapping out 58,288 flight routes | Spatial Analysis A Spatial Analysis Map Showing All of the Flight Origins and Destinations. This phenomenal map […]
It would be totally cool to display this same data in a Fuller projection (Dymaxion Map):
http://basementgeographer.com/wp-content/uploads/2013/05/uapoK.jpg
Fantastic idea! Any idea how in ArcMap, or QGIS?
Thanks so much for all of this, it’s great. Is there anyway to do this in ArcMap 9.2?
Heya,
Wow! This is exactly what i am looking for. Is there a way to export the data into vector information for design software such as Adobe Illustrator? Say EPS, vector PDF or .ai formats? I want to use this in a design but want to play with the colours and need to know if it is worth taking the plunge and figuring out ArcGIS etc.
If you can export this data, instead of me recreating it as I am more interested in the vector rather then learning GIS, maybe you could send me these files? I would be very thankful!
Thanks!
Joe
You need to be able to touch the ground with
the balls of your feet. A bike’s engine and motorcycle exhaust pipes caan get seriously hot
and that can seriously wound riders. Danny Eslick takes
the llead in thhe final lap at Roadd Atlanta.
Feel free to surf to my websie ????? ???? ?? ??????? ??????? ?????????
The ‘Valentine’s Day’ darling stepped out with gorgeous Veronica Lake wavges and
matchong coral lipstick. So it makes sense tto understand yoour colleagues annd clients almost as welol as
you understand the moods and attitudes of your friends and family.
What does it take tto become the FHM sexiest woman in the world.
Feel free to visit my page: fm 2013 hack
Thhank you for some other informative blog.
Where elsee could I am getting that type of info written in such
a perfect approach? I’ve a undertaking that I amm simply now operating on, and I have been
at the glance oout for such info.
Thanks for finally writing about > Global Connectivity Revisited;
mapping out 58,288 flight routes | Spatial Analysis < Loved it!
You could certainly see your skills in the article you
write. The sector hopes for more passionate writers like you who are not afraid to say how they believe.
Always go after your heart.
my homepage — Toronto ON basement leaks at floor
I was seeing a lot more than 500 #N/A values when I processed the data in excel. As a result, after deleting all null and #N/A values I only batched maybe.…8000 different routes total. I’m not sure if it’s worth pursuing further; if this is an indication that perhaps I’m doing something wrong, or that the data has changed over the past few years, but either way, this may be more effort than it’s worth. If I am doing something wrong, please let me know — I’m suspicious that it may be on my end of things.
A much easier method (perhaps due to the age of this tutorial) is to go into openflights and download the routes.dat file directly and relabel as a .csv file, then upload into ArcMaps.
Fabulous work! I would like to know if I can be provided with a source JPEG file? I wanted to print this map on canvas.
Or would I have to reproduce?
Thank you,
DOM
[…] that seem remote in the daily news are much less so on a map of global flight paths. Parts of the world that feel disconnected from us — by politics, by war, by sheer distance — […]