Geo::ICAO - Airport and ICAO codes lookup
version 1.100140
use Geo::ICAO qw{ :all }; my @region_codes = all_region_codes(); my @region_names = all_region_names(); my $code = region2code('Canada'); my $region = code2region('C'); my @country_codes = all_country_codes(); my @country_names = all_country_names(); my @codes = country2code('Brazil'); my $region = code2country('SB'); my @airport_codes = all_airport_codes('B'); my @airport_names = all_airport_names('B'); my $code = airport2code('Lyon Bron Airport'); my $airport = code2airport('LFLY'); my ($airport, $location) = code2airport('LFLY'); # list context
The International Civil Aviation Organization (ICAO), a major agency of the United Nations, codifies the principles and techniques of international air navigation and fosters the planning and development of international air transport to ensure safe and orderly growth. Among the standards defined by ICAO is an airport code system (not to be confused with IATA airport codes), using 4-letter for this.
This module provides easy access to the list of airport ICAO codes, with mapping of those codes with airport names, country and region codes.
Nothing is exported by default, but all the functions described below are exportable: it's up to you to decide what you want to import. Export is done with Sub::Exporter, so you can play all kind of tricks.
Note that the keyword :all will import everything, and each category of function provides its own keyword. See below.
:all
The first letter of an ICAO code refer to the region of the airport. The region is quite loosely defined as per the ICAO. This set of functions allow retrieval and digging of the regions.
Note: you can import all those functions with the :region keyword.
:region
The first two letters of an ICAO code refer to the country of the airport. Once again, the rules are not really set in stone: some codes are shared by more than one country, some countries are defined more than once... and some countries (Canada, USA, Russia, Australia and China) are even coded on only one letter - ie, the country is the same as the region). This set of functions allow retrieval and digging of the countries.
Note: you can import all those functions with the :country keyword.
:country
This set of functions allow retrieval and digging of the airports, which are defined on 4 letters.
Note: you can import all those functions with the :airport keyword.
:airport
Return the list of all single letters defining an ICAO region. No parameter needed.
Return the list of all ICAO region names. No parameter needed.
Return the one-letter ICAO $code corresponding to $region. If the region does not exist, return undef.
$code
$region
Return the ICAO $region corresponding to $code. Note that $code can be a one-letter code (region), two-letters code (country) or a four- letters code (airport): in either case, the region will be returned.
Return undef if the associated region doesn't exist.
Return the list of all single- or double-letters defining an ICAO country. If a region $code is given, return only the country codes of this region. (Note: dies if $code isn't a valid ICAO region code).
Return the list of all ICAO country names. If a region $code is given, return only the country names of this region. (Note: dies if $code isn't a valid ICAO region code).
Return the list of ICAO codes corresponding to $country. It's a list since some countries have more than one code. Note that the codes can be single-letters (USA, etc.)
$country
Return the ICAO $country corresponding to $code. Note that $code can be a classic country code, or a four-letters code (airport): in either case, the region will be returned.
Return the list of all ICAO airport codes in the $code country ($code can also be a region code). Note that compared to the region or country equivalent, this function requires an argument. It will die otherwise (or if $code isn't a valid ICAO country or region code).
Return the list of all ICAO airport names in the $code country ($code can also be a region code). Note that compared to the region or country equivalent, this function requires an argument. It will die otherwise (or if $code isn't a valid ICAO country or region code).
Return the $code of the $airport, undef i no airport matched. Note that the string comparison is done on a case-insensitive basis.
$airport
Return the $airport name corresponding to $code. In list context, return both the airport name and its location (if known).
You can look for information on this module at:
Search CPAN
http://search.cpan.org/dist/Geo-ICAO
See open / report bugs
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Geo-ICAO
Git repository
http://github.com/jquelin/geo-icao
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Geo-ICA
CPAN Ratings
http://cpanratings.perl.org/d/Geo-ICAO
Jerome Quelin
This software is copyright (c) 2007 by Jerome Quelin.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Geo::ICAO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::ICAO
CPAN shell
perl -MCPAN -e shell install Geo::ICAO
For more information on module installation, please visit the detailed CPAN module installation guide.