The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Geo::IATA - Search airports by iata, icao codes

VERSION

This document describes Geo::IATA version 0.0.3

Airport codes where taken from wikipedia 2009-06-20. http://en.wikipedia.org/wiki/List_of_airports_by_IATA_code

SYNOPSIS

    use Geo::IATA;
    $g = Geo::IATA->new;
    
    print $g->icao2iata("EDDB");          # SXF
    print $g->iata2icao("SXF");           # EDDB
    print $g->iata2airport("SXF");        # Berlin-Schönefeld International Airport
    print $g->iata("SXF")->[0]{airport};  # same but with full resultset

    print map{$_->{airport}} @{$g->airport("A%")}; # all airport names starting with A

    print $g->icao("EDDB")->[0]{iata};    # SXF

    print map {$_->{iata} } @{$g->location("%France")};  # iata code for french airports
  
  

DESCRIPTION

This module provides a SQLite DB for airport data. Searchable information are IATA,ICAO data airport name and location.

INTERFACE

Geo::IATA is a pure oo module.

new

Constructor. A connection to internal SQLite DB is opened. You can optional specify the path to the sqlite database. The sqlite db default location is dirname($INC{Geo/IATA.pm})/IATA/iata_sqlite.db

dbh

Gets the dbh to internal sqlite database.

iata

icao

airport

location

Input: iata, icao code, airport name or location. May use SQL wildcards.

Returns an arrayref of hashrefs of all matched rows for the query

select * from table where <field> like <arg>

[{iata => IATA,icao => ICAO, airport => AIRPORT,location => LOCATION}]

(iata|icao|airport|location)2(iata|icao|airport|location)

Simple from2to mapping methods. On multiple matches the first one is taken. Warning some iata codes have no mapping to icao code in wikipedia.

AUTOLOAD

The module uses AUTOLOAD to call above queries.

DESTROY

Closes internal dbi connection to sqlite db.

UPDATE AIRPORT CODES

You can manually update the airport codes from wikipedia with the script

create/iata_wikipedia.pl

BUGS AND LIMITATIONS

Please report any bugs or feature requests to bug-geo-iata@rt.cpan.org, or through the web interface at http://rt.cpan.org.

SEE ALSO

GEO::ICOA # somehow slow, handles only icoa codes http://www.nagilum.net/irssi-iata/ # embedded in irssi

AUTHOR

Joerg Meltzer <joerg <at> joergmeltzer.de>

LICENCE AND COPYRIGHT

Copyright (c) 2009, Joerg Meltzer <joerg <at> joergmeltzer.de>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

Airport data is provided by wikipedia. http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 114:

Non-ASCII character seen before =encoding in 'Berlin-Schönefeld'. Assuming CP1252