Some ASTERIX categories provide data positions that are relative to a location.
As a result, the LuciadLightspeed ASTERIX decoders don’t decode the data of those ASTERIX categories as WGS84 longitude/latitude
coordinates.
Category 240 Radar data, for example, specifies positions relative to a radar location.
To handle such cases, the ASTERIX decoders rely on an ALcdASTERIXReferenceProvider
to define the radar location.
You can set the ASTERIX reference provider through the method setReferenceProvider
.
-
For a static radar, you use
TLcdASTERIXReferenceProvider
. -
For a moving or rotating radar, you must implement
ALcdASTERIXReferenceProvider
. The decoders call itsgetModelReference
for each decoded record. The following code shows an example implementation that translates and rotates the radar location for each method invocation.
ILcd2DEditablePoint position = = new TLcdLonLatPoint(0, 0);
TLcdASTERIXLiveDecoder liveDecoder = new TLcdASTERIXLiveDecoder();
liveDecoder.setReferenceProvider(new ALcdASTERIXReferenceProvider() {
double rotation = 0;
@Override
public ILcdModelReference getModelReference(int aSacSic, ALcdASTERIXModelDescriptor aDescriptor, Object aObject) {
position.translate2D(1e-3, 1e-3);
rotation += 0.1;
return new TLcdGridReference(
new TLcdGeodeticDatum(),
new TLcdAzimuthalEquidistant(position.getX(), position.getY()),
0, 0,
1, 1,
Math.toRadians(rotation)
);
}
});