Git Product home page Git Product logo

airport-codes's People

Contributors

acckiygerman avatar anuveyatsu avatar bluechi avatar branko-dj avatar hackgoddevansh avatar henrykironde avatar mikanebu avatar monikappv avatar naeem-bebit avatar sanh2o avatar svetozarstojkovic avatar yannael avatar zelima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airport-codes's Issues

Some airports have incorrect ident, iata and local code

Some airports have incorrect ident, iata and local code :

To identify them , search for 'E+' in the file (probably due to an excel import and automatic conversion.). The original file from http://ourairports.com/data/ is correct though.

The airports are :
0.00E+00,small_airport,Corydon Airport,"-93.24130249, 40.75450134",1020,NA,US,US-IA,Corydon,0.00E+00,,0.00E+00
1.00E+02,small_airport,Terlingua Ranch Airport,"29.45019913, -103.3990021",3769,NA,US,US-TX,Alpine,1.00E+02,,1.00E+02
1.00E+04,small_airport,Palo Duro Airport,"35.14199829, -101.8379974",3639,NA,US,US-TX,Amarillo,1.00E+04,,1.00E+04
1.00E+06,small_airport,Elkins Field,"34.45780182, -78.61830139",93,NA,US,US-NC,Clarkton,1.00E+06,,2NR2
1.00E+07,small_airport,Buffalo Airport,"35.06499863, -101.8789978",3640,NA,US,US-TX,Amarillo,1.00E+07,,1.00E+07
1.00E+08,small_airport,Moores Airport,"44.38759995, -75.06629944",814,NA,US,US-NY,Degrasse,1.00E+08,,1.00E+08
1.00E+09,small_airport,Maples Field,"35.06529999, -101.9609985",3677,NA,US,US-TX,Canyon,1.00E+09,,1.00E+09

Code: Example Perl program to read the CSV

This can be included in the project's code base, if interest.

#!/usr/bin/perl                                                                                                                                                                                                                              
                                                                                                                                                                                                                                             
use warnings;                                                                                                                                                                                                                                
use strict;                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                             
use Text::CSV; # http://search.cpan.org/~ishigaki/Text-CSV-1.95/lib/Text/CSV.pm                                                                                                                                                              
use Carp;      # http://search.cpan.org/~rjbs/Carp-1.38/lib/Carp.pm                                                                                                                                                                          
                                                                                                                                                                                                                                             
my $airportsFile = 'airport-codes.csv';                                                                                                                                                                                                      
my $onlyIcao = 1;                                                                                                                                                                                                                            
my $quiet = 1;                                                                                                                                                                                                                               
                                                                                                                                                                                                                                             
# >>>>
my $airports = readAirports($airportsFile,$onlyIcao,$quiet);
# <<<<

if (! defined $airports) {
   print STDERR "No result obtained!\n";
}
else {
   for my $key (sort(keys(%$airports))) {
      my $val = $$airports{$key}; # this is a hashref
      print $$val{ident},"\n"; 
      for my $subkey (sort(keys(%$val))) {
         if ($subkey ne 'ident') {
            print sprintf("%15s = %s\n",$subkey,$$val{$subkey})
         }
      }
   }
}

# ===
# Read the CSV file of airport records.
# Returns a hashref if all went well, or undef if not!
# ===

sub readAirports {
   my($airportsFile,$onlyIcao,$quiet) = @_;
   my @rows;
   my $csv = Text::CSV->new ( { binary => 1 } ) or croak "Cannot use Text::CSV: " . Text::CSV->error_diag();
   my $fh;
   unless (open($fh, "<:encoding(utf8)", $airportsFile)) {
      print STDERR "Could not open file '$airportsFile': $!\n";
      return undef
   }
   print STDERR "Reading airport information from file '$airportsFile'...\n";
   my $count = -1;
   my $headers;
   my $airports = {};
   while (my $row = $csv->getline($fh)) {
      $count++;
      if ($count == 0) {
         # first entry consists of headers
         $headers = $row;
      }
      else {
         # transform record into a map of key -> value pairs
         my $airport = {};
         for my $header (@$headers) {
            $$airport{$header} = $$row[0];
            shift @$row;
         }
         my $ident = $$airport{ident}; # "ident" may or may not be ICAO code
         if ($onlyIcao && (!($ident =~ /^[A-Z]{4}$/) || $ident eq 'ZZZZ')) {
            print STDERR "Ident '$ident' is definitely not an ICAO code -- skipping\n" unless $quiet;
         }
         else {
            # retain
            croak "Clash on airport identifier '$ident'" if exists $$airports{$ident};
            my $name = $$airport{name};
            $$airports{$ident} = $airport;
         }
         if ($count % 5000 == 0) {
            print STDERR "$count airports read so far...\n"
         }
      }
   }
   $csv->eof or $csv->error_diag();
   close $fh or carp "Could not close file '$airportsFile: $!";
   print STDERR "$count airports read in total, " . scalar(keys %$airports) . " retained!\n";
   return $airports
}


Invalid geopoint type

Invalid geopoint type latitude should be between -90 and 90, found: -151.6959991

it's not a valid geopoint according to the specs:

Geopoint type is a string of the pattern "lon, lat"

In airport-codes.csv geopoint column has a "lat, lon" format which is in reverse order. So a latitude with a value -151.6959991 is invalid.
See the following issue in tableschema-js
frictionlessdata/tableschema-js#72

UnicodeEncodeError

Hi, running the airport_codes_flow.py script I got the following error
script_error
Any way to fix it?
Thanks

