Version Continuous Integration Code Climate Gitter Donorbox

AIXM

Partial implementation of the Aeronautical Information Exchange Model (AIXM 4.5) and it's dialect Open FlightMaps eXchange format (OFMX 0) for Ruby.

For now, only the parts needed to automize the AIP import of Open Flightmaps are part of this gem. Most notably, the gem is only a builder for snapshot files and does not parse them.

Install

Add this to your Gemfile:

gem aixm

Usage

Here's how to build a document object, populate it with a simple feature and then render it as AIXM:

document = AIXM.document
document.features << AIXM.designated_point(
  id: "ABIXI",
  xy: AIXM.xy(lat: %q(46°31'54.3"N), long: %q(002°19'55.2"W)),
  type: :icao
)
document.aixm!   # not really necessary since AIXM is the default schema
document.to_xml

You can initialize all elements either traditionally or by use of shorter AIXM class methods. The following two statements are identical:

AIXM::Feature::NavigationalAid::DesignatedPoint.new(...)
AIXM.designated_point(...)

Configuration

The following configuration options are available for setting and getting:

AIXM.config.schema           # either :aixm (default) or :ofmx
AIXM.config.region           # fallback region
AIXM.config.ignored_errors   # ignore XML schema errors which match this regex

There are shortcuts to set and get the schema:

AIXM.schema             # => :aixm
AIXM.aixm?              # => true
AIXM.ofmx!              # => :ofmx
AIXM.ofmx?              # => true
AIXM.schema             # => :ofmx
AIXM.schema(:version)   # => 0

Validation

AIXM::Document#valid? validates the resulting AIXM or OFMX against its XML schema. If any, you find the errors in AIXM::Document#errors.

Model

Fundamentals

Features

Components

Refinements

By using AIXM::Refinements you get a few handy extensions to Ruby core classes.

References

AIXM

OFMX

Tests

Some tests are very time consuming and therefore skipped by default. To run the full test suite, set the environment variable:

export SPEC_SCOPE=all

Development

To install the development dependencies and then run the test suite:

bundle install
bundle exec rake    # run tests once
bundle exec guard   # run tests whenever files are modified

Please submit issues on:

https://github.com/svoop/aixm/issues

To contribute code, fork the project on Github, add your code and submit a pull request:

https://help.github.com/articles/fork-a-repo

License

The gem is available as open source under the terms of the MIT License.