MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLCADRGExporter Class Reference
Inheritance diagram for TSLCADRGExporter:

Detailed Description

This class provides the capability to Export MapLink maps in the following formats:

  • CADRG
  • CIB

Pseudo Code

Each scale has to be setup separately to ensure that the correct data is drawn into each tile at the required scale.

TSLCADRGExporter::unlockSupprt(product, key);

TSLCoordinateSystem::loadCoordinateSystems();

setCallback(callback, userData)
exportDirectory(directory)

setup Drawing Surface for First Scale.
export(First Scale)

setup Drawing Surface for Second Scale.
export(Second Scale)

Repeat setup and export for Additional Scales.

createToc()

Map Requirements

The maps should use Non-projected coordinate systems such as Dynamic Arc, i.e. latitude/longitude maps, that have 50 TMCs per map unit.

This requirement is not imposed by the exporter (see limitations below).

If a coordinate system does not exist a Dynamic Arc coordinate system is created and used internally.

Output Directory Structure

The output directory structure is:

exportDirectory/PRODUCT/RPF/SCALE/Frames  PRODUCT Frame files.
exportDirectory/PRODUCT/RPF/A.TOC         PRODUCT Table of Contents file.

Where PRODUCT is either CADRG or CIB. Where exportDirectory is the directory set by the user by calling exportDirectory() method.

Processing Options:

CADRG/CIB compression is lossy. The input map should be of the same scale or better then the selected output scale.

There are two ways to process the data as follows:

  1. Zone processing. If Zone Processing is enabled then on export the compression and colour tables are created from all the frames.

Zone processing produces the worst compression artefacts. A number of options have been provided to allow you to trade off performance for quality (see below).

  1. Tile processing. Each frame contains a unique compression and colour table.

Zone processing options:

If colourReduceZone is enabled then all the tiles are examined to generate an optimised colour table. The optimised colour table is used to convert each frame before the compression table is created. By doing Colour Reduction before compression the number of possible compression codes is reduced, reducing the loss of data in the output image.

If zoneCodecs is true then we calculate the compression codec's for the whole zone. This is likely to result in lower quality output.

If zoneCodecs is false then we calculate the compression codec's for each frame resulting in higher quality output. The colour table however remains constant because a number of hardware systems are colour limited.

Tile processing options:

If colourReduceTile is true we reduce the colours contained in the tile before we do the analysis for compression.

The colour reduction works by creating a colour table of 216 colours and then reducing the colours to only the colours contained in the colour table before we do the compression. This will result in a reduction in performance and is now unlikely to improve the quality of the output data (due to modifications to the compression algorithm).

Limitations:

All files are created big-endian.

The Frame filenames are defined as continuous frame numbers (ref 1 para 5.1.4 & 5.1.5, ref 2, para 30.6).

Polar regions are not supported.

Palette histograms are not populated.

There is only one palette which contains 216 colours.

Transparent pixel and masking is not supported. If you need to have blank areas set to a particular colour set the Drawing Surface background colour before calling export.

Header fields are filled in with the minimum information.

All Classifications are set to 'U'.

Only the TSLNTSurface is supported at present.

CADRG data can only be created from dynamic arc maps which are set to 50 TMC per map unit.

Frames are generated even if part of their extent exceeds the legal latitude longitude limits.

Frame Filenames

The frame naming convention is defined in the spec (MIL-C-89038) para 30.6.

fffffvvp.ccz

Where:

  • fffff - is radix 34 value that encodes the unique cumulative frame number in the zone (base 34).
  • vv - version number - always 00
  • p - producer number - always 0
  • cc - Map or chart type e.g. AP
  • z - Zone number/letter

Map/Chart Types (Series Code)

The following table shows the Series Codes that Envitia know about.