Spam in CSV

Spam entries somehow were injected into the current data/airport-codes.csv file. I verified this against the current version taken from https://github.com/datasets/airport-codes/blob/master/data/airport-codes.csv

See these three entries, though there may be others:

US-0878,small_airport,Buy Generic Cytotec Online Without A Prescription. Buy Cytotec Online 100 mg fast free delivery,,NA,US,US-NY,,,,,"3, 1"
US-0879,medium_airport,Buy Lyrica online (Pregabalin) 150mg capsules without prescription. Buy lyrica online.,,NA,US,US-U-A,,,,,"3.1666666666667, -1.1666666666667"
US-0880,medium_airport,"Buy Lyrica online. Discount Lyrica 75 mg online. Buy Lyricaa Uk, Canada, AUSTRALIA",0,NA,US,US-U-A,,,,,"-2.1666666666667, -2.1666666666667"

Most recent datahub.io published version has encoding errors in CSV

The most recent CSV file available on https://datahub.io/core/airport-codes (from ~6 months ago) has unicode encoding errors.

One example, from a diff of an older version to the latest one:

-MMCC,small_airport,Ciudad Acuña New International Airport,1410,NA,MX,MX-COA,Ciudad Acuña,MMCC,ACN,EFN,"29.332899, -101.098998"
+MMCC,small_airport,Ciudad Acuña New International Airport,1410,NA,MX,MX-COA,Ciudad Acuña,MMCC,ACN,EFN,"-101.098998, 29.332899"

Looks like the source input was treated as Latin-1 rather than UTF-8?

Data outdated

How is this data updated? The source site has many additions that this data set does not contain...

I did some work in a fork to update the data, but I'm not sure if there is another process for maintaining...

joelcollinsdc@f5908a6

Fix error in csv caused by Excel

Related: #9

No problem in the source http://ourairports.com/data/, but in http://data.okfn.org/data/core/airport-codes#data, some airports have a wrong identifier and iata code and local code.

I can propose a corrected file, but how can I do that ?
please help.

Where is the problem ?
Easy to identify, search for 'E+' in the file (probably due to an excel import and automatic conversion...) :
0.00E+00,small_airport,Corydon Airport,"-93.24130249, 40.75450134",1020,NA,US,US-IA,Corydon,0.00E+00,,0.00E+00
1.00E+02,small_airport,Terlingua Ranch Airport,"29.45019913, -103.3990021",3769,NA,US,US-TX,Alpine,1.00E+02,,1.00E+02
1.00E+04,small_airport,Palo Duro Airport,"35.14199829, -101.8379974",3639,NA,US,US-TX,Amarillo,1.00E+04,,1.00E+04
1.00E+06,small_airport,Elkins Field,"34.45780182, -78.61830139",93,NA,US,US-NC,Clarkton,1.00E+06,,2NR2
1.00E+07,small_airport,Buffalo Airport,"35.06499863, -101.8789978",3640,NA,US,US-TX,Amarillo,1.00E+07,,1.00E+07
1.00E+08,small_airport,Moores Airport,"44.38759995, -75.06629944",814,NA,US,US-NY,Degrasse,1.00E+08,,1.00E+08
1.00E+09,small_airport,Maples Field,"35.06529999, -101.9609985",3677,NA,US,US-TX,Canyon,1.00E+09,,1.00E+09

Geopoint type field has an invalid format.

Geopoint type supports in the followings formats:

  1. default. A string of the pattern “lon, lat”.
  2. array. An array of exactly two items
  3. object. A JSON object with exactly two keys, lat and lon.

Please, correct to the right format.

Update schema to be more restrictive

See: #11 (original: https://discuss.okfn.org/t/error-in-file-http-data-okfn-org-data-core-airport-codes-data/5734/2)

No problem in the source http://ourairports.com/data/, but in http://data.okfn.org/data/core/airport-codes#data, some airports have a wrong identifier and iata code and local code.

I can propose a corrected file, but how can I do that ?
please help.

Where is the problem ?
Easy to identify, search for 'E+' in the file (probably due to an excel import and automatic conversion...) :
0.00E+00,small_airport,Corydon Airport,"-93.24130249, 40.75450134",1020,NA,US,US-IA,Corydon,0.00E+00,,0.00E+00
1.00E+02,small_airport,Terlingua Ranch Airport,"29.45019913, -103.3990021",3769,NA,US,US-TX,Alpine,1.00E+02,,1.00E+02
1.00E+04,small_airport,Palo Duro Airport,"35.14199829, -101.8379974",3639,NA,US,US-TX,Amarillo,1.00E+04,,1.00E+04
1.00E+06,small_airport,Elkins Field,"34.45780182, -78.61830139",93,NA,US,US-NC,Clarkton,1.00E+06,,2NR2
1.00E+07,small_airport,Buffalo Airport,"35.06499863, -101.8789978",3640,NA,US,US-TX,Amarillo,1.00E+07,,1.00E+07
1.00E+08,small_airport,Moores Airport,"44.38759995, -75.06629944",814,NA,US,US-NY,Degrasse,1.00E+08,,1.00E+08
1.00E+09,small_airport,Maples Field,"35.06529999, -101.9609985",3677,NA,US,US-TX,Canyon,1.00E+09,,1.00E+09

[Feature Request] Other IACA Codes

It would be nice to also have the IACA codes for country and cities other than just airports. I am just going to extract this data from an API instead, but I think it would be a good addition for this. I can PR the information later when I get it extracted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.