© 2008 the mitre corporation. all rights reserved. developing an open source aixm5 java library...

20
© 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD March 19, 2008

Upload: marsha-french

Post on 28-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.

Developing an Open Source AIXM5 Java Library

(AIXM-J)

Steven Chase

Lead Software Engineer

MITRE/CAASD

March 19, 2008

Page 2: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.2

Overview

• Background

– Tools

– Data sources

• Open source project

– Goals

– Technology

– Challenges

– Status

– Using the library

• Demo

Page 3: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.3

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

Page 4: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.4

CAASD Developed Tools

• Procedure design, flyability, simulation, visualization

• ILS approach/airport safety analysis, CRM

Safety Assessment ToolsetTARGETS

Page 5: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.5

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)

Page 6: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.6

Goals

• Develop AIXM5 Java library that is:

– Independent

– Easy to use

– Well documented

– Extensible

– AIXM5 compliant

• Enable applications to read/write AIXM5 data

• Handle large data sets

Page 7: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.7

Technology

• Sun JDK (5 or greater)

– Enum, generics, enhanced for loop, etc.

• Dom4j

– 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 AIXM5 schema elements and attributes were supported

– Auto-generated code may be hard to work with

– Other attempts have been made

Page 8: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.8

Challenges

• Understanding the model

• Model is still changing

• Sample XML is limited

• Implementing GML

Page 9: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.9

Status

• Features

– AirportHeliport

– Runway

– Navaid

– Designated Point

– Vertical Structure

– STAR/SID

– Basic Message

– GML Point and ValidTime

<aixm:VerticalStructure xmlns:aixm="http://www.aixm.aero/schema/5.0" gml:id="19608436"> <aixm:timeSlice> <aixm:VerticalStructureTimeSlice gml:id="26795951"> <aixm:name>TEST OBSTACLE</aixm:name> <aixm:type>POLE</aixm:type> <aixm:constructionStatus>COMPLETED</aixm:constructionStatus> <aixm:material>STEEL</aixm:material> <aixm:markingPattern>STEEL</aixm:markingPattern> <aixm:markingFirstColour>RED</aixm:markingFirstColour> <aixm:markingSecondColour>BLACK</aixm:markingSecondColour> <aixm:markingICAOStandard>YES</aixm:markingICAOStandard> <aixm:group>NO</aixm:group> <aixm:isMadeOf> <aixm:VerticalStructurePart gml:id="25276323"> <aixm:verticalExtent uom="FT">500.0</aixm:verticalExtent> <aixm:verticalExtentAccuracy uom="FT">10.0</aixm:verticalExtentAccuracy> <aixm:hasPointShape> <aixm:ElevatedPoint gml:id="20051738"> <gml:pos>70.0 -122.0</gml:pos> <aixm:elevation uom="FT">1500.0</aixm:elevation> <aixm:geoidUndulation uom="M">212.0</aixm:geoidUndulation> <aixm:verticalDatum>EGM96</aixm:verticalDatum> <aixm:horizontalAccuracy uom="M">15.0</aixm:horizontalAccuracy> <aixm:verticalAccuracy uom="M">10.0</aixm:verticalAccuracy> </aixm:ElevatedPoint> </aixm:hasPointShape> </aixm:VerticalStructurePart> </aixm:isMadeOf> </aixm:VerticalStructureTimeSlice> </aixm:timeSlice></aixm:VerticalStructure>

Sample XML – Vertical Structure

Page 10: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.10

Status (ctd)

• Includes sample programs that read/write AIXM5

– XML has not been validated

• Uses GNU General Public License (GPL)

• Hosted on Sourceforge

– http://sourceforge.net/projects/aixm-j

Page 11: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.11

Using the Library

• Add aixm-j, dom4j, jaxen jar files to classpath

YourApplication

AviationObjects

Convert to AIXM-J Objects

AIXM-J LibraryObjects

AIXM5 XMLdom4j

Generating AIXM5 XML

Page 12: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

Demo

Document Number Here© 2008 The MITRE Corporation. All rights reserved.12

Page 13: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.13

Page 14: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.14

Sample Code/Notes

