|
Airspace Visualization¶
Note: The module requires functional planet representation from the Earth Visualization module. Custom Airspace Modeling¶The airspace is created by setting its shape, altitudes, label and color. After the setup the user should call method airspace.create(). Then the airspace is added to the planet visualization. Main property of the airspace is its shape. The shape of the airspace can be circular, polygonal or general. The following example shows you the technique of the airspace creation on general and circular airspace. Example of airspace shape types: from _airspace import airspace
from _ossimPlanet import ossimPlanet
globe = ossimPlanet()
globe.addGeoid("share/ossimPlanet/geoid/egm96.grd")
globe.addTerrain(1.0)
globe.addImage("share/ossimPlanet/low-res image/earth.jpg")
# Part of the CCAE airspace in the Canada with the general shape
general = airspace(globe)
general.setShape((52.77, -111.49), # One point of the airspace
(52.93, -112.41), # Start point of the arc
(53.19, -113.87, 101860.0, 'CWA'), # Center of the arc with radius and direction
(53.53, -115.29), # End of the arc
(54.16, -111.95),
(54.41, -110.3, 111120.0, 'CCA'),
(53.72, -111.52),
(52.77, -111.49))
general.setAltitudes((0, 'AGL'), ('FL 120', 'AMSL'))
general.setLabel('CCAE', 'Canada', 'PART')
general.setColor(0.1, 0.9, 0.0, 0.2)
general.create()
# The circular airspace over the Hawaii
circular = airspace(globe)
circular.setShape((19.63, -155.5, 100000),) # Center of the circle with radius
circular.setAltitudes((0, 'AGL'), ('FL 120', 'AMSL'))
circular.setLabel('TMA', 'Hawaii', 'E')
circular.setColor(1.0, 0.5, 0.0, 0.1)
circular.create()
while not globe.renderDone():
globe.renderFrame()
Class airspace¶
airspace instances have the following methods:
Import of Airspace Database Data¶Currently there are supported AIXM airspace files in the AIXM 4.5 format and the SDO Reports from the European AIS Database (EAD). “The Aeronautical Information Exchange Model (AIXM) is a specification designed to enable the encoding and the distribution in digital format of the aeronautical information, which has to be provided by the national Aeronautical Information Services (AIS) in accordance with the ICAO Convention.” [EC2009] For example: airspaces = []
from parse_AIXM45 import AIXM45
aixm45 = AIXM45("aixmBorders.xml")
aixmFiles = dict(ase = "ase.xml", abd = "abd.xml")
aixm45.parse(aixmFiles, airspaces)
from world_borders import WorldBorders
from parse_EAD_SDO import EADSDO
world = WorldBorders("worldborders.shp")
eadsdo = EADSDO(world)
eadsdo.parse("sdoReport.xml", airspaces)
for airspace in airspaces:
airspace.addToVisualization(globe)
Importing EAD SDO Reports¶Static Data Operation (SDO) service provides world wide data from the EAD. The format used in SDO reports is based on the AICM/AIXM data format. These reports can be obtained at http://www.ead.eurocontrol.int/. After registration you can obtain data by generating airspace vertex report in the SDO Reporting application. Importing EAD SDO reports requires world borders for proper representation of state border used in airspace definitions. File with world borders in SHP file format can be obtained at http://thematicmapping.org/downloads/world_borders.php. The downloaded world border file is then loaded into instance of the WorldBorders class. from world_borders import WorldBorders
world = WorldBorders("worldborders.shp")
The downloaded SDO report xml file is then used as data source for the EAD SDO parser. This parser is represented by the class EADSDO. In the class constructor is used as a parameter an instance of the WorldBorder class. Then is needed to initialize empty list for storing airspaces. The parsing is executed by calling method EADSDO.parse(xmlFile, airspaces). The method parse all airspace records in the supplied xml file. Each airspace in the record is stored as an instance of the class AIXMAirspace and added to the airspaces list. from parse_EAD_SDO import EADSDO
eadsdo = EADSDO(world)
airspaces = []
eadsdo.parse("sdoReport.xml", airspaces)
The variable airspaces now contains airspaces prepared for adding into the visualization of the Earth Visualization. This is done via method AIXMAirspace.addToVisualization() with the globe parameter. It is an instance of the Earth Visualization. for airspace in airspaces:
airspace.addToVisualization(globe)
Importing AIXM 4.5 Files¶Import of AIXM files is similar to the EAD SDO ones. The parser for the AIXM 4.5 format is contained in the class AIXM45. For load the AIXM airspace is needed to have three files. The first one contains political borders with coordinates. This file is used as a parameter for the constructor of the AIXM45 class. from parse_AIXM45 import AIXM45
aixm45 = AIXM45("aixmBorders.xml")
The file aixmBorders.xml has the following structure: <AIXM-Snapshot>
<Gbr>
<GbrUid>
<txtName>STATE-A_STATE-B</txtName>
</GbrUid>
<Gbv>
<codeType>GRC</codeType>
<geoLat>503039N</geoLat>
<geoLong>0191040E</geoLong>
</Gbv>
</Gbr>
</AIXM-Snapshot>
The second file contains Ase elements. These elements contains aeronautical information about the airspace. There is defined lower and upper altitude of the airspace. The ase.xml has following structure: <AIXM-Snapshot>
<Ase>
<AseUid>
<codeType>TYPE</codeType>
<codeId>ICAO</codeId>
</AseUid>
<txtName>NAME</txtName>
<codeMil>CIVIL</codeMil>
<codeDistVerUpper>STD</codeDistVerUpper>
<valDistVerUpper>60</valDistVerUpper>
<uomDistVerUpper>FL</uomDistVerUpper>
<codeDistVerLower>HEI</codeDistVerLower>
<valDistVerLower>0</valDistVerLower>
<uomDistVerLower>FT</uomDistVerLower>
</Ase>
</AIXM-Snapshot>
The last one file contains vertex data of the airspace. These vertices are stored in Abd elements. The abd.xml file has the following structure: <AIXM-Snapshot>
<Abd>
<AbdUid>
<AseUid>
<codeType>TYPE</codeType>
<codeId>ICAO</codeId>
</AseUid>
</AbdUid>
vertices data - Avx / Circle elements
</Abd>
</AIXM-Snapshot>
Files ase.xml and abd.xml are passed as a parameter to the parser. The parser also requires parameter of the list type, where newly created airspaces are stored. airspaces = []
aixmFiles = dict(ase = "ase.xml", abd = "abd.xml")
aixm45.parse(aixmFiles, airspaces)
When the parsing is finished the variable airspaces contains instances of the class AIXMAirspace. These can be added to the visualization by the method AIXMAirspace.addToVisualization(). The Earth Visualization is represented by the globe parameter. for airspace in airspaces:
airspace.addToVisualization(globe)
Parsing Custom Airspace Data Formats¶This section describes classes that may be used to import airspace database data in a custom format. AIXMAirspace¶
Parsing EAD SDO reports¶
Parsing AIXM 4.5 files¶
The others methods are nearly the same as these in the class EADSDO. These methods are:
References¶
|