1

I looked at the information given regarding airports and have downloaded that data into a CSV file for import.

I have created a shapefile for my base map using OSM.

How do I import the airport data (a lot of airports and most of them I have not been to yet) and use that data to toggle the airports on and off?

I know there are websites that offer this service, but I am trying to keep it somewhat private.

1
  • It would help if you showed us the CSV data, or where exactly you got it from, and if you have managed to load the airport points into QGIS. Does it have lat-long columns?
    – Spacedman
    Commented Sep 17, 2023 at 20:53

2 Answers 2

2

If I understand correctly: you have a CSV of all airports, including the lat-long coordinate. You can load this into QGIS as a "delimited text layer" and map it.

Maybe then best to "save as" the "delimited text layer" as a proper spatial data file - save it as a GeoPackage, then reload and you don't need the CSV any more.

Then you need to enable edits on it and add a new column, called something like "visited", and set this to True for all airports you've been to. Save your edits.

Then you use QGIS' layer styling to show visited airports with a red dot (or whatever) and non-visited airports with no symbol. You could do this by using a categorical symbol in the symbology dialog. You could also do this with a "Filter" on the layer.

Problems might occur if, for example, new airports appear and are added to the CSV from the "ourairports" source. It might be better then for you to create a non-spatial layer of just the airport codes you've visited, and then use that to select from the layer of all airports - but this requires a bit of database manipulation knowledge. I could set this up as a QGIS project if I had a bit more time...

1
  • I downloaded the aircraft.csv from ourairports.com/data removed all but the following:IATA_Code Name Latitude_deg Longitude_deg Elevation_ft Continent ISO_Country ISO_Region Municipality GPS_Code Wikipedia_link. I removed all airports without an IATA code as well. I added the delimited text layer and all the airports show up. Where I am stuck is the toggle on/off. Are you saying to Visited column in the csv?
    – Jamie
    Commented Sep 17, 2023 at 22:43
1

To add to the excellent answer of @Spacedman (create a visited column as boolean (true/false) in your dataset):

If you wanted you could also create an integer (whole number) field named "times visited" or a date field named "last visit" on your layer and then create an appropriate symbology. I generally find it best to store the most detailed information in case I want to do more detailed analysis later. Maybe sometime in the future you want to create a map of the airports you last visited in 1999? Or the airports colored by year of last visit? Or all airports you visited in the last 5 years as red dots and all others as gray dots?

If you really want detailed data then create one entry per visit (instead of one per airport) and log detailed information per visit - anything you may want to visualize: weather conditions, time of day, airplane you used, co-pilots, ...).

You can not edit CSV layers directly in QGIS, so you need to save your CSV to a different format (Shapefile or SpatiaLite) and then add the fields there. To do so, right click the layer in the layer tree, choose "export".

3
  • Being new, add the column in the csv or in the layer? Trying to understand the terminology. Sometimes there will be multiple visits to an airport, so maybe ad a date field?
    – Jamie
    Commented Sep 17, 2023 at 22:49
  • Sorry, my bad! I mean fields not layers. Edited.
    – til_b
    Commented Sep 17, 2023 at 23:13
  • I started a new project, added the delimited text layers with all the airports, opened attribute table. There isn't a place to edit the attributes to add the Visited column. Am I in the incorrect location? thank you
    – Jamie
    Commented Sep 17, 2023 at 23:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.