Skip to content

GSIP 128

Jody Garnett edited this page Jul 12, 2017 · 1 revision

GSIP 128 - JAI-EXT integration in GeoServer

Overview

Proposed By

Nicola Lagomarsini, Daniele Romagnoli

Assigned to Release

This proposal is for GeoServer 2.8-beta.

State

  • Under Discussion
  • In Progress
  • Completed
  • Rejected
  • Deferred

Motivation

JAI-EXT is a new project developed by GeoSolutions team of a new Java API for high performance image processing. Our aim is to totally replace all the JAI[1] operations with the new JAI-EXT[2] ones. The most important feature introduced by JAI-EXT is support for ROI and NoData, which are key points of the GeoSpatial raster data processing.

Proposal

This proposal has been written as the GeoServer counterpart of the GeoTools related proposal[1]. Below the main changes to the GeoServer code which will be done with this proposal will be described.

Modification of the JAIInfo class

The JAIInfo class, which contains all the JAI related settings, will be modified in order to accept a new JAIEXTInfo object, containing the JAI-EXT related settings.

/**
 * JAI-EXT section
 */
JAIEXTInfo getJAIEXTInfo();
void setJAIEXTInfo(JAIEXTInfo jaiext);

Also JAIEXTInfo will be a new Interface

public interface JAIEXTInfo extends Serializable, Cloneable {
    
    Set<String> getJAIOperations();
    void setJAIOperations(Set<String> operations);
    
    Set<String> getJAIEXTOperations();
    void setJAIEXTOperations(Set<String> operations);

Modification on the JAIInitializer

Since new JAI-EXT operations are present, JAIInitializer class must be able to handle which JAI-EXT operations must be registered based on the definitions stored in the JAIEXTInfo class. Those definitions will be depersisted from the global.xml file in the GEOSERVER_DATA_DIRECTORY.

Creation of a new Panel in the JAI Page

A new panel will be added to the JAI Page. This panel will allow users to choose if an operation must be done using JAI or JAI-EXT.

Replacement of all the OperationDescriptor calls with ImageWorker calls

The removal of the OperationDescriptors is needed since it allows to quickly switch between JAI and JAI-EXT operations without any registration issue.

BEFORE:

RenderedOp cropped = GTCropDescriptor
       .create(metaTileImage, Float.valueOf(x), Float.valueOf(y),
                    Float.valueOf(tileWidth), Float.valueOf(tileHeight), NO_CACHE);

AFTER:

ImageWorker w = new ImageWorker(metaTileImage);
w.crop(Float.valueOf(x), Float.valueOf(y), Float.valueOf(tileWidth), Float.valueOf(tileHeight));
RenderedOp cropped = w.getRenderedOperation();

Feedback

Backwards Compatibility

The only backward incompatibility present is the JAIInfo interface change which is reflected in the related global.xml file. Any attempt to parse this new version of the XML file will result in an exception.

Voting

Project Steering Committee:

  • Alessio Fabiani
  • Andrea Aime
  • Ben Caradoc-Davies
  • Christian Mueller
  • Gabriel Roldán
  • Jody Garnett
  • Jukka Rahkonen
  • Justin Deoliveira
  • Phil Scadden
  • Simone Giannecchini

Links

  1. [JAI] (http://www.oracle.com/technetwork/java/javase/tech/jai-142803.html)
  2. [JAI-EXT] (https://github.com/geosolutions-it/jai-ext)
  3. GeoTools JAI-EXT proposal
Clone this wiki locally