By default, INTGeoServer doesn't compress the data sent by the seismictraces web service. The service tends to send large chunks of data at once. If the bandwidth is low, data transfer becomes a bottleneck and INTGeoServer clients experience slow access. To improve performance in such cases, INTGeoServer supports compression of these traces.
To know which compression services INTGeoServer supports, use the seismiccompressors web service. The "items" JSON attribute will give the list of all compression algorithm names. This attribute only shows if the IVAAPSeismicCompressionServices.jar file is present in your WEB-INF/lib directory. By default, three compression algorithms are plugged:
RawSeismicCompressor: doesn't perform any compression, this is the default
HaarSeismicCompressor v1: performs a compression based upon Haar wavelet U transforms
HaarSeismicCompressor v2: performs a compression based upon Haar wavelet U V2 transforms
To add your own seismic compressor extend com.interactive.ivaap.server.seismic.compressors.AbstractSeismicCompressor class.
Testing shows that the Haar compression starts being useful for bandwidths that are lower than 100 Mbps. It is highly dependent on the data being transferred as the Haar compression takes advantage of trace similarities to compress data.
The AbstractSeismicCompressor class has a simple signature:
public abstract class AbstractSeismicCompressor {
public abstract String getName();
public abstract AbstractSeismicCompressor getInstance();
public abstract void printTraces(ISeismicData seismicData, ISeismicReader reader, ObjectNode dataNode, ISeismicCompressionListener listener) throws Exception;
}
The compressor is picked based upon the compression JSON parameter. Valid options are "HaarWavelets U", "HaarWavelets U V2" and "NoCompress". The default is "NoCompress".
String strategyWanted = JSONUtil.getStringFromJSON(parametersNode, "compression", "NoCompress");
The printTraces method serializes the header and sample value of the trace indexes specified. Implementations typically uses the listener object to get service specific informatiom.
For example, the raw compressor makes these calls to parse input parameters:
boolean samples = listener.includeSamples();
int samplesCount = listener.getSamplesPerTrace(seismicReader);
final ByteOrder byteOrder = listener.getByteOrder();
AbstractSampleFormat format = listener.getSampleFormat();
The Haar compressor also makes these calls to parse extra parameters from the JSON object:
String sTypeTransform = JSONUtil.getStringFromJSON(dataNode, "typeTransform");
String sError = JSONUtil.getStringFromJSON(dataNode, "error");
String sEnabled = JSONUtil.getStringFromJSON(dataNode, "enabled");
By plugging your own compressor, you have control over every byte that is sent along with which JSON parameters your compressor requires to work.
byteorder represents the endianess of the streamed sample bytes. Valid options are "BIG_ENDIAN" or "LITTLE_ENDIAN". This is an optional parameter. When not specified, the endianess of the OS where INTGeoServer is hosted will be used
sampleFormat represents the format of the samples. Valid options are "Raw", "Byte", "Short", "Float" and "Integer"
includesamples indicates whether sample values should be included. Valid options are "true" or "false". When samples is false, only header values are transferred. When not specified, sample values are included
For the Haar compression only:
error represents the maximum error percentage during the quantization phase of the Haar compression
enabled indicates whether an AGC should be performed prior to the compression. Valid options are "true" or "false". When enabled is false, no AGC is performed