© 2008 The MITRE Corporation. All rights reserved.14

Page 15: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.15

Sample Conversion Method

// Takes an Airport object and returns an AixmFeature object public static AixmFeature createAixmAirport(Airport airport) { // create an AixmFeature object AixmFeature ah = new AixmFeature(AixmFeatureType.AirportHeliport); // create an AixmAirportHeliportTimeSlice AixmAirportHeliportTimeSlice timeSlice = new AixmAirportHeliportTimeSlice(); // set gmlId timeSlice.setGmlId(String.valueOf(airport.getUniqueKey())); // set designator timeSlice.setDesignator(airport.getAirportId()); // set elevation AixmVerticalDistanceValue fieldElevation = new AixmVerticalDistanceValue(airport.getElevation(), AixmUomDistanceVerticalType.FT); timeSlice.setFieldElevation(fieldElevation); // set rest of fields here…

// add the timeSlice to AirportHeliport ah.addTimeSlice(timeSlice); // return the AixmFeature object return ah; }

Page 16: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.16

Generating AIXM5 XML

// Convert airport to AixmFeature objectAixmFeature aixmAirport = AixmAirportUtil.createAixmAirport(airport);// Create dom4j DocumentDocument document = DocumentHelper.createDocument();// Create the root ElementQName qname = QName.get(“AirportHeliport”, AixmConstants.AIXM_NAMESPACE);Element rootElement = DocumentHelper.createElement(qname);// Set the root Element, XPath won’t work until you do thisdocument.setRootElement(element);// Call AIXM-J method to add dom4j Elements to represent the airportaixmAirport.addElements(rootElement, document);// Pretty print the documentOutputFormat formatter = OutputFormat.createPrettyPrint();try { XMLWriter writer = new XMLWriter(System.out, formatter); writer.write(document); writer.flush(); }catch (Exception ex) { ex.printStackTrace();}

Page 17: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.17

Generated XML

<?xml version="1.0" encoding="UTF-8"?><aixm:AirportHeliport xmlns:aixm="http://www.aixm.aero/schema/5.0" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" gml:id="org.mitre.caasd.aixm.feature.airportheliport.airportheliport.AixmAirportHeliport6468511"> <aixm:timeSlice> <aixm:AirportHeliportTimeSlice gml:id="1576249658"> <aixm:designator>KIAD</aixm:designator> <aixm:name>WASHINGTON DULLES INTL</aixm:name> <aixm:locationIndicatorICAO>K6KIAD</aixm:locationIndicatorICAO> <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.AixmCity15925147"> <aixm:name>WASHINGTON</aixm:name> </aixm:City> </aixm:serves> <aixm:magneticVariation>-10.0</aixm:magneticVariation> <aixm:dateMagneticVariation>2000</aixm:dateMagneticVariation> <aixm:hasReferencePoint> <aixm:ElevatedPoint 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:ElevatedPoint> </aixm:hasReferencePoint> …

Page 18: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.18

Parsing an AIXM5 ILS File

// Open the file, create a BufferedReader and SAXReaderFileInputStream is = new FileInputStream(new File("ILS.aixm.xml"));BufferedReader br = new BufferedReader(new InputStreamReader(is));SAXReader saxReader = new SAXReader();// Add handler for each Navaid tagsaxReader.addHandler("/ils-subscriber-file/Navaid", new ElementHandler() { public void onEnd(ElementPath path) { Element navaidElement = path.getCurrent(); // Convert the dom4j Element to an AixmFeature object AixmFeature navaid = new AixmFeature(AixmFeatureType.Navaid).parseElements(navaidElement); // Do something with the data here, in this example we just print the object System.out.println("navaid : " + navaid); // Free up memory navaidElement.detach(); } public void onStart(ElementPath path) {/* do nothing */}} );

// Read the XML filesaxReader.read(br);

Page 19: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.19

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

• Dom4j – dom4j 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

Page 20: © 2008 The MITRE Corporation. All rights reserved. Developing an Open Source AIXM5 Java Library (AIXM-J) Steven Chase Lead Software Engineer MITRE/CAASD

© 2008 The MITRE Corporation. All rights reserved.20

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