Series Code Scale enum Description
AP TSLCADRGScale_1_IN_9M Series code is not defined anywhere - Area Planning
GN TSLCADRGScale_1_IN_5M
JN TSLCADRGScale_1_IN_2M
OH TSLCADRGScale_1_IN_1M
ON TSLCADRGScale_1_IN_1M
OW TSLCADRGScale_1_IN_1M
TP TSLCADRGScale_1_IN_500K Tactical Pilotage Chart CADRG
LF TSLCADRGScale_1_IN_500K LFC-FR (Day) 1:500,000 Low Flying Chart (Day)- Host Nation CADRG
L1 TSLCADRGScale_1_IN_500K LFC-1 1:500,000 Low Flying Chart (TBD #1) CADRG
L2 TSLCADRGScale_1_IN_500K LFC-2 1:500,000 Low Flying Chart (TBD #2) CADRG
L3 TSLCADRGScale_1_IN_500K LFC-3 1:500,000 Low Flying Chart (TBD #3) CADRG
L4 TSLCADRGScale_1_IN_500K LFC-4 1:500,000 Low Flying Chart (TBD #4) CADRG
L5 TSLCADRGScale_1_IN_500K LFC-5 1:500,000 Low Flying Chart (TBD #5) CADRG
LN TSLCADRGScale_1_IN_500K LFC (Night) 1:500,000 Low Flying Chart (Night) - Host Nation CADRG
JG TSLCADRGScale_1_IN_250K JOG 1:250,000 Joint Operations Graphic CADRG
JA TSLCADRGScale_1_IN_250K JOG-A 1:250,000 Joint Operations Graphic - Air CADRG
JR TSLCADRGScale_1_IN_250K JOG-R 1:250,000 Joint Operations Graphic - Radar CADRG
JO TSLCADRGScale_1_IN_250K OPG 1:250,000 Operational Planning Graphic CADRG
VT TSLCADRGScale_1_IN_250K VTAC 1:250,000 VFR Terminal Area Chart CADRG
F1 TSLCADRGScale_1_IN_250K TFC-1 1:250,000 Transit Flying Chart (TBD #1) CADRG
F2 TSLCADRGScale_1_IN_250K TFC-2 1:250,000 Transit Flying Chart (TBD #2) CADRG
F3 TSLCADRGScale_1_IN_250K TFC-3 1:250,000 Transit Flying Chart (TBD #3) CADRG
F4 TSLCADRGScale_1_IN_250K TFC-4 1:250,000 Transit Flying Chart (TBD #4) CADRG
F5 TSLCADRGScale_1_IN_250K TFC-5 1:250,000 Transit Flying Chart (TBD #5) CADRG
AT TSLCADRGScale_1_IN_200K ATC 1:200,000 Series 200 Air Target Chart CADRG
VH TSLCADRGScale_1_IN_125K HRC 1:125,000 Helicopter Route Chart CADRG
TN TSLCADRGScale_1_IN_125K TFC (Night) 1:250,000 Transit Flying Chart(Night)- Host nation CADRG
TR TSLCADRGScale_1_IN_200K TLM200 1:200,000 Topographic Line Map 1:200,000 scale CADRG
TC TSLCADRGScale_1_IN_100K TLM 100 1:100,000 Topographic Line Map 1:100,0000 scale CADRG
RV TSLCADRGScale_1_IN_50K Riverine 1:50,000 Riverine Map 1:50,000 scale CADRG
TL TSLCADRGScale_1_IN_50K TLM 50 1:50,000 Topographic Line Map CADRG
UL TSLCADRGScale_1_IN_50K TLM50-Other 1:50,000 Topographic Line Map (other 1:50,000 scale) CADRG
TT TSLCADRGScale_1_IN_25K TLM25 1:25,000 Topographic Line Map 1:25,000 scale CADRG
TQ TSLCADRGScale_1_IN_24K TLM24 1:24,000 Topographic Line Map 1:24,000 scale CADRG
HA TSLCADRGScale_UNKNOWN HA Various Harbor and Approach Charts CADRG
CO TSLCADRGScale_UNKNOWN CO Various Coastal Charts CADRG
OA TSLCADRGScale_UNKNOWN OPAREA Various Naval Range Operating Area Chart CADRG
CG TSLCADRGScale_UNKNOWN CG Various City Graphics CADRG
C1 TSLCADRGScale_1_IN_10K CG 1:10,000 City Graphics CADRG
C2 TSLCADRGScale_1_IN_10560 CG 1:10,560 City Graphics CADRG
C3 TSLCADRGScale_1_IN_11000 CG 1:11,000 City Graphics CADRG
C4 TSLCADRGScale_1_IN_11800 CG 1:11,800 City Graphics CADRG
C5 TSLCADRGScale_1_IN_12000 CG 1:12,000 City Graphics CADRG
C6 TSLCADRGScale_1_IN_12pt5K CG 1:12,500 City Graphics CADRG
C7 TSLCADRGScale_1_IN_12800 CG 1:12,800 City Graphics CADRG
C8 TSLCADRGScale_1_IN_14000 CG 1:14,000 City Graphics CADRG
C9 TSLCADRGScale_1_IN_14700 CG 1:14,700 City Graphics CADRG
CA TSLCADRGScale_1_IN_15000 CG 1:15,000 City Graphics CADRG
CB TSLCADRGScale_1_IN_15500 CG 1:15,500 City Graphics CADRG
CC TSLCADRGScale_1_IN_16000 CG 1:16,000 City Graphics CADRG
CD TSLCADRGScale_1_IN_16666 CG 1:16,666 City Graphics CADRG
CE TSLCADRGScale_1_IN_17000 CG 1:17,000 City Graphics CADRG
CF TSLCADRGScale_1_IN_17500 CG 1:17,500 City Graphics CADRG
CH TSLCADRGScale_1_IN_18000 CG 1:18,000 City Graphics CADRG
CJ TSLCADRGScale_1_IN_20000 CG 1:20,000 City Graphics CADRG
CK TSLCADRGScale_1_IN_21000 CG 1:21,000 City Graphics CADRG
CL TSLCADRGScale_1_IN_21120 CG 1:21,120 City Graphics CADRG
CN TSLCADRGScale_1_IN_22000 CG 1:22,000 City Graphics CADRG
CP TSLCADRGScale_1_IN_23000 CG 1:23,000 City Graphics CADRG
CQ TSLCADRGScale_1_IN_25000 CG 1:25,000 City Graphics CADRG
CR TSLCADRGScale_1_IN_26000 CG 1:26,000 City Graphics CADRG
CS TSLCADRGScale_1_IN_35000 CG 1:35,000 City Graphics CADRG
CT TSLCADRGScale_1_IN_36000 CG 1:36,000 City Graphics CADRG
CM TSLCADRGScale_UNKNOWN CM Various Combat Charts CADRG
A1 TSLCADRGScale_1_IN_10K CM 1:10,000 Combat Charts, 1:10,000 scale CADRG
A2 TSLCADRGScale_1_IN_25K CM 1:25,000 Combat Charts, 1:25,000 scale CADRG
A3 TSLCADRGScale_1_IN_50K CM 1:50,000 Combat Charts, 1:50,000 scale CADRG
A4 TSLCADRGScale_1_IN_100K CM 1:100,000 Combat Charts, 1:100,000 scale CADRG
MI TSLCADRGScale_1_IN_50K MIM 1:50,000 Military Installation Maps CADRG
M1 TSLCADRGScale_UNKNOWN MIM Various Military Installation Map (TBD #1) CADRG
M2 TSLCADRGScale_UNKNOWN MIM Various Military Installation Map (TBD #2) CADRG
VN TSLCADRGScale_1_IN_500K VNC 1:500,000 Visual Navigation Charts CADRG
MM TSLCADRGScale_UNKNOWN Various (Miscellaneous Maps & Charts) CADRG
I1 TSLCADRGScale_10M 10m Imagery, 10 meter resolution CIB
I2 TSLCADRGScale_5M 5m Imagery, 5 meter resolution CIB
I3 TSLCADRGScale_2M 2m Imagery, 2 meter resolution CIB
I4 TSLCADRGScale_1M 1m Imagery, 1 meter resolution CIB
I5 TSLCADRGScale_0pt5M 0.5m Imagery, .5 (half) meter resolution CIB
IV TSLCADRGScale_UNKNOWN Various>10m Imagery, greater than 10 meter resolution CIB
R1 TSLCADRGScale_750M RDTED 750M - 1:5,000,000
R3 TSLCADRGScale_150M RDTED 150M - 1:1,000,000
R5 TSLCADRGScale_37pt5M RDTED 37.5M - 1:250,000

References:

  1. MIL-STD-2411-1
  2. CADRG (MIL-C-89038)
  3. CIB (MIL-C-89041)
  4. RDTED (ref 1, 5, 6 & MIL-PRF-xxxx)
  5. RPF (MIL-STD-2411)
  6. NITF (MIL-STD-2411-2, MIL-STD-2500).
  7. Software: NIMAMUSE 2.1, Raster Importer 2.1.1.

Public Member Functions

 TSLCADRGExporter ()
 
virtual ~TSLCADRGExporter ()
 
bool colourScaling (float redScaling, float greenScaling, float blueScaling)
 
bool createTOC (bool keepAnalysisFiles=false, const char *product=NULL)
 
bool exportCadrg (const TSLCADRGProductEnum product, const TSLCADRGScaleEnum scale, const TSLGeodeticExtent &extent, TSLNTSurface *drawingSurface, const bool zoneCompress=true, const bool colourReduceZone=false, const char *mapChartType=0, const bool colourReduceTile=false, const bool zoneCodecs=true)
 
bool queryExport (const TSLCADRGProductEnum product, const TSLCADRGScaleEnum scale, const TSLGeodeticExtent &extent, TSLCADRGProductData &info, const bool zoneProcessing=true, const bool colourReduction=false)
 
- Public Member Functions inherited from TSLRPFExporter
bool exportDirectory (const char *directory)
 
void setCallback (TSLRPFProgressCallback callback, void *callbackData=0)
 
void cancel ()
 

Static Public Member Functions

static bool unlockSupport (const TSLCADRGProductEnum product, const char *key)
 

Additional Inherited Members

- Protected Member Functions inherited from TSLRPFExporter
 TSLRPFExporter ()
 
virtual ~TSLRPFExporter ()
 
bool createTableOfContents (bool keepAnalysisFiles, const char *product)
 
- Protected Attributes inherited from TSLRPFExporter
void * m_classId
 

Constructor & Destructor Documentation

◆ TSLCADRGExporter()

TSLCADRGExporter::TSLCADRGExporter ( )

Constructor.

◆ ~TSLCADRGExporter()

virtual TSLCADRGExporter::~TSLCADRGExporter ( )
virtual

Member Function Documentation

◆ colourScaling()

bool TSLCADRGExporter::colourScaling ( float redScaling,
float greenScaling,
float blueScaling )

Sets scaling factors to be applied to the colour map of exported CADRG and CIB frame files. (Although CIB contains only greyscale data, the red, green and blue colour values are used to store the grey value.)

All scaling factors must be >= 0.0 and <= 1.0

Parameters
redScalingscaling value to be applied to all red values in the colour map.
greenScalingscaling value to be applied to all green values in the colour map.
blueScalingscaling value to be applied to all blue values in the colour map.
Returns
false if any scaling factor is outside the permitted range.

◆ createTOC()

bool TSLCADRGExporter::createTOC ( bool keepAnalysisFiles = false,
const char * product = NULL )

Create the 'A.TOC' file in the export directory.

To be able to create the Table of Contents file the Analysis files generated when creating the product at the required scales must be present in the export directory. The names of the sub-directories and analysis files are significant and should not be altered.

All sub-directories are searched for valid Analysis files. A TOC file must not contain multiple products (this can happen if the user moves files around).

Call createTOC once all the scales and products have been generated.

Parameters
productUsually NULL. This parameter is used for old style analysis files which did not contain the product code.
keepAnalysisFilesIf set to false deletes the Analysis files if the TOC file was created. Default false.
Returns
true if successful, false otherwise.

◆ exportCadrg()

bool TSLCADRGExporter::exportCadrg ( const TSLCADRGProductEnum product,
const TSLCADRGScaleEnum scale,
const TSLGeodeticExtent & extent,
TSLNTSurface * drawingSurface,
const bool zoneCompress = true,
const bool colourReduceZone = false,
const char * mapChartType = 0,
const bool colourReduceTile = false,
const bool zoneCodecs = true )

Exports the map as the specified product at the specified scale.

The drawingSurface should contain all the Map DataLayers and Standard Data Layers that the user wishes to be exported. The background colour should be configured on this Drawing Surface.

CIB should be exported separately from CADRG as CIB contains only greyscale data which would limit the colours available for the Compression/Palette.

Please refer to the class document for a more detailed description of the options.

Parameters
productRPFProduct to output.
scaleScale to output.
extentExtent of area to output.
drawingSurfaceDrawing Surface containing the DataLayers to output.
zoneCompressZone Processing flag (see class documentation).
colourReduceZoneColour Reduction flag - the colours for the whole zone are first calculated and then used to reduce the colours in each tile to this set of colours (see class documentation). If colourReduceTile is true this flag is ignored unless zoneCompress is true.
mapChartTypeMap or chart type. Also known as Series Code. (see class documentation - Frame Filenames & Map/Chart Types) If this variable is NULL then we use the default defined in TSLCADRGScale Enum. The passed string must be two characters.
colourReduceTileColour Reduction flag - the colours are reduced on a per tile basis only. This flag is ignored if zoneCompress is true.
zoneCodecsIf true (default) then only one set of decompression codecs are used for a zone. If false we generate a set of codecs which are unique for each frame. The colour table will remain the same. This flag is only used if zoneCompress is set to true.
Returns
false if there was a problem.

◆ queryExport()

bool TSLCADRGExporter::queryExport ( const TSLCADRGProductEnum product,
const TSLCADRGScaleEnum scale,
const TSLGeodeticExtent & extent,
TSLCADRGProductData & info,
const bool zoneProcessing = true,
const bool colourReduction = false )

Query information about the proposed export for the specified product and scale.

The times calculated will depend on processing options.

Arguments

product : CADRGProduct to output.

scale : Scale to output.

extent : Extent of area to output.

info: Returned Information.

zoneCompress : Zone Processing flag (see class documentation).

colourReduce : Colour Reduction flag (see class documentation).

Returns false if there was a problem.

◆ unlockSupport()

static bool TSLCADRGExporter::unlockSupport ( const TSLCADRGProductEnum product,
const char * key )
static

This method is used to unlock the CADRG products that may be exported.

If this method is not called then exporting of the CADRG product will not occur.

Parameters
productCADRG Product to unlock.
keyThe unlock key specified by Envitia that corresponds to this filter