NAME
Geo::ICAO - Airport and ICAO codes lookup
SYNOPSIS
use Geo::ICAO qw[ :all ];
my @region_codes = all_region_codes();
my @region_names = all_region_names();
my $code = region2code('Canada');
my $region = code2region('K');
my @country_codes = all_country_codes();
my @country_names = all_country_names();
EXPORT
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.
Note that the keyword :all
will import everything, and each category of function provides its own keyword.
FUNCTIONS
Regions
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.
- . my @codes = all_region_codes()
-
Return the list of all single letters defining an ICAO region. No parameter needed.
- . my @regions = all_region_names()
-
Return the list of all ICAO region names. No parameter needed.
- . my $code = region2code( $region )
-
Return the one-letter ICAO
$code
corresponding to$region
. If the region does not exist, return undef. - . my $region = code2region( $code )
-
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.
Countries
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.
- . my @codes = all_country_codes( [$code] )
-
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). - . my @countries = all_country_names( [$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).
BUGS
Please report any bugs or feature requests to < bug-geo-icao at rt.cpan.org>
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geo-ICAO. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SEE ALSO
Geo::ICAO
development takes place on http://geo-icao.googlecode.com - feel free to join us.
You can also look for information on this module at:
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
RT: CPAN's request tracker
AUTHOR
Jerome Quelin, <jquelin at cpan.org>
COPYRIGHT & LICENSE
Copyright (c) 2007 Jerome Quelin, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.