Developing an Open Source AIXM 5 Java Library
Developing an Open Source AIXM 5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD March 19, 2008 © 2008 The MITRE Corporation. All rights reserved.
Overview • Background – Tools – Data sources • Open source project – Goals – Technology – Challenges – Status – Using the library • Demo 2 © 2008 The MITRE Corporation. All rights reserved.
MITRE/CAASD Background • The MITRE Corporation – Private, independent, not-for-profit organization – Chartered to work in the public interest • CAASD – Federally Funded Research & Development Center (FFRDC) operated by MITRE – Provides systems research and development for the Federal Aviation Administration (FAA) and international civil aviation authorities 3 © 2008 The MITRE Corporation. All rights reserved.
CAASD Developed Tools • Procedure design, flyability, simulation, visualization TARGETS 4 • ILS approach/airport safety analysis, CRM Safety Assessment Toolset © 2008 The MITRE Corporation. All rights reserved.
Data Sources • • • National Flight Data Center (NFDC/NASR) AVN Information Services (AVNIS) Jeppesen National Aeronautical Charting Office (NACO) Digital Aeronautical Flight Information File (DAFIF) • Digital Obstacle File (DOF) • Elevation Data (DEM, DTED, etc) 5 © 2008 The MITRE Corporation. All rights reserved.
Goals • Develop AIXM 5 Java library that is: – Independent – Easy to use – Well documented – Extensible – AIXM 5 compliant • Enable applications to read/write AIXM 5 data • Handle large data sets 6 © 2008 The MITRE Corporation. All rights reserved.
Technology • Sun JDK (5 or greater) – Enum, generics, enhanced for loop, etc. • Dom 4 j – Library for using XML, XPath (jaxen) and XSLT – Full support for DOM, SAX and JAXP – Easy, fast, open source • Why not use JAXB or XMLBeans? – In early versions, not all AIXM 5 schema elements and attributes were supported – Auto-generated code may be hard to work with – Other attempts have been made 7 © 2008 The MITRE Corporation. All rights reserved.
Challenges • Understanding the model • Model is still changing • Sample XML is limited • Implementing GML 8 © 2008 The MITRE Corporation. All rights reserved.
Status • Features – Airport. Heliport – Runway – Navaid – Designated Point – Vertical Structure – STAR/SID – Basic Message – GML Point and Valid. Time <aixm: Vertical. Structure xmlns: aixm="http: //www. aixm. aero/schema/5. 0" gml: id="19608436"> <aixm: time. Slice> <aixm: Vertical. Structure. Time. Slice gml: id="26795951"> <aixm: name>TEST OBSTACLE</aixm: name> <aixm: type>POLE</aixm: type> <aixm: construction. Status>COMPLETED</aixm: construction. Status> <aixm: material>STEEL</aixm: material> <aixm: marking. Pattern>STEEL</aixm: marking. Pattern> <aixm: marking. First. Colour>RED</aixm: marking. First. Colour> <aixm: marking. Second. Colour>BLACK</aixm: marking. Second. Colour> <aixm: marking. ICAOStandard>YES</aixm: marking. ICAOStandard> <aixm: group>NO</aixm: group> <aixm: is. Made. Of> <aixm: Vertical. Structure. Part gml: id="25276323"> <aixm: vertical. Extent uom="FT">500. 0</aixm: vertical. Extent> <aixm: vertical. Extent. Accuracy uom="FT">10. 0</aixm: vertical. Extent. Accuracy> <aixm: has. Point. Shape> <aixm: Elevated. Point gml: id="20051738"> <gml: pos>70. 0 -122. 0</gml: pos> <aixm: elevation uom="FT">1500. 0</aixm: elevation> <aixm: geoid. Undulation uom="M">212. 0</aixm: geoid. Undulation> <aixm: vertical. Datum>EGM 96</aixm: vertical. Datum> <aixm: horizontal. Accuracy uom="M">15. 0</aixm: horizontal. Accuracy> <aixm: vertical. Accuracy uom="M">10. 0</aixm: vertical. Accuracy> </aixm: Elevated. Point> </aixm: has. Point. Shape> </aixm: Vertical. Structure. Part> </aixm: is. Made. Of> </aixm: Vertical. Structure. Time. Slice> </aixm: time. Slice> </aixm: Vertical. Structure> Sample XML – Vertical Structure 9 © 2008 The MITRE Corporation. All rights reserved.
Status (ctd) • Includes sample programs that read/write AIXM 5 – XML has not been validated • Uses GNU General Public License (GPL) • Hosted on Sourceforge – http: //sourceforge. net/projects/aixm-j 10 © 2008 The MITRE Corporation. All rights reserved.
Using the Library • Add aixm-j, dom 4 j, jaxen jar files to classpath Your Application Aviation Objects Convert to AIXM-J Objects AIXM-J Library Objects dom 4 j AIXM 5 XML Generating AIXM 5 XML 11 © 2008 The MITRE Corporation. All rights reserved.
Demo 12 © 2008 The MITRE Corporation. All rights reserved. Document Number Here
13 © 2008 The MITRE Corporation. All rights reserved.
Sample Code/Notes 14 © 2008 The MITRE Corporation. All rights reserved.
Sample Conversion Method // Takes an Airport object and returns an Aixm. Feature object public static Aixm. Feature create. Aixm. Airport(Airport airport) { // create an Aixm. Feature object Aixm. Feature ah = new Aixm. Feature(Aixm. Feature. Type. Airport. Heliport); // create an Aixm. Airport. Heliport. Time. Slice time. Slice = new Aixm. Airport. Heliport. Time. Slice(); // set gml. Id time. Slice. set. Gml. Id(String. value. Of(airport. get. Unique. Key())); // set designator time. Slice. set. Designator(airport. get. Airport. Id()); // set elevation Aixm. Vertical. Distance. Value field. Elevation = new Aixm. Vertical. Distance. Value(airport. get. Elevation(), Aixm. Uom. Distance. Vertical. Type. FT); time. Slice. set. Field. Elevation(field. Elevation); // set rest of fields here… // add the time. Slice to Airport. Heliport ah. add. Time. Slice(time. Slice); // return the Aixm. Feature object return ah; 15 } © 2008 The MITRE Corporation. All rights reserved.
Generating AIXM 5 XML // Convert airport to Aixm. Feature object Aixm. Feature aixm. Airport = Aixm. Airport. Util. create. Aixm. Airport(airport); // Create dom 4 j Document document = Document. Helper. create. Document(); // Create the root Element QName qname = QName. get(“Airport. Heliport”, Aixm. Constants. AIXM_NAMESPACE); Element root. Element = Document. Helper. create. Element(qname); // Set the root Element, XPath won’t work until you do this document. set. Root. Element(element); // Call AIXM-J method to add dom 4 j Elements to represent the airport aixm. Airport. add. Elements(root. Element, document); // Pretty print the document Output. Format formatter = Output. Format. create. Pretty. Print(); try { XMLWriter writer = new XMLWriter(System. out, formatter); writer. write(document); writer. flush(); } catch (Exception ex) { ex. print. Stack. Trace(); } 16 © 2008 The MITRE Corporation. All rights reserved.
Generated XML <? xml version="1. 0" encoding="UTF-8"? > <aixm: Airport. Heliport xmlns: aixm="http: //www. aixm. aero/schema/5. 0" xmlns: gml="http: //www. opengis. <aixm: time. Slice> <aixm: Airport. Heliport. Time. Slice gml: id="1576249658"> <aixm: designator>KIAD</aixm: designator> <aixm: name>WASHINGTON DULLES INTL</aixm: name> <aixm: location. Indicator. ICAO>K 6 KIAD</aixm: location. Indicator. ICAO> <aixm: type>AD</aixm: type> <aixm: private>NO</aixm: private> <aixm: elevation uom="FT">313. 0</aixm: elevation> <aixm: serves> <aixm: City gml: id="org. mitre. caasd. aixm. data. Aixm. City 15925147"> <aixm: name>WASHINGTON</aixm: name> </aixm: City> </aixm: serves> <aixm: magnetic. Variation>-10. 0</aixm: magnetic. Variation> <aixm: date. Magnetic. Variation>2000</aixm: date. Magnetic. Variation> <aixm: has. Reference. Point> <aixm: Elevated. Point xmlns: aixm="http: //www. aixm. aero" gml: id="23811352"> <gml: pos>38. 94453194444444 -77. 45580972222223</gml: pos> <aixm: elevation uom="FT">313. 0</aixm: elevation> </aixm: Elevated. Point> </aixm: has. Reference. Point> … 17 © 2008 The MITRE Corporation. All rights reserved.
Parsing an AIXM 5 ILS File // Open the file, create a Buffered. Reader and SAXReader File. Input. Stream is = new File. Input. Stream(new File("ILS. aixm. xml")); Buffered. Reader br = new Buffered. Reader(new Input. Stream. Reader(is)); SAXReader sax. Reader = new SAXReader(); // Add handler for each Navaid tag sax. Reader. add. Handler("/ils-subscriber-file/Navaid", new Element. Handler() { public void on. End(Element. Path path) { Element navaid. Element = path. get. Current(); // Convert the dom 4 j Element to an Aixm. Feature object Aixm. Feature navaid = new Aixm. Feature(Aixm. Feature. Type. Navaid). parse. Elements(navaid. Element); // Do something with the data here, in this example we just print the object System. out. println("navaid : " + navaid); // Free up memory navaid. Element. detach(); } public void on. Start(Element. Path path) {/* do nothing */} } ); // Read the XML file sax. Reader. read(br); 18 © 2008 The MITRE Corporation. All rights reserved.
Notes • AIXM – Aeronautical Information Exchange Model (AIXM) is designed to enable the management and distribution of Aeronautical Information Services (AIS) data in digital format • XMLBeans – XMLBeans is a technology for accessing XML by binding it to Java types • JDK – Java Development Kit, includes Java compiler, runtime environment, etc. • JAXB – The Java Architecture for XML Binding • SAX – Simple API for XML (SAX) is a serial access parser API for XML; event driven; user defines callback methods that are called during parsing • DOM – Document Object Model (DOM) is a standard object model for representing XML formats; tree based model • JAXP – Java API for XML Processing • XPath – Xml Path (XPath) is a language for selecting nodes from an XML document • Jaxen – Java XPath Engine (Jaxen) is an open source XPath library for Java • Dom 4 j – dom 4 j is an easy to use, open source library for working with XML, XPath and XSLT • XSLT – Extensible Stylesheet Language Transformations (XSLT) is a language for transforming XML documents into other XML documents 19 © 2008 The MITRE Corporation. All rights reserved.
Notes (ctd) • CAASD – Center for Advanced Aviation System Development, operated by MITRE • TARGETS – Terminal Area Route Generation, Evaluation and Traffic Simulation • ILS – Instrument Landing System • CRM – Collision Risk Model • DEM – Digital Elevation Model • DTED – Digital Terrain Elevation Data • NASR – National Airspace System Resources 20 © 2008 The MITRE Corporation. All rights reserved.
- Slides: 20