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.
Add this to your Gemfile or gems.rb:
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 the corresponding shorthand AIXM class method. The following two statements are identical:
AIXM::CLASSES for the complete list of shorthand names.
The schema is either
:aixm (default) or
AIXM.config.schema = :ofmx # =>:ofmx
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
In order to insert OFMX-compliant
mid attributes for all
*Uid elements, set this configuration option to the OFMX region the element belongs to. By default, no
mid attributes are inserted.
AIXM.config.mid_region # => nil - don't insert any mid attributes AIXM.config.mid_region = 'LF' # => 'LF' - insert mid attributes for region LF
In case you want to ignore certain XML schema validation errors, set this configuration option to a regular expression which matches the error messages to ignore. By default, no errors are ignored.
AIXM.config.ignored_errors = /invalid date/i
AIXM::Document#valid? validates the resulting AIXM or OFMX against its XML schema. If any, you find the errors in
- XY (longitude and latitude)
- Z (height, elevation or altitude)
- D (distance or length)
- F (frequency)
- A (angle)
- Navigational aid
- Obstacle and obstacle group
- Vertical limits
using AIXM::Refinements you get a few handy extensions to Ruby core classes.
Some tests are very time consuming and therefore skipped by default. To run the full test suite, set the environment variable:
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:
To contribute code, fork the project on Github, add your code and submit a pull request:
The gem is available as open source under the terms of the MIT License.