diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/tile/RecordTileSetRenderable.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/tile/RecordTileSetRenderable.java index 498d757e7b..fe64f6f7a1 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/tile/RecordTileSetRenderable.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/tile/RecordTileSetRenderable.java @@ -195,25 +195,28 @@ public class RecordTileSetRenderable extends TileSetRenderable { // All the images need staging, do bulk request ColorMapData data = retrieveRecordData(bigTile); - Rectangle bigTileRect = bigTile.getRectangle(); - for (int i = 0; i < numTiles; i += 1) { - Tile tile = subTiles.get(i); - DrawableImage image = images.get(i); - if (image != null) { - if (image.getImage().getStatus() == Status.UNLOADED) { - Rectangle tileRect = tile.getRectangle(); - ColorMapData subData = new ColorMapData( - BufferSlicer.slice(data.getBuffer(), - tileRect, bigTileRect), new int[] { - tileRect.width, tileRect.height }, - data.getDataType(), data.getDataUnit()); + if (data != null) { + Rectangle bigTileRect = bigTile.getRectangle(); + for (int i = 0; i < numTiles; i += 1) { + Tile tile = subTiles.get(i); + DrawableImage image = images.get(i); + if (image != null) { + if (image.getImage().getStatus() == Status.UNLOADED) { + Rectangle tileRect = tile.getRectangle(); + ColorMapData subData = new ColorMapData( + BufferSlicer.slice(data.getBuffer(), + tileRect, bigTileRect), + new int[] { tileRect.width, + tileRect.height }, + data.getDataType(), data.getDataUnit()); - callbacks.get(i).setRetrievedData(subData); - try { - image.getImage().stage(); - } catch (VizException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); + callbacks.get(i).setRetrievedData(subData); + try { + image.getImage().stage(); + } catch (VizException e) { + statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } } } } diff --git a/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSResource.java b/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSResource.java index 4c6f94d877..ee578cde12 100644 --- a/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSResource.java +++ b/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/rsc/VIIRSResource.java @@ -424,6 +424,7 @@ public class VIIRSResource extends } colorMapParameters.setDataUnit(dataUnit); + colorMapParameters.setColorMapUnit(dataUnit); colorMapParameters.setDisplayUnit(displayUnit); colorMapParameters.setColorMapMin(colorMapParameters.getDataMin()); @@ -433,12 +434,14 @@ public class VIIRSResource extends if (scale != null) { UnitConverter displayToData = colorMapParameters .getDisplayToDataConverter(); + UnitConverter displayToColorMap = colorMapParameters + .getDisplayToColorMapConverter(); if (scale.getMinValue() != null) { - colorMapParameters.setColorMapMin((float) displayToData + colorMapParameters.setColorMapMin((float) displayToColorMap .convert(scale.getMinValue())); } if (scale.getMaxValue() != null) { - colorMapParameters.setColorMapMax((float) displayToData + colorMapParameters.setColorMapMax((float) displayToColorMap .convert(scale.getMaxValue())); } if (scale.getMinValue2() != null) { diff --git a/cave/com.raytheon.uf.viz.truecolor.gl/localization/glsl/truecolor.glsl b/cave/com.raytheon.uf.viz.truecolor.gl/localization/glsl/truecolor.glsl index fc494e358b..390013fbd1 100644 --- a/cave/com.raytheon.uf.viz.truecolor.gl/localization/glsl/truecolor.glsl +++ b/cave/com.raytheon.uf.viz.truecolor.gl/localization/glsl/truecolor.glsl @@ -1,90 +1,89 @@ -#include -#include +#include // Multiplier used to store bit mask safely between 0-1 const float maskMultiplier = 8.0; +const int RED_BAND = 0; +const int GREEN_BAND = 1; +const int BLUE_BAND = 2; -uniform sampler2D rawTex; -uniform float naturalMin; -uniform float naturalMax; -uniform float cmapMin; -uniform float cmapMax; -uniform int isFloat; - -uniform int band; +uniform DataTexture rawData; +uniform DataMapping dataMapping; +uniform ColorMapping colorMapping; uniform sampler2D trueColorTexture; -uniform int height; -uniform int width; +uniform float height; +uniform float width; -uniform float noDataValue; -uniform float alphaStep; +uniform int band; uniform int expectedMask; int toBitMask(float alpha) { return int((alpha * maskMultiplier) + 0.5); } -float getIndex(sampler2D rawTex, float cmapMin, float cmapMax, float naturalMin, float naturalMax, int isFloat) { - vec4 textureValue = texture2D(rawTex, gl_TexCoord[0].st); - float naturalVal = textureValue.r; - if ( isFloat == 0 ) { - naturalVal = ((naturalVal * (naturalMax - naturalMin)) + naturalMin); - } - - float index = -1.0; - if (naturalVal != noDataValue && naturalVal == naturalVal) { - index = findIndex(naturalVal, cmapMin, cmapMax); - } - return index; +float fromBitMask(int bitMask) { + return bitMask / maskMultiplier; } -void main(void) -{ - if ( band == -1 ) { - vec4 imageVal = texture2D(rawTex,gl_TexCoord[0].st); - float r = imageVal.r; - float g = imageVal.g; - float b = imageVal.b; - float a = imageVal.a; - - // Round because of 8-bit floating point precision - int bitMask = toBitMask(a); - if (expectedMask > 0 && bitMask == expectedMask ) { - a = 1.0; - } else { - a = 0.0; - } - - gl_FragColor = vec4(r,g,b,a); +vec4 getFinalColor() { + vec4 imageVal = texture2D(trueColorTexture, gl_TexCoord[0].st); + float r = imageVal.r; + float g = imageVal.g; + float b = imageVal.b; + float a = imageVal.a; + + // Round because of 8-bit floating point precision + int bitMask = toBitMask(a); + if (expectedMask > 0 && bitMask == expectedMask) { + a = 1.0; } else { - vec2 xy = gl_FragCoord.xy; - vec4 imageVal = texture2D(rawTex,gl_TexCoord[0].st); - vec4 curVal = texture2D(trueColorTexture, vec2((xy.x / float(width)), (xy.y / float(height)))); + a = 0.0; + } + + return vec4(r, g, b, a); +} + +vec4 applyColorBand(int colorband) { + vec2 xy = gl_FragCoord.xy; + vec4 curVal = texture2D(trueColorTexture, + vec2((xy.x / width), (xy.y / height))); + + // Lookup raw data value + float dataValue = getDataValue(rawData, gl_TexCoord[0].st); + + float r = curVal.r; + float g = curVal.g; + float b = curVal.b; + float a = curVal.a; + + if (dataValue != rawData.noDataValue && dataValue == dataValue) { + // Convert dataValue to cmapValue + float cmapValue = dataToColorMapValue(dataValue, dataMapping); + float index = getColorMappingIndex(cmapValue, colorMapping); - float r = curVal.r; - float g = curVal.g; - float b = curVal.b; - float a = curVal.a; - - float index = getIndex(rawTex, cmapMin, cmapMax, naturalMin, naturalMax, isFloat); - if ( index != -1.0 ) { - int currentMask = toBitMask(a); - int bitValue = (1 << band); - if ( band == 0 && index > r ) { - r = index; - } else if ( band == 1 && index > g ) { - g = index; - } else if ( band == 2 && index > b ) { - b = index; - } - - if ( (currentMask & bitValue) == 0 ) { - // alpha does not contain this bit yet! - a = (currentMask | bitValue) / maskMultiplier; - } + int currentMask = toBitMask(a); + int bitValue = (1 << band); + if (colorband == RED_BAND && index > r) { + r = index; + } else if (colorband == GREEN_BAND && index > g) { + g = index; + } else if (colorband == BLUE_BAND && index > b) { + b = index; } - - gl_FragColor = vec4(r,g,b,a); + + if ((currentMask & bitValue) == 0) { + // alpha does not contain this bit yet! + a = fromBitMask(currentMask | bitValue); + } + } + + return vec4(r, g, b, a); +} + +void main(void) { + if (band == -1) { + gl_FragColor = getFinalColor(); + } else { + gl_FragColor = applyColorBand(band); } } \ No newline at end of file diff --git a/cave/com.raytheon.uf.viz.truecolor.gl/src/com/raytheon/uf/viz/truecolor/gl/extension/GLTrueColorImagingExtension.java b/cave/com.raytheon.uf.viz.truecolor.gl/src/com/raytheon/uf/viz/truecolor/gl/extension/GLTrueColorImagingExtension.java index 08e246b0f6..a2dfb6b56f 100644 --- a/cave/com.raytheon.uf.viz.truecolor.gl/src/com/raytheon/uf/viz/truecolor/gl/extension/GLTrueColorImagingExtension.java +++ b/cave/com.raytheon.uf.viz.truecolor.gl/src/com/raytheon/uf/viz/truecolor/gl/extension/GLTrueColorImagingExtension.java @@ -35,10 +35,13 @@ import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.truecolor.extension.ITrueColorImagingExtension; import com.raytheon.uf.viz.truecolor.gl.image.GLTrueColorImage; import com.raytheon.viz.core.gl.ext.GLOffscreenRenderingExtension; +import com.raytheon.viz.core.gl.ext.imaging.GLColormappedImageExtension; +import com.raytheon.viz.core.gl.ext.imaging.GLDataMappingFactory.GLDataMapping; import com.raytheon.viz.core.gl.glsl.AbstractGLSLImagingExtension; +import com.raytheon.viz.core.gl.glsl.GLSLStructFactory; import com.raytheon.viz.core.gl.glsl.GLShaderProgram; +import com.raytheon.viz.core.gl.images.AbstractGLColormappedImage; import com.raytheon.viz.core.gl.images.AbstractGLImage; -import com.raytheon.viz.core.gl.images.GLColormappedImage; /** * GL implementation of the {@link ITrueColorImagingExtension} @@ -64,9 +67,6 @@ public class GLTrueColorImagingExtension extends AbstractGLSLImagingExtension private Channel renderingChannel; - /** The current rendering bit mask, specifies what bands we rendered */ - private int currentMask = 0; - private Map parameters = new IdentityHashMap(); /* @@ -111,7 +111,6 @@ public class GLTrueColorImagingExtension extends AbstractGLSLImagingExtension GLTrueColorImage trueColorImage = (GLTrueColorImage) image; if (trueColorImage.isRepaint()) { // Reset current bit mask - currentMask = 0; parameters.clear(); writeToImage = trueColorImage; GLOffscreenRenderingExtension extension = target @@ -125,9 +124,6 @@ public class GLTrueColorImagingExtension extends AbstractGLSLImagingExtension DrawableImage[] imagesToDraw = trueColorImage .getImages(channel); if (imagesToDraw != null && imagesToDraw.length > 0) { - // Mark the channel bit in the current bit mask - currentMask |= (1 << channel.ordinal()); - // Make sure images are staged before we mosaic them ImagingSupport.prepareImages(target, imagesToDraw); @@ -160,12 +156,17 @@ public class GLTrueColorImagingExtension extends AbstractGLSLImagingExtension imageCoverage)); return null; } - } else { + } else if (image instanceof AbstractGLColormappedImage) { GL gl = target.getGl(); + + GLColormappedImageExtension.setupDataMapping(gl, + (AbstractGLColormappedImage) image, GL.GL_TEXTURE2, + GL.GL_TEXTURE3); // bind on GL_TEXTURE1 as 0 is channel image writeToImage.bind(gl, GL.GL_TEXTURE1); return image; } + return null; } /* @@ -190,6 +191,13 @@ public class GLTrueColorImagingExtension extends AbstractGLSLImagingExtension // Unbind the writeToImage from GL_TEXTURE1 gl.glActiveTexture(GL.GL_TEXTURE1); gl.glBindTexture(writeToImage.getTextureStorageType(), 0); + + // Unbind the data mapped textures + gl.glActiveTexture(GL.GL_TEXTURE2); + gl.glBindTexture(GL.GL_TEXTURE_1D, 0); + + gl.glActiveTexture(GL.GL_TEXTURE3); + gl.glBindTexture(GL.GL_TEXTURE_1D, 0); } } @@ -206,36 +214,41 @@ public class GLTrueColorImagingExtension extends AbstractGLSLImagingExtension public void loadShaderData(GLShaderProgram program, IImage image, PaintProperties paintProps) throws VizException { if (image instanceof GLTrueColorImage) { + GLTrueColorImage glImage = (GLTrueColorImage) image; program.setUniform("band", -1); - program.setUniform("rawTex", 0); - program.setUniform("expectedMask", currentMask); + program.setUniform("trueColorTexture", 0); + program.setUniform("expectedMask", glImage.getColorMask()); } else { - if (image instanceof GLColormappedImage == false) { + if (image instanceof AbstractGLColormappedImage == false) { throw new VizException( "Can only render colormapped images in true color"); } - GLColormappedImage cmapImage = (GLColormappedImage) image; + AbstractGLColormappedImage cmapImage = (AbstractGLColormappedImage) image; ColorMapParameters colorMapParameters = cmapImage .getColorMapParameters(); - parameters.put(colorMapParameters, null); - int textureType = cmapImage.getTextureType(); - // Set the band image data - program.setUniform("rawTex", 0); - program.setUniform("naturalMin", colorMapParameters.getDataMin()); - program.setUniform("naturalMax", colorMapParameters.getDataMax()); - program.setUniform("cmapMin", colorMapParameters.getColorMapMin()); - program.setUniform("cmapMax", colorMapParameters.getColorMapMax()); - program.setUniform("isFloat", textureType == GL.GL_FLOAT - || textureType == GL.GL_HALF_FLOAT_ARB ? 1 : 0); - program.setUniform("noDataValue", + parameters.put(colorMapParameters, null); + + GLSLStructFactory.createDataTexture(program, "rawData", 0, + cmapImage.getDataFormat(), colorMapParameters.getNoDataValue()); + int numMappingValues = 0; + GLDataMapping mapping = cmapImage.getDataMapping(); + if (mapping != null && mapping.isValid()) { + numMappingValues = mapping.getNumMappingValues(); + } + GLSLStructFactory.createDataMapping(program, "dataMapping", 2, 3, + numMappingValues); + + GLSLStructFactory.createColorMapping(program, "colorMapping", -1, + -1, colorMapParameters); + // Set the composite image data program.setUniform("trueColorTexture", 1); - program.setUniform("width", writeToImage.getWidth()); - program.setUniform("height", writeToImage.getHeight()); + program.setUniform("width", (float) writeToImage.getWidth()); + program.setUniform("height", (float) writeToImage.getHeight()); // Set the band we are rendering to program.setUniform("band", renderingChannel.ordinal()); diff --git a/cave/com.raytheon.uf.viz.truecolor.gl/src/com/raytheon/uf/viz/truecolor/gl/image/GLTrueColorImage.java b/cave/com.raytheon.uf.viz.truecolor.gl/src/com/raytheon/uf/viz/truecolor/gl/image/GLTrueColorImage.java index 90adf35fdd..27a35e7c8f 100644 --- a/cave/com.raytheon.uf.viz.truecolor.gl/src/com/raytheon/uf/viz/truecolor/gl/image/GLTrueColorImage.java +++ b/cave/com.raytheon.uf.viz.truecolor.gl/src/com/raytheon/uf/viz/truecolor/gl/image/GLTrueColorImage.java @@ -97,6 +97,22 @@ public class GLTrueColorImage extends GLDelegateImage implements this.imageExtent = imageExtent; } + /** + * Returns a bitmask of the expected RGB components to render + * + * @return + */ + public int getColorMask() { + int colorMask = 0; + for (Channel channel : Channel.values()) { + DrawableImage[] images = getImages(channel); + if (images != null && images.length > 0) { + colorMask |= (1 << channel.ordinal()); + } + } + return colorMask; + } + /** * @return the imageExtent */ diff --git a/cave/com.raytheon.viz.core.gl/localization/glsl/colormap.glsl b/cave/com.raytheon.viz.core.gl/localization/glsl/colormap.glsl index 677106250b..0eb7dbeeca 100644 --- a/cave/com.raytheon.viz.core.gl/localization/glsl/colormap.glsl +++ b/cave/com.raytheon.viz.core.gl/localization/glsl/colormap.glsl @@ -1,24 +1,21 @@ // Simple shader program for applying alpha,brightness, and contrast to the // colormap in the same way they are applied to data +#include +#include -#include -#include - -uniform float brightness; -uniform float contrast; -uniform float alphaVal; +uniform ColorMapping colorMapping; +uniform ColorModifiers modifiers; uniform float bkgrndRed; uniform float bkgrndGreen; uniform float bkgrndBlue; -uniform sampler1D colorMap; -uniform sampler2D alphaMask; - -uniform int applyMask; -uniform float logFactor; - void main(void){ + sampler1D colorMap = colorMapping.colorMap; + float logFactor = colorMapping.logFactor; + int applyMask = colorMapping.applyMask; + sampler1D alphaMask = colorMapping.alphaMask; + // Lookup color in colorMap for index float index = gl_TexCoord[0].s; if ( logFactor > 0.0 ) { @@ -29,10 +26,11 @@ void main(void){ // Apply alpha mask if set float alpha = color.a; if ( applyMask == 1 ) { - if ( texture2D(alphaMask , vec2(index,index) ).r != 0.0 ) { + if ( texture1D(alphaMask , index ).r != 0.0 ) { color = vec4(bkgrndRed, bkgrndGreen, bkgrndBlue, alpha); } } + if(alpha < 1.0){ // blend the color with background color, the colorbar should not be transparent alpha = 1.0; @@ -42,5 +40,5 @@ void main(void){ alpha); } - gl_FragColor = applyContrastAlphaBrightness(color, alphaVal, brightness, contrast); + gl_FragColor = applyColorModifiers(color, modifiers); } \ No newline at end of file diff --git a/cave/com.raytheon.viz.core.gl/localization/glsl/colormapRaster.glsl b/cave/com.raytheon.viz.core.gl/localization/glsl/colormapRaster.glsl index 611851ddf7..3be30b1856 100644 --- a/cave/com.raytheon.viz.core.gl/localization/glsl/colormapRaster.glsl +++ b/cave/com.raytheon.viz.core.gl/localization/glsl/colormapRaster.glsl @@ -1,56 +1,24 @@ -#include -#include +#include +#include -uniform float alpha; -uniform float brightness; -uniform float contrast; -uniform int applyMask; -uniform float naturalMin; -uniform float naturalMax; -uniform float cmapMin; -uniform float cmapMax; -uniform sampler1D colorMap; -uniform sampler2D alphaMask; -uniform sampler2D rawTex; -uniform float colorMapSz; -uniform int isFloat; -uniform int logarithmic; -uniform int mirror; -uniform float logFactor; +uniform DataTexture rawData; +uniform DataMapping dataMapping; +uniform ColorMapping colorMapping; +uniform ColorModifiers modifiers; void main(void) { - vec4 textureColor = texture2D(rawTex, gl_TexCoord[0].st); - float index = 0.0; - float rawValue = textureColor.r; - if ( isFloat == 1 ) { - if ( logarithmic == 1 ) { - index = findFloatIndexLog(rawValue, cmapMin, cmapMax, mirror); - } else { - index = findFloatIndex(rawValue, cmapMin, cmapMax); - } - - // Special float handling, -1.0 is NaN - if (index == -1.0){ - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); - return; - } - } else { - float naturalValue = ((rawValue * (naturalMax - naturalMin)) + naturalMin); - index = findIndex(naturalValue, cmapMin, cmapMax); - } - - // Lookup color in colorMap for index - if ( logFactor > 0.0 ) { - index = getLogFactorIndex(index, logFactor); - } - textureColor = texture1D(colorMap, index).rgba; - - // Apply alpha mask - if ( applyMask == 1 ) { - if ( texture2D(alphaMask , vec2(index,index) ).r != 0.0 ) { - textureColor = vec4(textureColor.rgb, 0.0); - } + float dataValue = getDataValue(rawData, gl_TexCoord[0].st); + + // No data check/special NaN check + if (dataValue == rawData.noDataValue || dataValue != dataValue) { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + return; } - gl_FragColor = applyContrastAlphaBrightness(textureColor, alpha, brightness, contrast); + // Convert dataValue to cmapValue + float cmapValue = dataToColorMapValue(dataValue, dataMapping); + // Get color for colormapping, given value + vec4 textureColor = getColorByValue(cmapValue, colorMapping); + // Apply the color modifiers into gl_FragColor + gl_FragColor = applyColorModifiers(textureColor, modifiers); } \ No newline at end of file diff --git a/cave/com.raytheon.viz.core.gl/localization/glsl/include/colorUtil.glsl b/cave/com.raytheon.viz.core.gl/localization/glsl/include/colorUtil.glsl deleted file mode 100644 index a448be537d..0000000000 --- a/cave/com.raytheon.viz.core.gl/localization/glsl/include/colorUtil.glsl +++ /dev/null @@ -1,34 +0,0 @@ - -vec3 AvgLuminance = vec3(0.5, 0.5, 0.5); - -/** - * This function applies the specified alpha, brightness, and contrast values - * to the color passed in - */ -vec4 applyContrastAlphaBrightness(vec4 color, float alpha, float brightness, float contrast){ - vec3 textureColor3 = vec3(color); - vec3 adjustedColor = mix(AvgLuminance, textureColor3, contrast); - float curAlpha = min(color.a, alpha); - return vec4(adjustedColor.r * brightness, adjustedColor.g * brightness, adjustedColor.b * brightness, curAlpha); -} - -/** - * This function calculates a new index to use based on the logFactor - */ -float getLogFactorIndex(float index, float logFactor) { - if (logFactor > 0.0){ - float minLog = log(logFactor); - float maxLog = log(logFactor + 1.0); - - float lg = log(logFactor + index); - - index = (lg - minLog) / (maxLog - minLog); - if (index < 0.0){ - index = 0.0; - } - else if (index > 1.0){ - index = 1.0; - } - } - return index; -} \ No newline at end of file diff --git a/cave/com.raytheon.viz.core.gl/localization/glsl/include/coloring.glsl b/cave/com.raytheon.viz.core.gl/localization/glsl/include/coloring.glsl new file mode 100644 index 0000000000..1bad90a781 --- /dev/null +++ b/cave/com.raytheon.viz.core.gl/localization/glsl/include/coloring.glsl @@ -0,0 +1,23 @@ + +struct ColorModifiers { + float alpha; + float brightness; + float contrast; +}; + +vec3 AvgLuminance = vec3(0.5, 0.5, 0.5); + +/** + * This function applies the specified ColorModifier values to the + * color passed in + */ +vec4 applyColorModifiers(vec4 color, ColorModifiers modifiers){ + float alpha = modifiers.alpha; + float brightness = modifiers.brightness; + float contrast = modifiers.contrast; + + vec3 textureColor3 = vec3(color); + vec3 adjustedColor = mix(AvgLuminance, textureColor3, contrast); + float curAlpha = min(color.a, alpha); + return vec4(adjustedColor.r * brightness, adjustedColor.g * brightness, adjustedColor.b * brightness, curAlpha); +} diff --git a/cave/com.raytheon.viz.core.gl/localization/glsl/include/indexing.glsl b/cave/com.raytheon.viz.core.gl/localization/glsl/include/indexing.glsl deleted file mode 100644 index c1fdfeae96..0000000000 --- a/cave/com.raytheon.viz.core.gl/localization/glsl/include/indexing.glsl +++ /dev/null @@ -1,104 +0,0 @@ - -float HALF_FLOAT_NaN = 65504.0; - -/** - * This function takes an index number and caps it to the range 0-1 - */ -float capIndex(float index) { - if ( index < 0.0 ) { - index = 0.0; - } else if ( index > 1.0 ) { - index = 1.0; - } - return index; -} - -/** - * This function linearly finds the index for the rawValue into cmapMin/cmapMax. - * 65504.0 is treated as NaN for half floats and -1 is returned as special case - */ -float findFloatIndex(float rawValue, float cmapMin, float cmapMax) { - if ( rawValue == HALF_FLOAT_NaN || rawValue != rawValue) { - return -1.0; - } - float index = ((rawValue - cmapMin) / abs(cmapMax-cmapMin)); - return capIndex(index); -} - -/** - * This function logarithmically finds the index for the rawValue into cmapMin/cmapMax. - * 65504.0 is treated as NaN for half floats and -1 is returned as special case - */ -float findFloatIndexLog(float rawValue, float cmapMin, float cmapMax, int mirror) { - if ( rawValue == HALF_FLOAT_NaN ) { - return -1.0; - } - - float index = 0.0; - // is this strictly negative, strictly positive or neg to pos scaling? - if ( cmapMin >= 0.0 && cmapMax >= 0.0 && mirror!=1) { - if(rawValue < cmapMin){ - index = 0.0; - }else{ - // simple calculation - index = ((log(rawValue) - log(cmapMin)) / abs(log(cmapMax)-log(cmapMin))); - } - } else if (cmapMin <= 0.0 && cmapMax <= 0.0 && mirror!=1) { - index = ((log(rawValue) - log(cmapMax)) / abs(log(cmapMin)-log(cmapMax))); - } else { - // special case, neg to pos: - float colorMapMin = cmapMin; - float colorMapMax = cmapMax; - float zeroVal = max(colorMapMax, abs(colorMapMin)) * 0.0001; - if (mirror==1 && (colorMapMin > 0.0 || colorMapMax < 0.0)) { - if (colorMapMax < 0.0) { - colorMapMax = -cmapMax; - rawValue = -rawValue; - zeroVal = -colorMapMin; - } else { - zeroVal = cmapMin; - } - colorMapMin = -cmapMax; - } - float leftZero = 0.0; - float rightZero = 0.0; - float absLogZeroVal = abs(log(zeroVal)); - - rightZero = absLogZeroVal + log(colorMapMax); - - float cmapMax2 = abs(colorMapMin); - - leftZero = absLogZeroVal + log(cmapMax2); - - float zeroIndex = leftZero / (leftZero + rightZero); - - // figure out index for texture val - float absTextureColor = abs(rawValue); - if (absTextureColor <= zeroVal) { - index = zeroIndex; - } else if (rawValue > 0.0) { - // positive texture color value, find index from 0 to - // cmapMax: - float logTexColor = absLogZeroVal + log(rawValue); - - float texIndex = logTexColor / rightZero; - index = (zeroIndex + ((1.0 - zeroIndex) * texIndex)); - } else { - // negative texture color value, find index from 0 to - // cmapMax: - float logTexColor = absLogZeroVal + log(absTextureColor); - - float texIndex = logTexColor / leftZero; - index = (zeroIndex - (zeroIndex * texIndex)); - } - } - return capIndex(index); -} - -/** - * Given a raw data value linearly determine the index(0-1) into cmapMin/cmapMax - */ -float findIndex(float rawValue, float cmapMin, float cmapMax) { - float index = ((rawValue - cmapMin) / abs(cmapMax-cmapMin)); - return capIndex(index); -} diff --git a/cave/com.raytheon.viz.core.gl/localization/glsl/include/mapping.glsl b/cave/com.raytheon.viz.core.gl/localization/glsl/include/mapping.glsl new file mode 100644 index 0000000000..8ded421d66 --- /dev/null +++ b/cave/com.raytheon.viz.core.gl/localization/glsl/include/mapping.glsl @@ -0,0 +1,299 @@ +/** + * Mapping glsl library for use by other glsl programs. Defines + * commonly used structures and functions for data and color mapping + */ + +/** + * Fields for the raw texture mapping is applied to. isScaled + * implied data will range 0-1 and need scaling to get raw value + * where scaleMin maps to 0 and scaleMax maps to 1. + */ +struct DataTexture { + sampler2D rawTex; + float noDataValue; + int isScaled; + float scaleMin; + float scaleMax; +}; + +/** + * Fields used for converting from image data values to + * colormapping data values. Done to avoid conversions in + * application code. dmv[i] -> cmv[i]. Linear interpolation + * is done where non-exact matches are found. Mappings should + * be uploaded as floats so no scaling is needed + */ +struct DataMapping { + sampler1D dataMappingValues; + sampler1D colorMappingValues; + int numMappingValues; +}; + +struct ColorMapping { + /** Fields for color map and size. colorMap contains colors to + * use for mapping. cmapMin/Max is range colormap is applied over */ + sampler1D colorMap; + float cmapMin; + float cmapMax; + + /** Field for alpha masking the colors. alphaMask is a texture the + * same size as colorMap and contains 0s and 1s, 1 indicating alpha + * should be set to completely transparent */ + int applyMask; + sampler1D alphaMask; + + /** Fields for logarithmic and mirrored indexing into the colorMap */ + int isMirrored; + float logFactor; + int isLogarithmic; +}; + +/** + * Returns the data value for the DataTexture at location. + */ +float getDataValue(DataTexture texture, vec2 location) { + vec4 textureValue = texture2D(texture.rawTex, location); + float dataValue = textureValue.r; + + if (texture.isScaled == 1) { + // Convert to non-scaled value + dataValue = ((dataValue * (texture.scaleMax - texture.scaleMin)) + + texture.scaleMin); + } + return dataValue; +} + +/** + * Looks up a value in a mapping texture given an index [0-numMappingValues). + */ +float lookupMappingValue(sampler1D mappingTex, int index, + int numMappingValues) { + return texture1D(mappingTex, float(index) / float(numMappingValues - 1)).r; +} + +/** + * Converts a data value into a colorMap value given the DataMapping + */ +float dataToColorMapValue(float dataValue, DataMapping mapping) { + int numMappingValues = mapping.numMappingValues; + if (numMappingValues == 0) { + // Short circuit if no mapping is needed + return dataValue; + } + + // Convert to colormap value + int lowIndex = 0; + int highIndex = numMappingValues - 1; + + float lowValue = lookupMappingValue(mapping.dataMappingValues, lowIndex, + numMappingValues); + float highValue = lookupMappingValue(mapping.dataMappingValues, highIndex, + numMappingValues); + int reversed = 0; + if (lowValue > highValue) { + reversed = 1; + float tmp = lowValue; + lowValue = highValue; + highValue = tmp; + } + + int done = 0; + // While there is at least one index to check + while (done == 0) { + int nextIndex = lowIndex + ((highIndex - lowIndex) / 2); + if (nextIndex > lowIndex && nextIndex < highIndex) { + // Look up next value and determine if it is a high or low + float nextValue = lookupMappingValue(mapping.dataMappingValues, nextIndex, + numMappingValues); + if (nextValue < dataValue) { + if (reversed == 0) { + lowIndex = nextIndex; + } else { + highIndex = nextIndex; + } + lowValue = nextValue; + } else { + if (reversed == 0) { + highIndex = nextIndex; + } else { + lowIndex = nextIndex; + } + highValue = nextValue; + } + } else { + done = 1; + } + } + + // Percentage dataValue is linearly between low and high value + float factor = (dataValue - lowValue) / (highValue - lowValue); + if (reversed == 1) { + // Reverse factor for high->low indexing + factor = 1.0 - factor; + } + + float lowCmapValue = lookupMappingValue(mapping.colorMappingValues, lowIndex, + numMappingValues); + float highCmapValue = lookupMappingValue(mapping.colorMappingValues, highIndex, + numMappingValues); + + return lowCmapValue + (highCmapValue - lowCmapValue) * factor; +} + +/** + * This function takes an index number and caps it to the range 0-1 + */ +float capIndex(float index) { + if (index < 0.0) { + index = 0.0; + } else if (index > 1.0) { + index = 1.0; + } + return index; +} + +/** + * Given a colorMap value linearly determine the index (capped at 0-1) + * into cmapMin/cmapMax + */ +float getLinearIndex(float cmapValue, float cmapMin, float cmapMax) { + float index = (cmapValue - cmapMin) / (cmapMax - cmapMin); + return capIndex(index); +} + +/** + * This function logarithmically finds the index for the cmapValue into + * cmapMin/cmapMax (capped at 0-1). + */ +float getLogIndex(float cmapValue, float cmapMin, float cmapMax, int mirror) { + float index = 0.0; + // is this strictly negative, strictly positive or neg to pos scaling? + if (cmapMin >= 0.0 && cmapMax >= 0.0 && mirror != 1) { + if (cmapValue < cmapMin) { + index = 0.0; + } else { + // simple calculation + index = ((log(cmapValue) - log(cmapMin)) + / abs(log(cmapMax) - log(cmapMin))); + } + } else if (cmapMin <= 0.0 && cmapMax <= 0.0 && mirror != 1) { + index = ((log(cmapValue) - log(cmapMax)) + / abs(log(cmapMin) - log(cmapMax))); + } else { + // special case, neg to pos: + float colorMapMin = cmapMin; + float colorMapMax = cmapMax; + float zeroVal = max(colorMapMax, abs(colorMapMin)) * 0.0001; + if (mirror == 1 && (colorMapMin > 0.0 || colorMapMax < 0.0)) { + if (colorMapMax < 0.0) { + colorMapMax = -cmapMax; + cmapValue = -cmapValue; + zeroVal = -colorMapMin; + } else { + zeroVal = cmapMin; + } + colorMapMin = -cmapMax; + } + float leftZero = 0.0; + float rightZero = 0.0; + float absLogZeroVal = abs(log(zeroVal)); + + rightZero = absLogZeroVal + log(colorMapMax); + + float cmapMax2 = abs(colorMapMin); + + leftZero = absLogZeroVal + log(cmapMax2); + + float zeroIndex = leftZero / (leftZero + rightZero); + + // figure out index for texture val + float absTextureColor = abs(cmapValue); + if (absTextureColor <= zeroVal) { + index = zeroIndex; + } else if (cmapValue > 0.0) { + // positive texture color value, find index from 0 to + // cmapMax: + float logTexColor = absLogZeroVal + log(cmapValue); + + float texIndex = logTexColor / rightZero; + index = (zeroIndex + ((1.0 - zeroIndex) * texIndex)); + } else { + // negative texture color value, find index from 0 to + // cmapMax: + float logTexColor = absLogZeroVal + log(absTextureColor); + + float texIndex = logTexColor / leftZero; + index = (zeroIndex - (zeroIndex * texIndex)); + } + } + return capIndex(index); +} + +/** + * This function calculates a new index to use based on the logFactor + * and passed in index + */ +float getLogFactorIndex(float index, float logFactor) { + if (logFactor > 0.0) { + float minLog = log(logFactor); + float maxLog = log(logFactor + 1.0); + + float lg = log(logFactor + index); + + index = (lg - minLog) / (maxLog - minLog); + if (index < 0.0) { + index = 0.0; + } else if (index > 1.0) { + index = 1.0; + } + } + return index; +} + +/** + * Returns an index for the cmapValue based on the ColorMapping + */ +float getColorMappingIndex(float cmapValue, ColorMapping colorMapping) { + int logarithmic = colorMapping.isLogarithmic; + int mirror = colorMapping.isMirrored; + float logFactor = colorMapping.logFactor; + float cmapMin = colorMapping.cmapMin; + float cmapMax = colorMapping.cmapMax; + + float index; + if (logarithmic == 1) { + index = getLogIndex(cmapValue, cmapMin, cmapMax, mirror); + } else { + index = getLinearIndex(cmapValue, cmapMin, cmapMax); + } + + // Apply logFactor if set + if (logFactor > 0.0) { + index = getLogFactorIndex(index, logFactor); + } + return index; +} + +/** + * Returns a color for the index based on the ColorMapping + */ +vec4 getColorByIndex(float index, ColorMapping colorMapping) { + // Lookup color in colorMap for index + vec4 textureColor = texture1D(colorMapping.colorMap, index).rgba; + + // Apply alpha mask + if (colorMapping.applyMask == 1) { + if (texture1D(colorMapping.alphaMask, index).r != 0.0) { + textureColor = vec4(textureColor.rgb, 0.0); + } + } + return textureColor; +} + +/** + * Returns a color for the cmapValue based on the ColorMapping + */ +vec4 getColorByValue(float cmapValue, ColorMapping colorMapping) { + return getColorByIndex(getColorMappingIndex(cmapValue, colorMapping), + colorMapping); +} \ No newline at end of file diff --git a/cave/com.raytheon.viz.core.gl/localization/glsl/raster.glsl b/cave/com.raytheon.viz.core.gl/localization/glsl/raster.glsl index a682fb1742..33237e532e 100644 --- a/cave/com.raytheon.viz.core.gl/localization/glsl/raster.glsl +++ b/cave/com.raytheon.viz.core.gl/localization/glsl/raster.glsl @@ -1,11 +1,9 @@ -#include +#include -uniform float brightness; -uniform float contrast; -uniform float alpha; uniform sampler2D rawTex; +uniform ColorModifiers modifiers; void main(void) { vec4 textureColor = texture2D(rawTex, gl_TexCoord[0].st); - gl_FragColor = applyContrastAlphaBrightness(textureColor, alpha, brightness, contrast); + gl_FragColor = applyColorModifiers(textureColor, modifiers); } \ No newline at end of file diff --git a/cave/com.raytheon.viz.core.gl/localization/glsl/singleColor.glsl b/cave/com.raytheon.viz.core.gl/localization/glsl/singleColor.glsl index c1b999b79a..0b4f5267dc 100644 --- a/cave/com.raytheon.viz.core.gl/localization/glsl/singleColor.glsl +++ b/cave/com.raytheon.viz.core.gl/localization/glsl/singleColor.glsl @@ -1,13 +1,11 @@ -#include +#include -uniform float brightness; -uniform float contrast; -uniform float alpha; uniform sampler2D rawTex; uniform vec3 color; +uniform ColorModifiers modifiers; void main(void) { vec4 textureColor = texture2D(rawTex, gl_TexCoord[0].st); textureColor.rgb = color; - gl_FragColor = applyContrastAlphaBrightness(textureColor, alpha, brightness, contrast); + gl_FragColor = applyColorModifiers(textureColor, modifiers); } \ No newline at end of file diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/dataformat/AbstractGLColorMapDataFormat.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/dataformat/AbstractGLColorMapDataFormat.java index 4480a8fab5..09beda646f 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/dataformat/AbstractGLColorMapDataFormat.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/dataformat/AbstractGLColorMapDataFormat.java @@ -217,7 +217,7 @@ public abstract class AbstractGLColorMapDataFormat { protected Buffer handleBufferSizing(GLColorMapData data, Buffer buffer, int[] dimensions) { int sliceWidth = dimensions[0] * getValuesPerPixel(); - int sliceHeight = dimensions[1]; + int sliceHeight = dimensions.length > 1 ? dimensions[1] : 1; int paddedSliceWidth = getAlignedWidth(sliceWidth); int totalDataSize = buffer.capacity(); diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/dataformat/GLColorMapData.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/dataformat/GLColorMapData.java index 06cbf805eb..2bd116a36b 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/dataformat/GLColorMapData.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/dataformat/GLColorMapData.java @@ -54,6 +54,10 @@ public class GLColorMapData { this.dimensions = dimensions; } + public AbstractGLColorMapDataFormat getDataFormat() { + return dataFormat; + } + public int getTextureFormat() { return dataFormat.getTextureFormat(); } @@ -93,6 +97,10 @@ public class GLColorMapData { return dimensions[index]; } + public int getNumDimensions() { + return dimensions.length; + } + public int[] getDimensions() { return dimensions; } diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLColormappedImageExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLColormappedImageExtension.java index 98d1b9ab54..4afc4d21ea 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLColormappedImageExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLColormappedImageExtension.java @@ -21,9 +21,11 @@ package com.raytheon.viz.core.gl.ext.imaging; import java.nio.ByteBuffer; +import javax.measure.unit.Unit; import javax.media.opengl.GL; import com.raytheon.uf.common.colormap.image.ColorMapData; +import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; import com.raytheon.uf.viz.core.PixelCoverage; import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback; @@ -32,10 +34,15 @@ import com.raytheon.uf.viz.core.drawables.IImage; import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.ext.colormap.IColormappedImageExtension; import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.viz.core.gl.dataformat.GLByteDataFormat; +import com.raytheon.viz.core.gl.ext.imaging.GLDataMappingFactory.GLDataMapping; import com.raytheon.viz.core.gl.glsl.AbstractGLSLImagingExtension; +import com.raytheon.viz.core.gl.glsl.GLSLStructFactory; import com.raytheon.viz.core.gl.glsl.GLShaderProgram; import com.raytheon.viz.core.gl.images.AbstractGLColormappedImage; import com.raytheon.viz.core.gl.images.AbstractGLImage; +import com.raytheon.viz.core.gl.images.GLBufferCMTextureData; +import com.raytheon.viz.core.gl.images.GLCMTextureData; import com.raytheon.viz.core.gl.images.GLColormappedImage; import com.raytheon.viz.core.gl.objects.GLTextureObject; @@ -53,7 +60,8 @@ import com.raytheon.viz.core.gl.objects.GLTextureObject; * Feb 14, 2013 1616 bsteffen Add option for interpolation of colormap * parameters, disable colormap interpolation * by default. - * Oct 16, 2013 2333 mschenke Cleaned up load shader method, used isScaled + * Oct 16, 2013 2333 mschenke Cleaned up load shader method, used isScaled. + * Added support for colormapping in non-data unit. * * * @@ -65,7 +73,7 @@ public class GLColormappedImageExtension extends AbstractGLSLImagingExtension implements IColormappedImageExtension { private static class GLColormappedImageExtensionData { - public GLColormappedImage alphaMaskTexture; + public GLCMTextureData alphaMask; } /* @@ -108,31 +116,10 @@ public class GLColormappedImageExtension extends AbstractGLSLImagingExtension return null; } - if (usedColorMapParameters.isUseMask()) { - final byte[] mask = usedColorMapParameters.getAlphaMask(); - data.alphaMaskTexture = initializeRaster( - new IColorMapDataRetrievalCallback() { - @Override - public ColorMapData getColorMapData() - throws VizException { - return new ColorMapData(ByteBuffer.wrap(mask), - new int[] { mask.length, 1 }); - } - }, usedColorMapParameters); - data.alphaMaskTexture.stage(); - data.alphaMaskTexture.target(target); - } - // Get and stage colormap texture GLTextureObject cmapTexture = target .getColorMapTexture(usedColorMapParameters); - if (data.alphaMaskTexture != null) { - gl.glActiveTexture(GL.GL_TEXTURE2); - gl.glBindTexture(data.alphaMaskTexture.getTextureStorageType(), - data.alphaMaskTexture.getTextureid()); - } - gl.glActiveTexture(GL.GL_TEXTURE1); cmapTexture.bind(gl, GL.GL_TEXTURE_1D); @@ -147,10 +134,97 @@ public class GLColormappedImageExtension extends AbstractGLSLImagingExtension gl.glTexParameteri(GL.GL_TEXTURE_1D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); } + + if (usedColorMapParameters.isUseMask()) { + data.alphaMask = setupAlphaMasking(gl, GL.GL_TEXTURE2, + usedColorMapParameters.getAlphaMask()); + } + + setupDataMapping(gl, glImage, GL.GL_TEXTURE3, GL.GL_TEXTURE4); } return data; } + /** + * Sets up a {@link GLCMTextureData} for an alpha mask for use in image + * rendering + * + * @param gl + * @param maskTexBinding + * @param mask + * @return The GLCMTextureData the alpha mask is bound to or null if the + * texture failed to initialize + * @throws VizException + */ + public static GLCMTextureData setupAlphaMasking(GL gl, int maskTexBinding, + byte[] mask) throws VizException { + GLBufferCMTextureData maskData = new GLBufferCMTextureData( + new ColorMapData(ByteBuffer.wrap(mask), + new int[] { mask.length }, ColorMapDataType.BYTE), + new GLByteDataFormat()); + gl.glActiveTexture(maskTexBinding); + if (maskData.loadTexture(gl)) { + gl.glBindTexture(maskData.getTextureStorageType(), + maskData.getTexId()); + } else { + maskData.dispose(); + maskData = null; + } + return maskData; + } + + /** + * Sets up a {@link GLDataMapping} for use in image rendering + * + * @param gl + * @param glImage + * @param dataMappedTexBinding + * @param colorMappedTexBinding + * @throws VizException + */ + public static void setupDataMapping(GL gl, + AbstractGLColormappedImage glImage, int dataMappedTexBinding, + int colorMappedTexBinding) throws VizException { + ColorMapParameters colorMapParameters = glImage.getColorMapParameters(); + // Get GLDataMapping and generate if datamapping is not set. If + // datamapping is not set, the data has already been mapped to + // colorMapUnits and we need not do anything + GLDataMapping dataMapping = glImage.getDataMapping(); + if (dataMapping == null && colorMapParameters.getDataMapping() == null) { + Unit colorMapUnit = colorMapParameters.getColorMapUnit(); + Unit dataUnit = colorMapParameters.getDataUnit(); + int colorMapSize = colorMapParameters.getColorMap().getSize(); + float colorMapMin = colorMapParameters.getColorMapMin(); + float colorMapMax = colorMapParameters.getColorMapMax(); + dataMapping = GLDataMappingFactory.constructGLDataMapping(gl, + dataUnit, colorMapUnit, colorMapMin, colorMapMax, + colorMapSize); + glImage.setDataMapping(dataMapping); + } + + if (dataMapping != null && dataMapping.isValid()) { + GLCMTextureData glDataMapping = dataMapping.getDataMapping(); + gl.glActiveTexture(dataMappedTexBinding); + if (glDataMapping.isLoaded() == false) { + glDataMapping.loadTexture(gl); + } + if (glDataMapping.isLoaded()) { + gl.glBindTexture(glDataMapping.getTextureStorageType(), + glDataMapping.getTexId()); + } + + GLCMTextureData glColorMapping = dataMapping.getColorMapping(); + gl.glActiveTexture(colorMappedTexBinding); + if (glColorMapping.isLoaded() == false) { + glColorMapping.loadTexture(gl); + } + if (glColorMapping.isLoaded()) { + gl.glBindTexture(glColorMapping.getTextureStorageType(), + glColorMapping.getTexId()); + } + } + } + /* * (non-Javadoc) * @@ -164,16 +238,22 @@ public class GLColormappedImageExtension extends AbstractGLSLImagingExtension AbstractGLImage image, Object data) throws VizException { GLColormappedImageExtensionData imageData = (GLColormappedImageExtensionData) data; GL gl = target.getGl(); - if (imageData.alphaMaskTexture != null) { - gl.glActiveTexture(GL.GL_TEXTURE2); - gl.glBindTexture( - imageData.alphaMaskTexture.getTextureStorageType(), 0); - - imageData.alphaMaskTexture.dispose(); - } gl.glActiveTexture(GL.GL_TEXTURE1); gl.glBindTexture(GL.GL_TEXTURE_1D, 0); + + if (imageData.alphaMask != null) { + gl.glActiveTexture(GL.GL_TEXTURE2); + gl.glBindTexture(imageData.alphaMask.getTextureStorageType(), 0); + + imageData.alphaMask.dispose(); + } + + gl.glActiveTexture(GL.GL_TEXTURE3); + gl.glBindTexture(GL.GL_TEXTURE_1D, 0); + + gl.glActiveTexture(GL.GL_TEXTURE4); + gl.glBindTexture(GL.GL_TEXTURE_1D, 0); } /* @@ -210,40 +290,22 @@ public class GLColormappedImageExtension extends AbstractGLSLImagingExtension ColorMapParameters colorMapParameters = image.getColorMapParameters(); - program.setUniform("colorMapSz", colorMapParameters.getColorMap() - .getSize()); - boolean isScaled = image.isImageFormatScaled(); - double dataMin = colorMapParameters.getDataMin(); - double dataMax = colorMapParameters.getDataMax(); - if (isScaled) { - // get format from image and get data min/max from it - dataMin = image.getDataMin(); - dataMax = image.getDataMax(); + GLSLStructFactory.createDataTexture(program, "rawData", 0, + image.getDataFormat(), colorMapParameters.getNoDataValue()); + + int numMappingValues = 0; + GLDataMapping mapping = image.getDataMapping(); + if (mapping != null && mapping.isValid()) { + numMappingValues = mapping.getNumMappingValues(); } + GLSLStructFactory.createDataMapping(program, "dataMapping", 3, 4, + numMappingValues); - double cmapMin = colorMapParameters.getColorMapMin(); - double cmapMax = colorMapParameters.getColorMapMax(); + GLSLStructFactory.createColorMapping(program, "colorMapping", 1, 2, + colorMapParameters); - program.setUniform("isFloat", !isScaled); - program.setUniform("logarithmic", - colorMapParameters.isLogarithmic() ? 1 : 0); - program.setUniform("logFactor", colorMapParameters.getLogFactor()); - program.setUniform("mirror", colorMapParameters.isMirror() ? 1 : 0); - - program.setUniform("applyMask", colorMapParameters.isUseMask() ? 1 : 0); - - program.setUniform("naturalMin", dataMin); - program.setUniform("naturalMax", dataMax); - program.setUniform("cmapMin", cmapMin); - program.setUniform("cmapMax", cmapMax); - - program.setUniform("alphaMask", 2); - program.setUniform("colorMap", 1); - program.setUniform("rawText", 0); - - program.setUniform("brightness", image.getBrightness()); - program.setUniform("contrast", image.getContrast()); - program.setUniform("alpha", paintProps.getAlpha()); + GLSLStructFactory.createColorModifiers(program, "modifiers", + paintProps.getAlpha(), image.getBrightness(), + image.getContrast()); } - } diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDataMappingFactory.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDataMappingFactory.java new file mode 100644 index 0000000000..9fdbad5dd3 --- /dev/null +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDataMappingFactory.java @@ -0,0 +1,343 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.viz.core.gl.ext.imaging; + +import java.nio.FloatBuffer; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import javax.measure.converter.UnitConverter; +import javax.measure.unit.Unit; +import javax.media.opengl.GL; + +import com.raytheon.uf.common.colormap.image.ColorMapData; +import com.raytheon.viz.core.gl.dataformat.GLBufferColorMapData; +import com.raytheon.viz.core.gl.dataformat.GLFloatDataFormat; +import com.raytheon.viz.core.gl.images.GLBufferCMTextureData; +import com.raytheon.viz.core.gl.images.GLCMTextureData; + +/** + * Factory class for creation {@link GLDataMapping} objects that can convert + * between units + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 24, 2013 2492       mschenke    Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class GLDataMappingFactory { + + /** + * Key for {@link GLDataMappingFactory#mappingCache}. Stores fields needed + * to generate unique mappings + * + * @author mschenke + */ + private static class GLDataMappingKey { + + private final Unit dataUnit; + + private final Unit colorMapUnit; + + private final float colorMapMin; + + private final float colorMapMax; + + private final int colorMapSize; + + public GLDataMappingKey(Unit dataUnit, Unit colorMapUnit, + float colorMapMin, float colorMapMax, int colorMapSize) { + this.dataUnit = dataUnit; + this.colorMapUnit = colorMapUnit; + this.colorMapMin = colorMapMin; + this.colorMapMax = colorMapMax; + this.colorMapSize = colorMapSize; + } + + public Unit getDataUnit() { + return dataUnit; + } + + public Unit getColorMapUnit() { + return colorMapUnit; + } + + public float getColorMapMin() { + return colorMapMin; + } + + public float getColorMapMax() { + return colorMapMax; + } + + public int getColorMapSize() { + return colorMapSize; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + Float.floatToIntBits(colorMapMax); + result = prime * result + Float.floatToIntBits(colorMapMin); + result = prime * result + colorMapSize; + result = prime * result + + ((colorMapUnit == null) ? 0 : colorMapUnit.hashCode()); + result = prime * result + + ((dataUnit == null) ? 0 : dataUnit.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + GLDataMappingKey other = (GLDataMappingKey) obj; + if (Float.floatToIntBits(colorMapMax) != Float + .floatToIntBits(other.colorMapMax)) + return false; + if (Float.floatToIntBits(colorMapMin) != Float + .floatToIntBits(other.colorMapMin)) + return false; + if (colorMapSize != other.colorMapSize) + return false; + if (colorMapUnit == null) { + if (other.colorMapUnit != null) + return false; + } else if (!colorMapUnit.equals(other.colorMapUnit)) + return false; + if (dataUnit == null) { + if (other.dataUnit != null) + return false; + } else if (!dataUnit.equals(other.dataUnit)) + return false; + return true; + } + + } + + /** + * GL data mapping object, represents a mapping between units for use in GL + * + * @author mschenke + */ + public static class GLDataMapping { + + private final GLDataMappingKey key; + + private GLCMTextureData colorMapping; + + private GLCMTextureData dataMapping; + + private int numMappingValues; + + private int refCount = 1; + + private boolean initialized = false; + + public GLDataMapping(GLDataMappingKey key) { + this.key = key; + } + + public GLCMTextureData getColorMapping() { + return colorMapping; + } + + public GLCMTextureData getDataMapping() { + return dataMapping; + } + + public int getNumMappingValues() { + return numMappingValues; + } + + public boolean isValid() { + return numMappingValues > 0 && colorMapping != null + && dataMapping != null; + } + + public void dispose() { + synchronized (mappingCache) { + refCount -= 1; + if (refCount <= 0) { + mappingCache.remove(key); + if (colorMapping != null) { + colorMapping.dispose(); + } + if (dataMapping != null) { + dataMapping.dispose(); + } + refCount = 0; + } + } + } + + private void use() { + if (refCount == 0) { + throw new IllegalStateException( + "GLDataMapping has already been disposed"); + } + refCount += 1; + } + + private synchronized void initialize(GL gl) { + if (initialized) { + return; + } + Unit dataUnit = key.getDataUnit(); + Unit colorMapUnit = key.getColorMapUnit(); + int colorMapSize = key.getColorMapSize(); + double colorMapMin = key.getColorMapMin(); + double colorMapMax = key.getColorMapMax(); + int numMappings = 0; + if (dataUnit != null && colorMapUnit != null + && dataUnit.equals(colorMapUnit) == false + && dataUnit.isCompatible(colorMapUnit)) { + // Worst case scenario, one mapping per color + double[] colorMapping = new double[colorMapSize]; + Arrays.fill(colorMapping, Float.NaN); + double[] dataMapping = new double[colorMapping.length]; + Arrays.fill(dataMapping, Float.NaN); + + UnitConverter colorMapToData = colorMapUnit + .getConverterTo(dataUnit); + double dataMin = colorMapToData.convert(colorMapMin); + double dataMax = colorMapToData.convert(colorMapMax); + colorMapping[0] = colorMapMin; + colorMapping[colorMapping.length - 1] = colorMapMax; + dataMapping[0] = dataMin; + dataMapping[dataMapping.length - 1] = dataMax; + + numMappings = 2; + if (colorMapToData.isLinear() == false) { + // Populate the dataMapping/colorMapping arrays + double increment = (colorMapMax - colorMapMin) + / (colorMapping.length - 1); + for (int i = 1; i < colorMapping.length - 1; ++i) { + colorMapping[i] = colorMapMin + (i * increment); + dataMapping[i] = colorMapToData + .convert(colorMapping[i]); + } + + // Search for linearness in the dataMappings. + int currEndIndex = 1; + double currEndValue = dataMapping[currEndIndex]; + float currDelta = (float) (currEndValue - dataMapping[0]); + for (int i = 2; i < dataMapping.length; ++i) { + double nextValue = dataMapping[i]; + float nextDelta = (float) ((nextValue - currEndValue) / (i - currEndIndex)); + if (nextDelta == currDelta) { + // Remove linear entries + dataMapping[currEndIndex] = colorMapping[currEndIndex] = Double.NaN; + currEndValue = nextValue; + currEndIndex = i; + } else { + // Non-linear entry found, add mapping + numMappings += 1; + currEndIndex = i; + currEndValue = nextValue; + currDelta = nextDelta; + } + } + } + + // Condense the mapping arrays removing nans + float[] condensedColorMapping = new float[numMappings]; + float[] condensedDataMapping = new float[numMappings]; + + int index = 0; + for (int i = 0; i < colorMapSize && index < numMappings; ++i) { + double colorMapVal = colorMapping[i]; + double dataMapVal = dataMapping[i]; + if (Double.isNaN(colorMapVal) == false + && Double.isNaN(dataMapVal) == false) { + condensedColorMapping[index] = (float) colorMapVal; + condensedDataMapping[index] = (float) dataMapVal; + index += 1; + } + } + + if (index == numMappings) { + this.numMappingValues = numMappings; + this.colorMapping = new GLBufferCMTextureData( + new GLBufferColorMapData(new ColorMapData( + FloatBuffer.wrap(condensedColorMapping), + new int[] { numMappings }), + new GLFloatDataFormat())); + this.dataMapping = new GLBufferCMTextureData( + new GLBufferColorMapData(new ColorMapData( + FloatBuffer.wrap(condensedDataMapping), + new int[] { numMappings }), + new GLFloatDataFormat())); + } + } + initialized = true; + } + } + + private static Map mappingCache = new HashMap(); + + /** + * Creates a {@link GLDataMapping} object given the dataUnit, colorMapUnit, + * color map min/max, and size of the colormap. Object must be disposed of + * when no longer used + * + * @param gl + * @param dataUnit + * @param colorMapUnit + * @param colorMapMin + * @param colorMapMax + * @param colorMapSize + * @return + */ + public static GLDataMapping constructGLDataMapping(GL gl, Unit dataUnit, + Unit colorMapUnit, float colorMapMin, float colorMapMax, + int colorMapSize) { + GLDataMapping mapping; + synchronized (mappingCache) { + GLDataMappingKey key = new GLDataMappingKey(dataUnit, colorMapUnit, + colorMapMin, colorMapMax, colorMapSize); + mapping = mappingCache.get(key); + if (mapping == null) { + mapping = new GLDataMapping(key); + mappingCache.put(key, mapping); + } else { + mapping.use(); + } + } + mapping.initialize(gl); + return mapping; + } + +} diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDefaultImagingExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDefaultImagingExtension.java index f86080d9ba..5f81878958 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDefaultImagingExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDefaultImagingExtension.java @@ -22,6 +22,7 @@ package com.raytheon.viz.core.gl.ext.imaging; import com.raytheon.uf.viz.core.drawables.IImage; import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.viz.core.gl.glsl.GLSLStructFactory; import com.raytheon.viz.core.gl.glsl.GLShaderProgram; import com.raytheon.viz.core.gl.images.AbstractGLImage; @@ -34,7 +35,9 @@ import com.raytheon.viz.core.gl.images.AbstractGLImage; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Dec 16, 2011 mschenke Initial creation + * Dec 16, 2011 mschenke Initial creation + * Nov 4, 2013 2492 mschenke Switched to use GLSLStructFactory for + * common shader structure use * * * @@ -76,10 +79,10 @@ public class GLDefaultImagingExtension extends AbstractGLImagingExtension { } image = (AbstractGLImage) iimage; - program.setUniform("alpha", paintProps.getAlpha()); - program.setUniform("brightness", image.getBrightness()); - program.setUniform("contrast", image.getContrast()); program.setUniform("rawTex", 0); + GLSLStructFactory.createColorModifiers(program, "modifiers", + paintProps.getAlpha(), image.getBrightness(), + image.getContrast()); } } diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLSingleColorImageExtension.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLSingleColorImageExtension.java index 0425cc1554..c7994e4664 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLSingleColorImageExtension.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLSingleColorImageExtension.java @@ -27,6 +27,7 @@ import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.ext.ISingleColorImageExtension; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.viz.core.gl.glsl.AbstractGLSLImagingExtension; +import com.raytheon.viz.core.gl.glsl.GLSLStructFactory; import com.raytheon.viz.core.gl.glsl.GLShaderProgram; import com.raytheon.viz.core.gl.images.GLSingleColorImage; @@ -40,7 +41,9 @@ import com.raytheon.viz.core.gl.images.GLSingleColorImage; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Dec 15, 2011 mschenke Initial creation + * Dec 15, 2011 mschenke Initial creation + * Nov 4, 2013 2492 mschenke Switched to use GLSLStructFactory for + * common shader structure use * * * @@ -97,11 +100,11 @@ public class GLSingleColorImageExtension extends AbstractGLSLImagingExtension image = (GLSingleColorImage) iimage; - program.setUniform("brightness", image.getBrightness()); - program.setUniform("contrast", image.getContrast()); - program.setUniform("alpha", paintProps.getAlpha()); program.setUniform("color", image.getColor()); program.setUniform("rawTex", 0); + GLSLStructFactory.createColorModifiers(program, "modifiers", + paintProps.getAlpha(), image.getBrightness(), + image.getContrast()); } } diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLSLStructFactory.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLSLStructFactory.java new file mode 100644 index 0000000000..e8fd320933 --- /dev/null +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLSLStructFactory.java @@ -0,0 +1,133 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.viz.core.gl.glsl; + +import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; +import com.raytheon.viz.core.gl.dataformat.AbstractGLColorMapDataFormat; + +/** + * Factory for creating GLSL struct mappings + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 31, 2013 2492       mschenke     Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class GLSLStructFactory { + + private static final String FIELD_SEPERATOR = "."; + + /** + * Creates a DataTexture structure in the program with the given name + * + * @param program + * @param name + * @param texBinding + * @param dataFormat + * @param noDataValue + */ + public static void createDataTexture(GLShaderProgram program, String name, + int texBinding, AbstractGLColorMapDataFormat dataFormat, + double noDataValue) { + setFieldUniform(program, name, "rawTex", texBinding); + setFieldUniform(program, name, "noDataValue", noDataValue); + setFieldUniform(program, name, "isScaled", dataFormat.isScaled()); + if (dataFormat.isScaled()) { + setFieldUniform(program, name, "scaleMin", + dataFormat.getDataFormatMin()); + setFieldUniform(program, name, "scaleMax", + dataFormat.getDataFormatMax()); + } + } + + /** + * Creates a DataMapping structure in the program with the given name + * + * @param program + * @param name + * @param dataMappingTexBinding + * @param colorMappingTexBinding + * @param numMappingValues + */ + public static void createDataMapping(GLShaderProgram program, String name, + int dataMappingTexBinding, int colorMappingTexBinding, + int numMappingValues) { + setFieldUniform(program, name, "dataMappingValues", + dataMappingTexBinding); + setFieldUniform(program, name, "colorMappingValues", + colorMappingTexBinding); + setFieldUniform(program, name, "numMappingValues", numMappingValues); + } + + /** + * Creates a ColorMapping structure in the program with the given name + * + * @param program + * @param name + * @param colorMapTexBinding + * @param alphaMaskTexBinding + * @param parameters + */ + public static void createColorMapping(GLShaderProgram program, String name, + int colorMapTexBinding, int alphaMaskTexBinding, + ColorMapParameters parameters) { + setFieldUniform(program, name, "colorMap", colorMapTexBinding); + setFieldUniform(program, name, "cmapMin", parameters.getColorMapMin()); + setFieldUniform(program, name, "cmapMax", parameters.getColorMapMax()); + + setFieldUniform(program, name, "applyMask", parameters.isUseMask()); + setFieldUniform(program, name, "alphaMask", alphaMaskTexBinding); + + setFieldUniform(program, name, "isMirrored", parameters.isMirror()); + setFieldUniform(program, name, "isLogarithmic", + parameters.isLogarithmic()); + setFieldUniform(program, name, "logFactor", parameters.getLogFactor()); + } + + /** + * Creates a ColorModifiers structure in the program with the given name + * + * @param program + * @param name + * @param alpha + * @param brightness + * @param contrast + */ + public static void createColorModifiers(GLShaderProgram program, + String name, float alpha, float brightness, float contrast) { + setFieldUniform(program, name, "alpha", alpha); + setFieldUniform(program, name, "brightness", brightness); + setFieldUniform(program, name, "contrast", contrast); + } + + private static void setFieldUniform(GLShaderProgram program, + String structName, String fieldName, Object fieldValue) { + program.setUniform(structName + FIELD_SEPERATOR + fieldName, fieldValue); + } +} diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLShaderProgram.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLShaderProgram.java index a7e72634a3..ad41e267ff 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLShaderProgram.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/glsl/GLShaderProgram.java @@ -155,7 +155,6 @@ public class GLShaderProgram { gl.glUseProgram(0); state = State.INITIALIZED; } - loadedUniforms.clear(); } /** @@ -358,6 +357,7 @@ public class GLShaderProgram { glslContext = -1; } state = State.INVALID; + loadedUniforms.clear(); } } diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/AbstractGLColormappedImage.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/AbstractGLColormappedImage.java index fcbba6b048..8f093e27f2 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/AbstractGLColormappedImage.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/AbstractGLColormappedImage.java @@ -26,6 +26,8 @@ import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.IColormappedImage; import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension; import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.viz.core.gl.dataformat.AbstractGLColorMapDataFormat; +import com.raytheon.viz.core.gl.ext.imaging.GLDataMappingFactory.GLDataMapping; import com.sun.opengl.util.texture.TextureCoords; /** @@ -52,6 +54,8 @@ public abstract class AbstractGLColormappedImage extends AbstractGLImage protected GLCMTextureData data; + private GLDataMapping dataMapping; + public AbstractGLColormappedImage(GLCMTextureData data, ColorMapParameters params, Class extensionClass) { @@ -143,6 +147,15 @@ public abstract class AbstractGLColormappedImage extends AbstractGLImage return data.getTexId(); } + /** + * Returns the GL format of the texture data + * + * @return + */ + public AbstractGLColorMapDataFormat getDataFormat() { + return data.getDataFormat(); + } + /** * the absolute minimum value of a pixel in this image. {@link Double#NaN} * if no absolute minimum exists @@ -233,6 +246,18 @@ public abstract class AbstractGLColormappedImage extends AbstractGLImage data.dispose(); data = null; } + if (dataMapping != null) { + dataMapping.dispose(); + dataMapping = null; + } + } + + public void setDataMapping(GLDataMapping dataMapping) { + this.dataMapping = dataMapping; + } + + public GLDataMapping getDataMapping() { + return dataMapping; } /* diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLBufferCMTextureData.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLBufferCMTextureData.java new file mode 100644 index 0000000000..3a08ca740e --- /dev/null +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLBufferCMTextureData.java @@ -0,0 +1,138 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.viz.core.gl.images; + +import java.nio.Buffer; + +import javax.measure.unit.Unit; +import javax.media.opengl.GL; + +import com.raytheon.uf.common.colormap.image.ColorMapData; +import com.raytheon.viz.core.gl.dataformat.AbstractGLColorMapDataFormat; +import com.raytheon.viz.core.gl.dataformat.GLBufferColorMapData; + +/** + * {@link GLCMTextureData} backed by a {@link Buffer}. The initial functions in + * here were moved here from {@link GLRetrievableCMTextureData} + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 23, 2013 2492       mschenke    Initial creation
+ * 
+ * 
+ * + * @author mschenke + * @version 1.0 + */ + +public class GLBufferCMTextureData extends GLCMTextureData { + + public GLBufferCMTextureData(ColorMapData data, + AbstractGLColorMapDataFormat format) { + this(new GLBufferColorMapData(data, format)); + } + + public GLBufferCMTextureData(GLBufferColorMapData data) { + super(data); + } + + @Override + protected GLBufferColorMapData getDataObject() { + return (GLBufferColorMapData) super.getDataObject(); + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.viz.core.gl.images.GLCMTextureData#isStaged() + */ + @Override + public boolean isStaged() { + GLBufferColorMapData data = getDataObject(); + // Override since we have our required data + return data != null && data.getData() != null; + } + + @Override + public void dispose() { + super.dispose(); + if (isStaged()) { + data = null; + } + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.viz.core.gl.images.GLCMTextureData#uploadTexture2D(javax + * .media.opengl.GL, int, int, int) + */ + @Override + protected void createTexture2D(GL gl, int type, int w, int h) { + gl.glTexImage2D(type, 0, getTextureInternalFormat(), w, h, 0, + getTextureFormat(), getTextureType(), getDataObject().getData() + .rewind()); + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.viz.core.gl.images.GLCMTextureData#uploadTexture1D(javax + * .media.opengl.GL, int, int) + */ + @Override + protected void createTexture1D(GL gl, int type, int w) { + gl.glTexImage1D(type, 0, getTextureInternalFormat(), w, 0, + getTextureFormat(), getTextureType(), getDataObject().getData() + .rewind()); + } + + /** + * Returns the data value at the given coordinates. TODO: Add support for 1D + * texture sampling, change x,y to int[] index? + * + * @param x + * @param y + * @return + */ + public double getValue(int x, int y) { + double value = Double.NaN; + if (isStaged()) { + value = getDataObject().getValue(x, y).doubleValue(); + } + return value; + } + + /** + * Returns the {@link Unit} associated with the data + * + * @return the dataUnit + */ + public Unit getDataUnit() { + GLBufferColorMapData data = getDataObject(); + return data != null ? data.getDataUnit() : null; + } +} diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLCMTextureData.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLCMTextureData.java index d9df2d3bff..ce1aa27dd7 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLCMTextureData.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLCMTextureData.java @@ -23,6 +23,7 @@ import javax.media.opengl.GL; import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType; import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.viz.core.gl.dataformat.AbstractGLColorMapDataFormat; import com.raytheon.viz.core.gl.dataformat.GLColorMapData; import com.raytheon.viz.core.gl.objects.GLTextureObject; @@ -40,6 +41,7 @@ import com.raytheon.viz.core.gl.objects.GLTextureObject; * format for offscreen textures. * Oct 16, 2013 2333 mschenke Moved retrievable/Buffer parts out and * into separate class. + * Oct 23, 2013 2492 mschenke Added support for 1D textures * * * @@ -116,6 +118,9 @@ public class GLCMTextureData { return false; } int type = getTextureStorageType(); + if (type == GL.GL_NONE) { + throw new VizException("Unsupported dimension size for texture"); + } tex = new GLTextureObject(this); tex.bind(gl, type); @@ -125,7 +130,8 @@ public class GLCMTextureData { gl.glTexParameteri(type, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); gl.glTexParameteri(type, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); - if (isDataFormatScaled() && isDataFormatSigned()) { + boolean changeScaleAndBias = isDataFormatScaled() && isDataFormatSigned(); + if (changeScaleAndBias) { // GL maps signed data into the range -1 to 1, but gl trims // this to a valid range of 0 to 1, essentially removing // negative values. Adding a scale and bias remaps this from @@ -135,20 +141,23 @@ public class GLCMTextureData { gl.glPixelTransferf(GL.GL_RED_BIAS, 0.5f); } - int w = getDimensionSize(0); - int h = getDimensionSize(1); + if (type == GL.GL_TEXTURE_1D) { + createTexture1D(gl, type, getDimensionSize(0)); + } else if (type == GL.GL_TEXTURE_2D) { + createTexture2D(gl, type, getDimensionSize(0), getDimensionSize(1)); + } - createTexture2D(gl, type, w, h); - - gl.glPixelTransferf(GL.GL_RED_SCALE, 1.0f); - gl.glPixelTransferf(GL.GL_RED_BIAS, 0.0f); + if (changeScaleAndBias) { + gl.glPixelTransferf(GL.GL_RED_SCALE, 1.0f); + gl.glPixelTransferf(GL.GL_RED_BIAS, 0.0f); + } return true; } /** - * Creates a 2D texture for type, with width/height w/h. Texture object must - * be bound for this call to work using + * Creates a 2D texture for type, with width/height, w/h. Texture object + * must be bound for this call to work using * {@link GLTextureObject#bind(GL, int)} * * @param gl @@ -163,6 +172,22 @@ public class GLCMTextureData { getTextureFormat(), getTextureType(), null); } + /** + * Creates a 1D texture for type, with width, w. Texture object must be + * bound for this call to work using {@link GLTextureObject#bind(GL, int)} + * + * @param gl + * @param type + * @param w + * @param h + */ + protected void createTexture1D(GL gl, int type, int w) { + // Allocate our space on the graphics card, no buffer to upload so it + // will be filled with default values initially (0s) + gl.glTexImage1D(type, 0, getTextureInternalFormat(), w, 0, + getTextureFormat(), getTextureType(), null); + } + /** * Checks if texture data is staged. If false, a call to * {@link #stageTexture()} is needed before texture can be loaded @@ -184,6 +209,15 @@ public class GLCMTextureData { return tex != null && tex.isValid(); } + /** + * Returns the GL format of the texture data + * + * @return + */ + public AbstractGLColorMapDataFormat getDataFormat() { + return data.getDataFormat(); + } + /** * Returns the size of the dimension index passed in (0=width,1=height) * @@ -272,12 +306,20 @@ public class GLCMTextureData { } /** - * The texture storage type of the data (TEXTURE_2D) + * The texture storage type of the data. Will return {@link GL#GL_NONE} if + * unsupported dimension is detected * * @return */ public int getTextureStorageType() { - return GL.GL_TEXTURE_2D; + switch (data.getNumDimensions()) { + case 1: + return GL.GL_TEXTURE_1D; + case 2: + return GL.GL_TEXTURE_2D; + default: + return GL.GL_NONE; + } } /** diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLRetrievableCMTextureData.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLRetrievableCMTextureData.java index a77cd86450..1d9458945e 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLRetrievableCMTextureData.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLRetrievableCMTextureData.java @@ -38,8 +38,9 @@ import com.raytheon.viz.core.gl.internal.cache.ImageCache; import com.raytheon.viz.core.gl.internal.cache.ImageCache.CacheType; /** - * Object that represents a colormapped texture that can be unloaded and - * reloaded from main/graphics memory using a retrieval callback + * {@link GLCMTextureData} that's backed by a {@link Buffer} that represents a + * colormapped texture that is cacheable and can be unloaded and reloaded from + * main/graphics memory using a retrieval callback * *
  * 
@@ -47,7 +48,8 @@ import com.raytheon.viz.core.gl.internal.cache.ImageCache.CacheType;
  * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Jun 24, 2013            mschenke     Initial creation
+ * Jun 24, 2013            mschenke    Initial creation
+ * Oct 23, 2013 2492       mschenke    Extracted Buffer backing into super class   
  * 
  * 
* @@ -55,7 +57,7 @@ import com.raytheon.viz.core.gl.internal.cache.ImageCache.CacheType; * @version 1.0 */ -public class GLRetrievableCMTextureData extends GLCMTextureData implements +public class GLRetrievableCMTextureData extends GLBufferCMTextureData implements IImageCacheable { private static Map texMap = new HashMap(); @@ -95,11 +97,6 @@ public class GLRetrievableCMTextureData extends GLCMTextureData implements this.callback = callback; } - @Override - protected GLBufferColorMapData getDataObject() { - return (GLBufferColorMapData) super.getDataObject(); - } - /* * (non-Javadoc) * @@ -224,18 +221,6 @@ public class GLRetrievableCMTextureData extends GLCMTextureData implements return 0; } - /* - * (non-Javadoc) - * - * @see com.raytheon.viz.core.gl.images.GLCMTextureData#isStaged() - */ - @Override - public boolean isStaged() { - GLBufferColorMapData data = getDataObject(); - // Override since we have our required data - return data != null && data.getData() != null; - } - public double getValue(int x, int y) { GLBufferColorMapData data = getDataObject(); double value = Double.NaN; @@ -265,27 +250,4 @@ public class GLRetrievableCMTextureData extends GLCMTextureData implements return value; } - /* - * (non-Javadoc) - * - * @see - * com.raytheon.viz.core.gl.images.GLCMTextureData#uploadTexture2D(javax - * .media.opengl.GL, int, int, int) - */ - @Override - protected void createTexture2D(GL gl, int type, int w, int h) { - gl.glTexImage2D(type, 0, getTextureInternalFormat(), w, h, 0, - getTextureFormat(), getTextureType(), getDataObject().getData() - .rewind()); - } - - /** - * Returns the {@link Unit} associated with the data - * - * @return the dataUnit - */ - public Unit getDataUnit() { - GLBufferColorMapData data = getDataObject(); - return data != null ? data.getDataUnit() : null; - } } diff --git a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java index b9b03e7f5e..553f339c9c 100644 --- a/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java +++ b/cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/GLTarget.java @@ -53,6 +53,7 @@ import org.geotools.coverage.grid.GeneralGridGeometry; import com.raytheon.uf.common.colormap.ColorMap; import com.raytheon.uf.common.colormap.IColorMap; import com.raytheon.uf.common.colormap.image.ColorMapData; +import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -67,7 +68,6 @@ import com.raytheon.uf.viz.core.DrawableString; import com.raytheon.uf.viz.core.IExtent; import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IView; -import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback; import com.raytheon.uf.viz.core.data.IRenderedImageCallback; import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.drawables.IFont; @@ -86,11 +86,12 @@ import com.raytheon.viz.core.gl.GLDisposalManager; import com.raytheon.viz.core.gl.GLStats; import com.raytheon.viz.core.gl.IGLFont; import com.raytheon.viz.core.gl.IGLTarget; -import com.raytheon.viz.core.gl.ext.imaging.GLColormappedImageExtension; +import com.raytheon.viz.core.gl.dataformat.GLByteDataFormat; import com.raytheon.viz.core.gl.ext.imaging.GLDefaultImagingExtension; import com.raytheon.viz.core.gl.glsl.GLSLFactory; +import com.raytheon.viz.core.gl.glsl.GLSLStructFactory; import com.raytheon.viz.core.gl.glsl.GLShaderProgram; -import com.raytheon.viz.core.gl.images.GLColormappedImage; +import com.raytheon.viz.core.gl.images.GLBufferCMTextureData; import com.raytheon.viz.core.gl.images.GLImage; import com.raytheon.viz.core.gl.objects.GLTextureObject; import com.sun.opengl.util.Screenshot; @@ -128,6 +129,7 @@ import com.sun.opengl.util.j2d.TextRenderer; * strings are always readable despite extent * May 28, 2013 1638 mschenke Made sure {@link TextStyle#BLANKED} text is drawing correct size * box around text + * Nov 4, 2013 2492 mschenke Switched colormap drawing to use 1D texture object for alpha mask * * * @@ -517,28 +519,19 @@ public class GLTarget extends AbstractGraphicsTarget implements IGLTarget { GLTextureObject i = getColorMapTexture(colorMapParams); - GLColormappedImage alphaMaskTexture = null; + GLBufferCMTextureData alphaMaskTexture = null; if (colorMapParams.isUseMask() && capabilities.cardSupportsShaders) { - final byte[] mask = colorMapParams.getAlphaMask(); - alphaMaskTexture = getExtension( - GLColormappedImageExtension.class).initializeRaster( - new IColorMapDataRetrievalCallback() { - @Override - public ColorMapData getColorMapData() - throws VizException { - return new ColorMapData(ByteBuffer.wrap(mask), - new int[] { mask.length, 1 }); - } - - }, colorMapParams); - alphaMaskTexture.stage(); - alphaMaskTexture.target(this); - } - - if (alphaMaskTexture != null) { + byte[] mask = colorMapParams.getAlphaMask(); + alphaMaskTexture = new GLBufferCMTextureData(new ColorMapData( + ByteBuffer.wrap(mask), new int[] { mask.length }, + ColorMapDataType.BYTE), new GLByteDataFormat()); gl.glActiveTexture(GL.GL_TEXTURE1); - gl.glBindTexture(alphaMaskTexture.getTextureStorageType(), - alphaMaskTexture.getTextureid()); + if (alphaMaskTexture.loadTexture(gl)) { + gl.glBindTexture(alphaMaskTexture.getTextureStorageType(), + alphaMaskTexture.getTexId()); + } else { + alphaMaskTexture.dispose(); + } } gl.glPolygonMode(GL.GL_BACK, GL.GL_FILL); @@ -573,14 +566,11 @@ public class GLTarget extends AbstractGraphicsTarget implements IGLTarget { "colormap"); if (program != null) { program.startShader(); - program.setUniform("alphaVal", blendAlpha); - program.setUniform("brightness", brightness); - program.setUniform("contrast", contrast); - program.setUniform("colorMap", 0); - program.setUniform("logFactor", logFactor); - program.setUniform("alphaMask", 1); - program.setUniform("applyMask", - colorMapParams.isUseMask() ? 1 : 0); + + GLSLStructFactory.createColorMapping(program, + "colorMapping", 0, 1, colorMapParams); + GLSLStructFactory.createColorModifiers(program, + "modifiers", blendAlpha, brightness, contrast); program.setUniform("bkgrndRed", backgroundColor.red / 255.0f); program.setUniform("bkgrndGreen", diff --git a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResource.java b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResource.java index 14940fd703..da86576148 100644 --- a/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResource.java +++ b/cave/com.raytheon.viz.core/src/com/raytheon/viz/core/topo/TopoResource.java @@ -25,7 +25,6 @@ import java.text.DecimalFormat; import java.util.Arrays; import javax.measure.converter.UnitConverter; -import javax.measure.unit.NonSI; import javax.measure.unit.SI; import javax.measure.unit.Unit; import javax.measure.unit.UnitFormat; @@ -40,10 +39,10 @@ import com.raytheon.uf.common.datastorage.IDataStore; import com.raytheon.uf.common.geospatial.ReferencedCoordinate; import com.raytheon.uf.common.style.LabelingPreferences; import com.raytheon.uf.common.style.ParamLevelMatchCriteria; +import com.raytheon.uf.common.style.StyleException; import com.raytheon.uf.common.style.StyleManager; import com.raytheon.uf.common.style.StyleManager.StyleType; import com.raytheon.uf.common.style.StyleRule; -import com.raytheon.uf.common.style.StyleException; import com.raytheon.uf.common.style.image.DataScale; import com.raytheon.uf.common.style.image.ImagePreferences; import com.raytheon.uf.common.style.image.SamplePreferences; @@ -148,7 +147,8 @@ public class TopoResource extends // Set data unit, specify in resource data? Look up in data record? params.setDataUnit(SI.METER); - params.setDisplayUnit(NonSI.FOOT); + params.setDisplayUnit(SI.METER); + params.setColorMapUnit(SI.METER); params.setColorMapMin(-19); params.setColorMapMax(5000); params.setDataMin(Short.MIN_VALUE); @@ -169,15 +169,17 @@ public class TopoResource extends DataScale scale = prefs.getDataScale(); if (scale != null) { + UnitConverter displayToColorMap = params + .getDisplayToColorMapConverter(); Double minVal = scale.getMinValue(); Double maxVal = scale.getMaxValue(); if (minVal != null) { - params.setColorMapMin((float) params - .getDisplayToDataConverter().convert(minVal)); + params.setColorMapMin((float) displayToColorMap + .convert(minVal)); } if (maxVal != null) { - params.setColorMapMax((float) params - .getDisplayToDataConverter().convert(maxVal)); + params.setColorMapMax((float) displayToColorMap + .convert(maxVal)); } } diff --git a/edexOsgi/build.edex/esb/conf/modes.xml b/edexOsgi/build.edex/esb/conf/modes.xml index e36452e92f..8bdf74c8fc 100644 --- a/edexOsgi/build.edex/esb/conf/modes.xml +++ b/edexOsgi/build.edex/esb/conf/modes.xml @@ -78,6 +78,7 @@ + webservices.xml ebxml.*\.xml .*request.* grib-decode.xml diff --git a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/utility/EDEXLocalizationAdapter.java b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/utility/EDEXLocalizationAdapter.java index e7c79b6a09..5dd0ffd870 100644 --- a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/utility/EDEXLocalizationAdapter.java +++ b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/utility/EDEXLocalizationAdapter.java @@ -58,6 +58,8 @@ import com.raytheon.uf.edex.core.props.PropertiesFactory; * ------------ ---------- ----------- -------------------------- * Jul 11, 2008 1250 jelkins Initial creation * Mar 14, 2013 1794 djohnson FileUtil.listFiles now returns List. + * Nov 03, 2013 2511 mnash Fix issue where if name occurs in path + * file won't be returned correctly * * * @author jelkins @@ -231,7 +233,12 @@ public class EDEXLocalizationAdapter implements ILocalizationAdapter { entry.isDirectory = file.isDirectory(); entry.context = ctx; String fullPath = file.getAbsolutePath(); - entry.fileName = fullPath.substring(fullPath.indexOf(basePath)); + String path = getUtilityDir() + File.separator + ctx.toPath() + + File.separator; + entry.fileName = fullPath.replaceFirst(path, ""); + if (entry.fileName.startsWith(File.separator)) { + entry.fileName = entry.fileName.substring(1); + } entry.date = new Date(file.lastModified()); entry.protectedLevel = ProtectedFiles.getProtectedLevel(null, diff --git a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/image/Colormapper.java b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/image/Colormapper.java index b4e434000e..d225d7317a 100644 --- a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/image/Colormapper.java +++ b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/image/Colormapper.java @@ -35,21 +35,27 @@ import java.nio.IntBuffer; import java.nio.ShortBuffer; import java.util.List; +import javax.measure.converter.UnitConverter; +import javax.measure.unit.Unit; + import com.raytheon.uf.common.colormap.Color; import com.raytheon.uf.common.colormap.IColorMap; import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; /** - * Colormapper class + * Colormapper class, written to mimic colormapRaster.glsl in java. Any changes + * to files mapping.glsl or colormapRaster.glsl will probably need to be + * reflected here * *
  * 
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Aug 13, 2010            mschenke     Initial creation
+ * Aug 13, 2010            mschenke    Initial creation
  * Feb 15, 2013 1638       mschenke    Moved IndexColorModel creation to common.colormap utility
+ * Nov  4, 2013 2492       mschenke    Rewritten to model glsl equivalent
  * 
  * 
* @@ -77,39 +83,42 @@ public class Colormapper { int width = cmapData.getDimensions()[0]; int height = cmapData.getDimensions()[1]; Buffer buf = cmapData.getBuffer(); - ColorMapDataType dataType = cmapData.getDataType(); - - // Parameters ported from raster.glsl - boolean log = parameters.isLogarithmic(); - double logFactor = parameters.getLogFactor(); - boolean mirror = parameters.isMirror(); - double cmapMin = parameters.getColorMapMin(); - double cmapMax = parameters.getColorMapMax(); - int colorMapSz = parameters.getColorMap().getSize(); - - double diff = Math.abs(cmapMax - cmapMin); - int dataSize = buf.capacity(); - byte[] cmapedData = new byte[buf.capacity()]; + ColorMapDataType dataType = cmapData.getDataType(); + double noDataValue = parameters.getNoDataValue(); + Unit dataUnit = cmapData.getDataUnit(); + if (dataUnit == null) { + dataUnit = parameters.getDataUnit(); + } + Unit colorMapUnit = parameters.getColorMapUnit(); + UnitConverter converter = null; + if (dataUnit != null && colorMapUnit != null + && parameters.getDataMapping() == null + && dataUnit.equals(colorMapUnit) == false + && dataUnit.isCompatible(colorMapUnit) == true) { + converter = dataUnit.getConverterTo(colorMapUnit); + } + int numColors = parameters.getColorMap().getSize(); + byte[] indexArray = new byte[dataSize]; + for (int i = 0; i < dataSize; ++i) { - double value = getValue(buf, i, dataType); - double index = 0.0f; - if (log) { - index = findIndexLog(value, logFactor, cmapMin, cmapMax, mirror); - } else { - index = ((value - cmapMin) / diff); + double dataValue = getDataValue(buf, i, dataType); + if (Double.isNaN(dataValue) || dataValue == noDataValue) { + // Skip, need equivalent of setting alpha to 0 + continue; } - if (index < 0.0) { - index = 0.0; - } else if (index > 1.0) { - index = 1.0; + double cmapValue = dataValue; + if (converter != null) { + cmapValue = converter.convert(dataValue); } - cmapedData[i] = findColorIndex(index, logFactor, colorMapSz); + + double index = getColorMappingIndex(cmapValue, parameters); + indexArray[i] = (byte) (capIndex(index) * (numColors - 1)); } IndexColorModel cm = buildColorModel(parameters.getColorMap()); - DataBufferByte byteArray = new DataBufferByte(cmapedData, width + DataBufferByte byteArray = new DataBufferByte(indexArray, width * height); MultiPixelPackedSampleModel sample = new MultiPixelPackedSampleModel( @@ -123,114 +132,6 @@ public class Colormapper { return bi; } - private static double getValue(Buffer buffer, int idx, - ColorMapDataType dataType) { - switch (dataType) { - case BYTE: { - return ((ByteBuffer) buffer).get(idx) & 0xFF; - } - case SIGNED_BYTE: { - return ((ByteBuffer) buffer).get(idx); - } - case SHORT: { - return ((ShortBuffer) buffer).get(idx); - } - case UNSIGNED_SHORT: { - return ((ShortBuffer) buffer).get(idx) & 0xFFFF; - } - case INT: { - return ((IntBuffer) buffer).get(idx); - } - case FLOAT: { - return ((FloatBuffer) buffer).get(idx); - } - } - return 0.0; - } - - private static double findIndexLog(double value, double logFactor, - double cmapMin, double cmapMax, boolean mirror) { - double index = 0.0; - // is this strictly negative, strictly positive or neg to pos scaling? - if (cmapMin >= 0.0 && cmapMax >= 0.0 && mirror == false) { - if (value < cmapMin) { - index = 0.0; - } else { - // simple calculation - index = ((Math.log(value) - Math.log(cmapMin)) / Math.abs(Math - .log(cmapMax) - Math.log(cmapMin))); - } - } else if (cmapMin <= 0.0 && cmapMax <= 0.0 && mirror == false) { - index = ((Math.log(value) - Math.log(cmapMax)) / Math.abs(Math - .log(cmapMin) - Math.log(cmapMax))); - } else { - // special case, neg to pos: - double colorMapMin = cmapMin; - double colorMapMax = cmapMax; - double zeroVal = Math.max(colorMapMax, Math.abs(colorMapMin)) * 0.0001; - if (mirror && (colorMapMin > 0.0 || colorMapMax < 0.0)) { - if (colorMapMax < 0.0) { - colorMapMax = -cmapMax; - value = -value; - zeroVal = -colorMapMin; - } else { - zeroVal = cmapMin; - } - colorMapMin = -cmapMax; - } - double leftZero = 0.0; - double rightZero = 0.0; - double absLogZeroVal = Math.abs(Math.log(zeroVal)); - - rightZero = absLogZeroVal + Math.log(colorMapMax); - - double cmapMax2 = Math.abs(colorMapMin); - - leftZero = absLogZeroVal + Math.log(cmapMax2); - - double zeroIndex = leftZero / (leftZero + rightZero); - - // figure out index for texture val - double absTextureColor = Math.abs(value); - if (absTextureColor <= zeroVal) { - index = zeroIndex; - } else if (value > 0.0) { - // positive texture color value, find index from 0 to - // cmapMax: - double logTexColor = absLogZeroVal + Math.log(value); - - double texIndex = logTexColor / rightZero; - index = (zeroIndex + ((1.0 - zeroIndex) * texIndex)); - } else { - // negative texture color value, find index from 0 to - // cmapMax: - double logTexColor = absLogZeroVal + Math.log(absTextureColor); - - double texIndex = logTexColor / leftZero; - index = (zeroIndex - (zeroIndex * texIndex)); - } - } - return index; - } - - private static byte findColorIndex(double index, double logFactor, - int colorMapSz) { - if (logFactor > 0.0) { - double minLog = Math.log(logFactor); - double maxLog = Math.log(logFactor + 1.0); - - double lg = Math.log(logFactor + index); - - index = (lg - minLog) / (maxLog - minLog); - if (index < 0.0) { - index = 0.0; - } else if (index > 1.0) { - index = 1.0; - } - } - return (byte) (index * (colorMapSz - 1)); - } - /** * Builds a color model from a color map * @@ -256,4 +157,264 @@ public class Colormapper { return new IndexColorModel(COLOR_MODEL_NUMBER_BITS, size, red, green, blue, alpha); } + + /** + * Sets an index value into the indexArray for use in a Raster with + * IndexColorModel set + * + * @param dataArray + * @param idx + * @param idxValue + */ + public static void setIndexValue(Object dataArray, int idx, int idxValue) { + if (dataArray instanceof byte[]) { + ((byte[]) dataArray)[idx] = (byte) idxValue; + } else if (dataArray instanceof short[]) { + ((short[]) dataArray)[idx] = (short) idxValue; + } else if (dataArray instanceof int[]) { + ((int[]) dataArray)[idx] = idxValue; + } else { + throw new IllegalArgumentException("Unsupported dataArray type: " + + (dataArray != null ? dataArray.getClass() : null)); + } + } + + /** + * Returns the double representation of the data value for the Buffer at the + * given index + * + * @param buffer + * @param idx + * @param dataType + * @return + */ + public static double getDataValue(Buffer buffer, int idx, + ColorMapDataType dataType) { + switch (dataType) { + case BYTE: { + return ((ByteBuffer) buffer).get(idx) & 0xFF; + } + case SIGNED_BYTE: { + return ((ByteBuffer) buffer).get(idx); + } + case SHORT: { + return ((ShortBuffer) buffer).get(idx); + } + case UNSIGNED_SHORT: { + return ((ShortBuffer) buffer).get(idx) & 0xFFFF; + } + case INT: { + return ((IntBuffer) buffer).get(idx); + } + case FLOAT: { + return ((FloatBuffer) buffer).get(idx); + } + } + return 0.0; + } + + /** + * This function takes an index value and caps it to the range 0-1 + */ + public static double capIndex(double index) { + if (index < 0.0) { + index = 0.0; + } else if (index > 1.0) { + index = 1.0; + } + return index; + } + + /** + * Given a colorMap value linearly determine the index into cmapMin/cmapMax + * + * @param cmapValue + * @param cmapMin + * @param cmapMax + * @return + */ + public static double getLinearIndex(double cmapValue, double cmapMin, + double cmapMax) { + return (cmapValue - cmapMin) / (cmapMax - cmapMin); + } + + /** + * This function logarithmically finds the index for the cmapValue into + * cmapMin/cmapMax. + * + * @param cmapValue + * @param cmapMin + * @param cmapMax + * @param mirror + * @return + */ + public static double getLogIndex(double cmapValue, double cmapMin, + double cmapMax, boolean mirror) { + double index = 0.0; + // is this strictly negative, strictly positive or neg to pos scaling? + if (cmapMin >= 0.0 && cmapMax >= 0.0 && !mirror) { + if (cmapValue < cmapMin) { + index = 0.0; + } else { + // simple calculation + index = ((Math.log(cmapValue) - Math.log(cmapMin)) / Math + .abs(Math.log(cmapMax) - Math.log(cmapMin))); + } + } else if (cmapMin <= 0.0 && cmapMax <= 0.0 && !mirror) { + index = ((Math.log(cmapValue) - Math.log(cmapMax)) / Math.abs(Math + .log(cmapMin) - Math.log(cmapMax))); + } else { + // special case, neg to pos: + double colorMapMin = cmapMin; + double colorMapMax = cmapMax; + double zeroVal = Math.max(colorMapMax, Math.abs(colorMapMin)) * 0.0001; + if (mirror && (colorMapMin > 0.0 || colorMapMax < 0.0)) { + if (colorMapMax < 0.0) { + colorMapMax = -cmapMax; + cmapValue = -cmapValue; + zeroVal = -colorMapMin; + } else { + zeroVal = cmapMin; + } + colorMapMin = -cmapMax; + } + double leftZero = 0.0; + double rightZero = 0.0; + double absLogZeroVal = Math.abs(Math.log(zeroVal)); + + rightZero = absLogZeroVal + Math.log(colorMapMax); + + double cmapMax2 = Math.abs(colorMapMin); + + leftZero = absLogZeroVal + Math.log(cmapMax2); + + double zeroIndex = leftZero / (leftZero + rightZero); + + // figure out index for texture val + double absTextureColor = Math.abs(cmapValue); + if (absTextureColor <= zeroVal) { + index = zeroIndex; + } else if (cmapValue > 0.0) { + // positive texture color value, find index from 0 to + // cmapMax: + double logTexColor = absLogZeroVal + Math.log(cmapValue); + + double texIndex = logTexColor / rightZero; + index = (zeroIndex + ((1.0 - zeroIndex) * texIndex)); + } else { + // negative texture color value, find index from 0 to + // cmapMax: + double logTexColor = absLogZeroVal + Math.log(absTextureColor); + + double texIndex = logTexColor / leftZero; + index = (zeroIndex - (zeroIndex * texIndex)); + } + } + return index; + } + + /** + * This function calculates a new index to use based on the logFactor and + * passed in index + * + * @param index + * @param logFactor + * @return + */ + public static double getLogFactorIndex(double index, double logFactor) { + if (logFactor > 0.0) { + double minLog = Math.log(logFactor); + double maxLog = Math.log(logFactor + 1.0); + + double lg = Math.log(logFactor + index); + + index = (lg - minLog) / (maxLog - minLog); + if (index < 0.0) { + index = 0.0; + } else if (index > 1.0) { + index = 1.0; + } + } + return index; + } + + /** + * Returns an index for the cmapValue based on the + * {@link ColorMapParameters} + * + * @param cmapValue + * @param colorMapping + * @return + */ + public static double getColorMappingIndex(double cmapValue, + ColorMapParameters colorMapParameters) { + double logFactor = colorMapParameters.getLogFactor(); + double cmapMin = colorMapParameters.getColorMapMin(); + double cmapMax = colorMapParameters.getColorMapMax(); + + double index; + if (colorMapParameters.isLogarithmic()) { + index = getLogIndex(cmapValue, cmapMin, cmapMax, + colorMapParameters.isMirror()); + } else { + index = getLinearIndex(cmapValue, cmapMin, cmapMax); + } + + // Apply logFactor if set + if (logFactor > 0.0) { + index = getLogFactorIndex(index, logFactor); + } + return index; + } + + /** + * Gets the {@link Color} from the color map in the parameters at the index + * (capped 0-1) passed in + * + * @param index + * @param colorMapParameters + * @return + */ + public static Color getColorByIndex(double index, + ColorMapParameters colorMapParameters) { + index = capIndex(index); + IColorMap colorMap = colorMapParameters.getColorMap(); + if (colorMapParameters.isInterpolate()) { + index = 0.5f; + index = (index * (colorMap.getSize() - 1)); + int lowIndex = (int) Math.floor(index); + int highIndex = (int) Math.ceil(index); + double lowWeight = highIndex - index; + double highWeight = 1.0f - lowWeight; + Color low = colorMap.getColors().get(lowIndex); + Color high = colorMap.getColors().get(highIndex); + float r = (float) (lowWeight * low.getRed() + highWeight + * high.getRed()); + float g = (float) (lowWeight * low.getGreen() + highWeight + * high.getGreen()); + float b = (float) (lowWeight * low.getBlue() + highWeight + * high.getBlue()); + float a = (float) (lowWeight * low.getAlpha() + highWeight + * high.getAlpha()); + return new Color(r, g, b, a); + } else { + return colorMap.getColors().get( + (int) (index * (colorMap.getSize() - 1))); + } + } + + /** + * Returns a {@link Color} for the cmapValue based on the + * {@link ColorMapParameters} + * + * @param cmapValue + * @param colorMapParameters + * @return + */ + public static Color getColorByValue(double cmapValue, + ColorMapParameters colorMapParameters) { + return getColorByIndex( + getColorMappingIndex(cmapValue, colorMapParameters), + colorMapParameters); + } } diff --git a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/ColorMapParameters.java b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/ColorMapParameters.java index 4793b2703b..b20d9a1518 100644 --- a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/ColorMapParameters.java +++ b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/prefs/ColorMapParameters.java @@ -22,7 +22,9 @@ package com.raytheon.uf.common.colormap.prefs; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; +import java.util.List; import java.util.Set; import javax.measure.converter.UnitConverter; @@ -35,8 +37,8 @@ import javax.xml.bind.annotation.XmlElement; import com.raytheon.uf.common.colormap.AbstractColorMap; import com.raytheon.uf.common.colormap.Color; import com.raytheon.uf.common.colormap.IColorMap; +import com.raytheon.uf.common.colormap.image.Colormapper; import com.raytheon.uf.common.colormap.prefs.DataMappingPreferences.DataMappingEntry; -import com.raytheon.uf.common.serialization.ISerializableObject; /** * Colormap Parameters @@ -56,14 +58,15 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * Jun 14, 2013 DR 16070 jgerth Utilize data mapping * Aug 2, 2013 2211 mschenke Backed out 16070 changes, made * dataUnit/imageUnit properly commutative. - * + * Nov 4, 2013 2492 mschenke Cleaned up variable naming to make purpose + * clear (image->colormap) * * * @author chammack * @version 1 */ @XmlAccessorType(XmlAccessType.NONE) -public class ColorMapParameters implements Cloneable, ISerializableObject { +public class ColorMapParameters { @XmlAccessorType(XmlAccessType.NONE) public static class PersistedParameters { @@ -123,13 +126,13 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { protected Set listeners = new HashSet(); - /** Units of the colormap parameters (min/max) */ + /** Units colormapping should be displayed in */ protected Unit displayUnit; - /** Units of the image pixel values */ - protected Unit imageUnit; + /** Units colormapping will occur in */ + protected Unit colorMapUnit; - /** Units of the data values */ + /** Units of the data values to colormap */ protected Unit dataUnit; /** The maximum value used to apply the colormap */ @@ -158,23 +161,23 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { @XmlAttribute protected String colorMapName; - /** The converter that converts data values to display values * */ + /** The converter that converts data values to {@link #displayUnit} * */ protected UnitConverter dataToDisplayConverter; - /** The converter that converts display values to data values * */ + /** The converter that converts display values to {@link #dataUnit} * */ protected UnitConverter displayToDataConverter; - /** The converter that converts data values to image pixels */ - protected UnitConverter dataToImageConverter; + /** The converter that converts data values to {@link #colorMapUnit} */ + protected UnitConverter dataToColorMapConverter; - /** The converter that converts image pixels to data values */ - protected UnitConverter imageToDataConverter; + /** The converter that converts color map unit values to {@link #dataUnit} */ + protected UnitConverter colorMapToDataConverter; - /** The converter that converts image pixels to display values */ - protected UnitConverter imageToDisplayConverter; + /** The converter that converts color map unit values to {@link #displayUnit} */ + protected UnitConverter colorMapToDisplayConverter; - /** The converter that converts display values to image pixels */ - protected UnitConverter displayToImageConverter; + /** The converter that converts display values to {@link #colorMapUnit} */ + protected UnitConverter displayToColorMapConverter; protected DataMappingPreferences dataMapping; @@ -201,7 +204,7 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { /** Specify whether the colormap should be interpolated */ protected boolean interpolate = false; - public static class LabelEntry { + public static class LabelEntry implements Comparable { private float location; private String text; @@ -258,8 +261,25 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { return true; } + /* + * (non-Javadoc) + * + * @see java.lang.Comparable#compareTo(java.lang.Object) + */ + @Override + public int compareTo(LabelEntry o) { + return Double.compare(getLocation(), o.getLocation()); + } + } + /** + * Creates a {@link UnitConverter} converting the from unit to the to unit. + * + * @param from + * @param to + * @return The unit converter or null of units are not compatible + */ private UnitConverter constructConverter(Unit from, Unit to) { UnitConverter converter = null; @@ -270,22 +290,34 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { return converter; } - private void addLabel(float dispValue, String s) { - float index = getIndexByValue(dispValue); + /** + * Adds a label for a {@link #displayUnit} value + * + * @param colorMapValue + * @param s + */ + private void addDisplayValueLabel(float dispValue, String s) { + float colorMapValue = dispValue; + UnitConverter displayToColorMap = getDisplayToColorMapConverter(); + if (displayToColorMap != null) { + colorMapValue = (float) displayToColorMap.convert(dispValue); + } + addColorMapValueLabel(colorMapValue, s); + } + + /** + * Adds a label for a {@link #colorMapUnit} value + * + * @param colorMapValue + * @param s + */ + private void addColorMapValueLabel(float colorMapValue, String s) { + double index = Colormapper.getColorMappingIndex(colorMapValue, this); if (index > 1.0 || index < 0.0) { return; } - labels.add(new LabelEntry(s, index)); - } - - private void addLabel(int pixelValue, String s) { - float location = (float) pixelValue / 255; - if (location > 1.0 || location < 0.0) { - return; - } - - labels.add(new LabelEntry(s, location)); + labels.add(new LabelEntry(s, (float) index)); } private void computeLabels() { @@ -298,7 +330,7 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { if (colorMapRange != 0.0) { for (float label : colorBarIntervals) { String s = format.format(label); - addLabel(label, s); + addDisplayValueLabel(label, s); } } } else if (dataMapping != null) { @@ -309,14 +341,15 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { if (s == null) { s = format.format(dispValue); } - addLabel(dispValue, s); + addDisplayValueLabel(dispValue, s); } else if (entry.getPixelValue() != null && !"NO DATA".equals(s)) { - double pixelValue = entry.getPixelValue(); - addLabel((int) pixelValue, s); + float pixelValue = entry.getPixelValue().floatValue(); + addColorMapValueLabel(pixelValue, s); } } } + Collections.sort(labels); recomputeLabels = false; } @@ -357,22 +390,26 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { } /** - * @return the unit + * Returns the display unit + * + * @return The unit colormapping should be displayed in */ public Unit getDisplayUnit() { return displayUnit; } /** + * Sets the display units + * * @param unit - * the unit to set + * The unit colormapping should be displayed in */ public void setDisplayUnit(Unit unit) { this.displayUnit = unit; recomputeLabels = true; - displayToImageConverter = null; - imageToDisplayConverter = null; + displayToColorMapConverter = null; + colorMapToDisplayConverter = null; displayToDataConverter = null; dataToDisplayConverter = null; @@ -380,25 +417,32 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { } /** - * @return the colorMapMax + * Returns the maximum range value the colormapping occurs over + * + * @return the maximum range value in {@link #colorMapUnit} */ public float getColorMapMax() { return colorMapMax; } /** + * Sets the maximum range value the colormapping occurs over + * * @param colorMapMax - * the colorMapMax to set + * the maximum range value in {@link #colorMapUnit} */ public void setColorMapMax(float colorMapMax) { setColorMapMax(colorMapMax, false); } /** + * Sets the maximum range value the colormapping occurs over + * * @param colorMapMax - * the colorMapMax to set + * the maximum range value in {@link #colorMapUnit} * @param persist - * specifies whether to persist this value when saved + * true indicates colorMapMax should be persisted through + * serialization */ public void setColorMapMax(float colorMapMax, boolean persist) { this.colorMapMax = colorMapMax; @@ -410,25 +454,32 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { } /** - * @return the colorMapMin + * Returns the minimum range value the colormapping occurs over + * + * @return the minimum range value in {@link #colorMapUnit} */ public float getColorMapMin() { return colorMapMin; } /** + * Sets the minimum range value the colormapping occurs over + * * @param colorMapMin - * the colorMapMin to set + * the minimum range value in {@link #colorMapUnit} */ public void setColorMapMin(float colorMapMin) { setColorMapMin(colorMapMin, false); } /** + * Sets the minimum range value the colormapping occurs over + * * @param colorMapMin - * the colorMapMin to set + * the minimum range value in {@link #colorMapUnit} * @param persist - * specifies whether to persist this value when saved + * true indicates colorMapMin should be persisted through + * serialization */ public void setColorMapMin(float colorMapMin, boolean persist) { this.colorMapMin = colorMapMin; @@ -510,6 +561,8 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { } /** + * Returns the unit data values to be colormapped are in + * * @return the dataUnit */ public Unit getDataUnit() { @@ -517,18 +570,20 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { } /** + * Sets the unit data values to be colormapped are in + * * @param dataUnit * the dataUnit to set */ public void setDataUnit(Unit dataUnit) { this.dataUnit = dataUnit; - if (dataUnit != null && imageUnit == null) { - setImageUnit(dataUnit); + if (dataUnit != null && colorMapUnit == null) { + setColorMapUnit(dataUnit); } - dataToImageConverter = null; - imageToDataConverter = null; + dataToColorMapConverter = null; + colorMapToDataConverter = null; dataToDisplayConverter = null; displayToDataConverter = null; @@ -537,6 +592,9 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { } /** + * Returns the {@link UnitConverter} from {@link #dataUnit} to + * {@link #displayUnit} + * * @return the dataToDisplayConverter */ public UnitConverter getDataToDisplayConverter() { @@ -550,6 +608,9 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { } /** + * Returns the {@link UnitConverter} from {@link #displayUnit} to + * {@link #dataUnit} + * * @return the displayToDataConverter */ public UnitConverter getDisplayToDataConverter() { @@ -562,7 +623,7 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { return displayToDataConverter; } - public java.util.List getLabels() { + public List getLabels() { if (recomputeLabels) { computeLabels(); notifyListener(); @@ -570,10 +631,22 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { return labels; } + /** + * Returns true if the colormapping is logarithmically scaled from + * {@link #colorMapMin} to {@link #colorMapMax} + * + * @return + */ public boolean isLogarithmic() { return logarithmic; } + /** + * Set to true if the colormapping should logarithmically scaled from + * {@link #colorMapMin} to {@link #colorMapMax} + * + * @param logarithmic + */ public void setLogarithmic(boolean logarithmic) { recomputeLabels = recomputeLabels | this.logarithmic != logarithmic; this.logarithmic = logarithmic; @@ -581,83 +654,162 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { } /** - * @return the dataToImageConverter + * @deprecated Use {@link #getDataToColorMapConverter()} instead + * + * @return the dataToColorMapConverter */ + @Deprecated public UnitConverter getDataToImageConverter() { - if (dataToImageConverter == null) { - dataToImageConverter = constructConverter(dataUnit, imageUnit); - if (dataToImageConverter != null) { - notifyListener(); - } - } - return dataToImageConverter; + return getDataToColorMapConverter(); } /** - * @return the imageToDisplayConverter + * Returns a {@link UnitConverter} converting {@link #dataUnit} values to + * the {@link #colorMapUnit} if compatible or null otherwise + * + * @return */ + public UnitConverter getDataToColorMapConverter() { + if (dataToColorMapConverter == null) { + dataToColorMapConverter = constructConverter(dataUnit, colorMapUnit); + if (dataToColorMapConverter != null) { + notifyListener(); + } + } + return dataToColorMapConverter; + } + + /** + * @deprecated Use {@link #getColorMapToDisplayConverter()} instead + * + * @return the colorMapToDisplayConverter + */ + @Deprecated public UnitConverter getImageToDisplayConverter() { - if (imageToDisplayConverter == null) { - imageToDisplayConverter = constructConverter(imageUnit, displayUnit); - if (imageToDisplayConverter != null) { + return getColorMapToDisplayConverter(); + } + + /** + * Returns a {@link UnitConverter} converting {@link #colorMapUnit} values + * to the {@link #displayUnit} if compatible or null otherwise + * + * @return + */ + public UnitConverter getColorMapToDisplayConverter() { + if (colorMapToDisplayConverter == null) { + colorMapToDisplayConverter = constructConverter(colorMapUnit, + displayUnit); + if (colorMapToDisplayConverter != null) { notifyListener(); } } - return imageToDisplayConverter; + return colorMapToDisplayConverter; } /** - * @return the imageUnit + * @deprecated Use {@link #getColorMapUnit()} instead + * + * @return the colorMapUnit */ + @Deprecated public Unit getImageUnit() { - return imageUnit; + return getColorMapUnit(); } /** - * @param imageUnit - * the imageUnit to set + * Returns the unit colormapping will occur in + * + * @return */ - public void setImageUnit(Unit imageUnit) { - this.imageUnit = imageUnit; + public Unit getColorMapUnit() { + return colorMapUnit; + } - if (imageUnit != null && dataUnit == null) { - setDataUnit(imageUnit); + /** + * @deprecated Use {@link #setColorMapUnit(Unit)} instead + * + * @param imageUnit + * the colorMapUnit to set + */ + @Deprecated + public void setImageUnit(Unit imageUnit) { + setColorMapUnit(imageUnit); + } + + /** + * Sets the unit colormapping will occur in. {@link #colorMapMin} and + * {@link #colorMapMax} are expected to be in this unit + * + * @param colorMapUnit + */ + public void setColorMapUnit(Unit colorMapUnit) { + this.colorMapUnit = colorMapUnit; + + if (colorMapUnit != null && dataUnit == null) { + setDataUnit(colorMapUnit); } recomputeLabels = true; - imageToDataConverter = null; - dataToImageConverter = null; + colorMapToDataConverter = null; + dataToColorMapConverter = null; - imageToDisplayConverter = null; - displayToImageConverter = null; + colorMapToDisplayConverter = null; + displayToColorMapConverter = null; notifyListener(); } /** - * @return the imageToDataConverter + * @deprecated Use {@link #getColorMapToDataConverter()} instead + * + * @return the colorMapToDataConverter */ + @Deprecated public UnitConverter getImageToDataConverter() { - if (imageToDataConverter == null) { - imageToDataConverter = constructConverter(imageUnit, dataUnit); - if (imageToDataConverter != null) { - notifyListener(); - } - } - return imageToDataConverter; + return getColorMapToDataConverter(); } /** - * @return the displayToImageConverter + * Returns a {@link UnitConverter} converting {@link #colorMapUnit} values + * to the {@link #dataUnit} if compatible or null otherwise + * + * @return */ - public UnitConverter getDisplayToImageConverter() { - if (displayToImageConverter == null) { - displayToImageConverter = constructConverter(displayUnit, imageUnit); - if (displayToImageConverter != null) { + public UnitConverter getColorMapToDataConverter() { + if (colorMapToDataConverter == null) { + colorMapToDataConverter = constructConverter(colorMapUnit, dataUnit); + if (colorMapToDataConverter != null) { notifyListener(); } } - return displayToImageConverter; + return colorMapToDataConverter; + } + + /** + * @deprecated Use {@link #getDisplayToColorMapConverter()} instead + * + * @return the displayToColorMapConverter + */ + @Deprecated + public UnitConverter getDisplayToImageConverter() { + return getDisplayToColorMapConverter(); + } + + /** + * Returns a {@link UnitConverter} converting {@link #displayUnit} values to + * the {@link #colorMapUnit} if compatible or null otherwise + * + * @return + */ + public UnitConverter getDisplayToColorMapConverter() { + if (displayToColorMapConverter == null) { + displayToColorMapConverter = constructConverter(displayUnit, + colorMapUnit); + if (displayToColorMapConverter != null) { + notifyListener(); + } + } + return displayToColorMapConverter; } /** @@ -668,7 +820,7 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { this.dataMapping = dataMapping; recomputeLabels = true; if (dataMapping != null && displayUnit != null) { - setImageUnit(dataMapping.getImageUnit(displayUnit)); + setColorMapUnit(dataMapping.getImageUnit(displayUnit)); } notifyListener(); } @@ -707,12 +859,12 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { cmp.dataMax = dataMax; cmp.dataMin = dataMin; cmp.dataToDisplayConverter = dataToDisplayConverter; - cmp.dataToImageConverter = dataToImageConverter; + cmp.dataToColorMapConverter = dataToColorMapConverter; cmp.dataUnit = dataUnit; cmp.formatString = formatString; - cmp.imageToDataConverter = imageToDataConverter; - cmp.imageToDisplayConverter = imageToDisplayConverter; - cmp.imageUnit = imageUnit; + cmp.colorMapToDataConverter = colorMapToDataConverter; + cmp.colorMapToDisplayConverter = colorMapToDisplayConverter; + cmp.colorMapUnit = colorMapUnit; cmp.labels = labels; cmp.recomputeLabels = recomputeLabels; cmp.persisted = persisted.clone(); @@ -779,196 +931,19 @@ public class ColorMapParameters implements Cloneable, ISerializableObject { return mirror; } - public static void main(String[] args) { - float[] testValues = { -3.622782E-10f, -1.6778468E-8f, -3.3110254E-8f, - -3.7973948E-8f, -2.7633986E-8f, -9.904648E-9f, -7.5229956E-10f, - 7.5189455E-10f, 1.20609505E-8f, 2.9364383E-8f, 2.7346168E-8f, - 1.3699442E-10f, -2.9937E-8f, -3.6884128E-8f, -1.6217847E-8f, - 1.1931893E-8f, 2.252287E-8f, 1.3290519E-8f, -2.4843547E-9f, - -1.0386745E-8f, -6.1300884E-9f, 3.266153E-9f, 1.078073E-8f, - 1.2696603E-8f, 4.315502E-9f, -7.2422215E-9f, -1.2054819E-8f, - -9.100724E-9f, -2.2520505E-9f, 4.031535E-9f, 6.908326E-9f, - 4.5536255E-9f, 5.3565863E-10f, -6.767242E-11f, 1.7508048E-9f, - 1.2594312E-9f, -3.5915362E-9f, -6.42762E-9f, -6.295979E-9f, - -3.857202E-9f, -2.2052171E-9f, 6.51567E-10f, 3.1020404E-9f, - 3.2179108E-9f, 2.080211E-9f, 2.5326197E-10f, -2.181367E-9f, - -3.2126295E-9f, -2.2162419E-9f, -5.682299E-10f, 7.367537E-11f, - 1.7393351E-9f, 3.2000091E-9f, 2.82146E-9f, 1.9214115E-9f, - 1.2637547E-9f, 1.1449517E-9f, 9.570286E-10f, 2.4719807E-10f, - 7.4189294E-11f, -1.9902982E-10f, -1.6482227E-9f, -2.645924E-9f, - -1.4331059E-9f, -2.6336155E-10f, -1.5215194E-9f, - -1.5059594E-9f, 2.014035E-10f, 3.565288E-10f, -1.5582429E-9f, - -1.3200975E-9f, 1.2632209E-10f, 1.0882992E-9f, 1.5682087E-9f, - 4.24027E-9f, 3.1678654E-10f, -3.9073598E-9f, -3.4730894E-9f, - -9.989449E-10f, -4.0364423E-9f, -6.3506116E-9f, -2.8335263E-9f, - -3.1253768E-9f, -1.1271912E-9f, -3.0793168E-10f, 2.2091975E-9f, - 4.9031823E-9f, 1.0454194E-8f, 1.6462849E-8f, 1.339688E-8f, - 6.4451755E-9f, 3.820775E-9f, 1.7874671E-9f, -4.5423043E-9f, - -4.7599173E-9f, -3.718451E-9f, 2.086526E-10f, 4.4792867E-9f, - -5.1967337E-9f, -1.0332604E-8f }; - - ColorMapParameters colorMapParameters = new ColorMapParameters(); - float min = -2.6945168e-7f; - float max = 2.1146788e-7f; - colorMapParameters.setColorMapMin(-2.6945168e-7f); - colorMapParameters.setColorMapMax(2.1146788e-7f); - colorMapParameters.setLogarithmic(true); - DecimalFormat format = new DecimalFormat("0.###"); - int i = 0; - for (float dispValue : testValues) { - String s = format.format(dispValue); - colorMapParameters.addLabel(dispValue, s); - if (dispValue > max) { - System.out.println(colorMapParameters.labels.get(i).location - + "to high"); - } else if (dispValue < min) { - System.out.println(colorMapParameters.labels.get(i).location - + "to low"); - } else { - System.out.println(colorMapParameters.labels.get(i).location); - } - i++; - } - } - - private float getIndexByValue(float dispValue) { - UnitConverter displayToImage = getDisplayToImageConverter(); - float colorMapRange; - if (logarithmic) { - // float colorMapMin = this.colorMapMin * 1.25f; - // float colorMapMax = this.colorMapMax * 1.25f; - if (displayToImage != null) { - dispValue = (float) displayToImage.convert(dispValue); - } - float index = 0.0f; - // is this strictly negative, strictly positive or neg to pos - // scaling? - if (colorMapMin >= 0.0 && colorMapMax >= 0.0 && !isMirror()) { - // simple calculation - index = ((float) Math.log(dispValue) - (float) Math - .log(colorMapMin)) - / (float) Math.abs((float) Math.log(colorMapMax) - - (float) Math.log(colorMapMin)); - } else if (colorMapMin <= 0.0 && colorMapMax <= 0.0 && !isMirror()) { - index = ((float) (Math.log(dispValue) - (float) Math - .log(colorMapMax)) / (float) Math.abs((float) Math - .log(colorMapMin) - (float) Math.log(colorMapMax))); - } else { - // special case, neg to pos: - float cmapMin = colorMapMin; - float cmapMax = colorMapMax; - float zeroVal = (float) Math.max(cmapMax, - (float) Math.abs(cmapMin)) * 0.0001f; - ; - - if (isMirror() && (cmapMin > 0 || cmapMax < 0)) { - if (cmapMax < 0) { - cmapMax = -cmapMax; - dispValue = -dispValue; - zeroVal = -cmapMin; - } else { - zeroVal = cmapMin; - } - cmapMin = -cmapMax; - - } - float leftZero = 0; - float rightZero = 0; - float absLogZeroVal = (float) Math.abs((float) Math - .log(zeroVal)); - - rightZero = absLogZeroVal + (float) Math.log(cmapMax); - - float cmapMax2 = -1 * cmapMin; - - leftZero = absLogZeroVal + (float) Math.log(cmapMax2); - - float zeroIndex = leftZero / (leftZero + rightZero); - - // figure out index for texture val - float absTextureColor = (float) Math.abs(dispValue); - if (dispValue == 0) { - index = zeroIndex; - } else if (absTextureColor <= zeroVal) { - index = (float) zeroIndex; - } else if (dispValue > 0.0) { - // positive texture color value, find index from 0 to - // cmapMax: - float logTexColor = absLogZeroVal - + (float) Math.log(dispValue); - - float texIndex = logTexColor / rightZero; - index = (float) (zeroIndex + ((1.0 - zeroIndex) * texIndex)); - } else { - // negative texture color value, find index from 0 to - // cmapMax: - float logTexColor = absLogZeroVal - + (float) Math.log(absTextureColor); - - float texIndex = logTexColor / leftZero; - index = (zeroIndex - (zeroIndex * texIndex)); - } - } - - return index; - } else { - colorMapRange = colorMapMax - colorMapMin; - - if (colorMapRange != 0.0) { - double pixelValue; - if (displayToImage != null) { - pixelValue = displayToImage.convert(dispValue); - } else { - pixelValue = dispValue; - } - float location; - if (logarithmic) { - location = (float) ((Math.log(pixelValue) - Math - .log(colorMapMin)) / colorMapRange); - } else { - - location = ((float) pixelValue - colorMapMin) - / colorMapRange; - } - return location; - } else { - return 0.0f; - } - } - } - /** * Get the Color object of the value * * @param value + * value to get Color for in {@link #displayUnit} * @return */ public Color getColorByValue(float value) { - float index = getIndexByValue(value); - if (index < 0.0f) { - index = 0.0f; - } else if (index > 1.0f) { - index = 1.0f; - } - if (isInterpolate()) { - index = 0.5f; - index = (index * (colorMap.getSize() - 1)); - int lowIndex = (int) Math.floor(index); - int highIndex = (int) Math.ceil(index); - float lowWeight = highIndex - index; - float highWeight = 1.0f - lowWeight; - Color low = colorMap.getColors().get(lowIndex); - Color high = colorMap.getColors().get(highIndex); - float r = lowWeight * low.getRed() + highWeight * high.getRed(); - float g = lowWeight * low.getGreen() + highWeight * high.getGreen(); - float b = lowWeight * low.getBlue() + highWeight * high.getBlue(); - float a = lowWeight * low.getAlpha() + highWeight * high.getAlpha(); - return new Color(r, g, b, a); - } else { - return colorMap.getColors().get( - (int) (index * (colorMap.getSize() - 1))); - + UnitConverter displayToColorMap = getDisplayToColorMapConverter(); + if (displayToColorMap != null) { + value = (float) displayToColorMap.convert(value); } + return Colormapper.getColorByValue(value, this); } /** diff --git a/cave/com.raytheon.uf.viz.npp.viirs/localization/colormaps/NPP/VIIRS/CA (Low Light Vis).cmap b/edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/utility/common_static/base/colormaps/NPP/VIIRS/CA (Low Light Vis).cmap similarity index 100% rename from cave/com.raytheon.uf.viz.npp.viirs/localization/colormaps/NPP/VIIRS/CA (Low Light Vis).cmap rename to edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/utility/common_static/base/colormaps/NPP/VIIRS/CA (Low Light Vis).cmap diff --git a/cave/com.raytheon.uf.viz.npp.viirs/localization/colormaps/NPP/VIIRS/IR BrightTemps.cmap b/edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/utility/common_static/base/colormaps/NPP/VIIRS/IR BrightTemps.cmap similarity index 100% rename from cave/com.raytheon.uf.viz.npp.viirs/localization/colormaps/NPP/VIIRS/IR BrightTemps.cmap rename to edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/utility/common_static/base/colormaps/NPP/VIIRS/IR BrightTemps.cmap diff --git a/cave/com.raytheon.uf.viz.npp.viirs/localization/colormaps/NPP/VIIRS/IR Default.cmap b/edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/utility/common_static/base/colormaps/NPP/VIIRS/IR Default.cmap similarity index 100% rename from cave/com.raytheon.uf.viz.npp.viirs/localization/colormaps/NPP/VIIRS/IR Default.cmap rename to edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/utility/common_static/base/colormaps/NPP/VIIRS/IR Default.cmap diff --git a/cave/com.raytheon.uf.viz.npp.viirs/localization/colormaps/NPP/VIIRS/ZA (Vis Default).cmap b/edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/utility/common_static/base/colormaps/NPP/VIIRS/ZA (Vis Default).cmap similarity index 100% rename from cave/com.raytheon.uf.viz.npp.viirs/localization/colormaps/NPP/VIIRS/ZA (Vis Default).cmap rename to edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/utility/common_static/base/colormaps/NPP/VIIRS/ZA (Vis Default).cmap diff --git a/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/FileLocker.java b/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/FileLocker.java index f9b7194e6c..51563c383e 100644 --- a/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/FileLocker.java +++ b/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/FileLocker.java @@ -378,7 +378,7 @@ public class FileLocker { // locking, can't do any locking if (parentDir.canWrite() == false) { UFStatus.getHandler() - .handle(Priority.PROBLEM, + .handle(Priority.DEBUG, "Cannot write to directory: " + parentDir.getAbsolutePath()); return false; diff --git a/edexOsgi/com.raytheon.uf.common.topo/utility/common_static/base/styleRules/topoImageryStyleRules.xml b/edexOsgi/com.raytheon.uf.common.topo/utility/common_static/base/styleRules/topoImageryStyleRules.xml index 05507c29fb..bb6cd39900 100644 --- a/edexOsgi/com.raytheon.uf.common.topo/utility/common_static/base/styleRules/topoImageryStyleRules.xml +++ b/edexOsgi/com.raytheon.uf.common.topo/utility/common_static/base/styleRules/topoImageryStyleRules.xml @@ -27,7 +27,7 @@ kft - -0.0062 + -0.062 16.404 topo diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.core.feature/feature.xml b/edexOsgi/com.raytheon.uf.edex.datadelivery.core.feature/feature.xml index 51ee27c088..ca1e5bb24a 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.core.feature/feature.xml +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.core.feature/feature.xml @@ -107,6 +107,13 @@ install-size="0" version="0.0.0" unpack="false"/> + + - - + * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * September, 2013 behemmi Initial creation + * + * + * + * @author behemmi + * @version 1.0 + */ public class CXFLogger extends org.apache.cxf.interceptor.LoggingInInterceptor { protected IUFStatusHandler log = UFStatus.getHandler(this.getClass()); diff --git a/edexOsgi/com.raytheon.uf.edex.log/src/com/raytheon/uf/edex/log/cxf/RequestLogController.java b/edexOsgi/com.raytheon.uf.edex.log/src/com/raytheon/uf/edex/log/cxf/RequestLogController.java index e1631fc37a..b60fb69726 100644 --- a/edexOsgi/com.raytheon.uf.edex.log/src/com/raytheon/uf/edex/log/cxf/RequestLogController.java +++ b/edexOsgi/com.raytheon.uf.edex.log/src/com/raytheon/uf/edex/log/cxf/RequestLogController.java @@ -12,10 +12,21 @@ package com.raytheon.uf.edex.log.cxf; import com.raytheon.uf.common.status.UFStatus.Priority; /** - * Singleton to control how incoming request information is logged. Implemented as - * a singleton to allow runtime control from a Web Client + * Singleton to control how incoming request information is logged. Implemented + * as a singleton to allow runtime control from a Web Client + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * September, 2013            behemmi     Initial creation
+ * 
+ * 
+ * * @author behemmi - * + * @version 1.0 */ public class RequestLogController { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.ogc.common/META-INF/MANIFEST.MF index ef4e9cacfe..7e64db705b 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/META-INF/MANIFEST.MF @@ -25,7 +25,6 @@ Require-Bundle: net.opengis;bundle-version="1.0.2", com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174", com.raytheon.uf.edex.log;bundle-version="1.12.1174" Export-Package: com.raytheon.uf.edex.ogc.common, - com.raytheon.uf.edex.ogc.common.colormap, com.raytheon.uf.edex.ogc.common.db, com.raytheon.uf.edex.ogc.common.feature, com.raytheon.uf.edex.ogc.common.filter, diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractFSQueryStore.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractFSQueryStore.java index 904b58be80..71a654a570 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractFSQueryStore.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractFSQueryStore.java @@ -29,20 +29,21 @@ import com.raytheon.uf.common.spatial.reprojection.KeyLocker.KeyLock; import com.raytheon.uf.edex.ogc.common.OgcException.Code; /** - * TODO Add Description + * Abstract base for file system backed query stores. Provides threadsafe + * list/store/delete operations. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 15, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public abstract class AbstractFSQueryStore extends AbstractFsStore { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractFsStore.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractFsStore.java index c09d3eb9d0..a9695ae211 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractFsStore.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractFsStore.java @@ -18,21 +18,23 @@ import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.PathManagerFactory; /** - * Abstract File store + * Abstract File system storage. Provides basic storage location and id <-> file + * name encoding methods. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jun 4, 2013            bclement     Initial creation
  * Aug 18, 2013  #2097    dhladky      Changed to configured
- *
+ * October, 2012  #2472   dhladky/bclement     Changed back to base
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class AbstractFsStore { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractOpDescriber.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractOpDescriber.java index 809b902460..cb13ad2e6b 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractOpDescriber.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/AbstractOpDescriber.java @@ -28,20 +28,21 @@ import net.opengis.ows.v_1_1_0.RequestMethodType; import net.opengis.ows.v_1_1_0.ValueType; /** - * TODO Add Description + * Abstract base for OGC operation descriptions. Provides common utility methods + * for populating OGC capabilities documents. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 21, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public abstract class AbstractOpDescriber { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/BasicFileStore.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/BasicFileStore.java index ddd7a65d53..e4580ce2b2 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/BasicFileStore.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/BasicFileStore.java @@ -23,21 +23,21 @@ import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.PathManagerFactory; /** - * Basic File Store + * Basic file system storage. Overlaps functionality with AbstractFsStore. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Mar 11, 2013            bclement     Initial creation
  * Aug 18, 2013  #2097     dhladky      Moved to configured
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class BasicFileStore { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/IStyleLookupCallback.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/IStyleLookupCallback.java index 67100732fb..a244dc949a 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/IStyleLookupCallback.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/IStyleLookupCallback.java @@ -14,25 +14,37 @@ import java.util.List; import com.raytheon.uf.common.dataplugin.PluginDataObject; /** - * TODO Add Description + * Callback interface used by stylers to have access to plugin metadata. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Sep 30, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public interface IStyleLookupCallback { + /** + * @param layerName + * @return a sample data record that supports layer + * @throws OgcException + */ public R lookupSample(String layerName) throws OgcException; + /** + * Return a list of samples for plugin. One sample per layer advertised by + * source. + * + * @return + * @throws OgcException + */ public List getAllSamples() throws OgcException; } diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/InvalidVersionException.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/InvalidVersionException.java index 2620f05d4c..71a9a0e54a 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/InvalidVersionException.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/InvalidVersionException.java @@ -10,20 +10,20 @@ package com.raytheon.uf.edex.ogc.common; /** - * TODO Add Description + * Exception thrown when parsing version numbers * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 26, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class InvalidVersionException extends Exception { @@ -34,7 +34,6 @@ public class InvalidVersionException extends Exception { * */ public InvalidVersionException() { - // TODO Auto-generated constructor stub } /** diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcBoundingBox.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcBoundingBox.java index b9c655b3b2..b69067d199 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcBoundingBox.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcBoundingBox.java @@ -21,6 +21,23 @@ package com.raytheon.uf.edex.ogc.common; import com.vividsolutions.jts.geom.Envelope; +/** + * Bounding box with arbitrary CRS that also stored resolution information. + * Should be replaced with GridGeometry2D. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011                    bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ public class OgcBoundingBox extends OgcGeoBoundingBox { protected String crs; diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcDimension.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcDimension.java index fefc8c1e95..a00d7b12dd 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcDimension.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcDimension.java @@ -24,9 +24,24 @@ package com.raytheon.uf.edex.ogc.common; import java.util.List; + /** - * @author bclement + * Contains dimension metadata used to populate capability and description OGC + * documents. Separate from OGC JAXB objects to support different versions of + * OGC services. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class OgcDimension { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcException.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcException.java index bcef6ca0dc..ef83c64998 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcException.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcException.java @@ -20,6 +20,22 @@ package com.raytheon.uf.edex.ogc.common; +/** + * Exception class containing OGC specific error codes. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ public class OgcException extends Exception { private static final long serialVersionUID = -5832661027013919871L; diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcGeoBoundingBox.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcGeoBoundingBox.java index 96d9bee5f3..67c58ec0df 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcGeoBoundingBox.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcGeoBoundingBox.java @@ -29,9 +29,23 @@ import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Polygon; + /** - * @author bclement + * Contains CRS:84 longitudes and latitudes for OGC metadata. Should be replaced + * with ReferencedEnvelope. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class OgcGeoBoundingBox { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcLayer.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcLayer.java index b5ad0af36a..91dab10fdc 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcLayer.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcLayer.java @@ -27,9 +27,24 @@ import java.util.List; import org.apache.commons.lang.StringUtils; + /** - * @author bclement + * Contains layer metadata used to populate capability and description OGC + * documents. Separate from OGC JAXB objects to support different versions of + * OGC services. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class OgcLayer { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcNamespace.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcNamespace.java index 5c91da8d25..8b2921f513 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcNamespace.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcNamespace.java @@ -22,9 +22,22 @@ */ package com.raytheon.uf.edex.ogc.common; + /** - * @author bclement + * Static constants for OGC related XML namespaces * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class OgcNamespace { public static final String GML = "http://www.opengis.net/gml"; diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcOperationInfo.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcOperationInfo.java index 984b71512e..3ea7fbee8e 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcOperationInfo.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcOperationInfo.java @@ -25,9 +25,23 @@ package com.raytheon.uf.edex.ogc.common; import java.util.LinkedList; import java.util.List; + /** - * @author bclement + * Contains operations metadata used to populated OGC capabilities documents. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + * @param */ public class OgcOperationInfo { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcPrefix.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcPrefix.java index 4677b7b86a..53b95ef48c 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcPrefix.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcPrefix.java @@ -22,9 +22,22 @@ */ package com.raytheon.uf.edex.ogc.common; + /** - * @author bclement + * Static constants for OGC related XML namespace prefixes * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class OgcPrefix { /** diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcResponse.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcResponse.java index 5d0f91550b..c0fc6fd769 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcResponse.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcResponse.java @@ -21,6 +21,22 @@ package com.raytheon.uf.edex.ogc.common; import com.raytheon.uf.edex.ogc.common.http.MimeType; +/** + * Response wrapper for OGC web services + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ public class OgcResponse { public static final MimeType TEXT_XML_MIME = new MimeType("text/xml"); diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcServiceInfo.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcServiceInfo.java index 3a08e04e51..8effc89856 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcServiceInfo.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcServiceInfo.java @@ -25,9 +25,23 @@ package com.raytheon.uf.edex.ogc.common; import java.util.LinkedList; import java.util.List; + /** - * @author bclement + * Contains services metadata used to populated OGC capabilities documents. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + * @param */ public class OgcServiceInfo { protected String onlineResource; diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcStyle.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcStyle.java index ebc770e525..ca3ee40211 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcStyle.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcStyle.java @@ -19,6 +19,24 @@ **/ package com.raytheon.uf.edex.ogc.common; +/** + * Contains style metadata used to populate capability and description OGC + * documents. Separate from OGC JAXB objects to support different versions of + * OGC services. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ public class OgcStyle { protected String name; diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcTimeRange.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcTimeRange.java index 662e961387..1eadd38773 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcTimeRange.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/OgcTimeRange.java @@ -1,3 +1,22 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ package com.raytheon.uf.edex.ogc.common; import java.util.Date; diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/StyleLookup.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/StyleLookup.java index 5986749dd6..a173e85a68 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/StyleLookup.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/StyleLookup.java @@ -21,10 +21,22 @@ package com.raytheon.uf.edex.ogc.common; import java.util.List; + /** - * + * Styling interface for retrieving style information for layers + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 29, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement - * @version 1.0 + * @version 1.0 */ public interface StyleLookup { @@ -34,6 +46,9 @@ public interface StyleLookup { */ public String lookup(String layername); + /** + * @return all styles + */ public List getStyles(); public void setLoader(ClassLoader loader); diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/Version.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/Version.java index 57ee4b4f10..fe084a9e91 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/Version.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/Version.java @@ -30,6 +30,22 @@ import javax.xml.bind.annotation.XmlAttribute; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * Version object to track versions of OGC services + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class Version implements Comparable, Serializable { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/ColorbarLabeling.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/ColorbarLabeling.java deleted file mode 100644 index 54592a5d63..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/ColorbarLabeling.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The following software products were developed by Raytheon: - * - * ADE (AWIPS Development Environment) software - * CAVE (Common AWIPS Visualization Environment) software - * EDEX (Environmental Data Exchange) software - * uFrame™ (Universal Framework) software - * - * Copyright (c) 2010 Raytheon Co. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/org/documents/epl-v10.php - * - * - * Contractor Name: Raytheon Company - * Contractor Address: - * 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - */ -package com.raytheon.uf.edex.ogc.common.colormap; - -import javax.xml.bind.annotation.XmlAccessOrder; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorOrder; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.NONE) -@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) -public class ColorbarLabeling { - @XmlElement - String increment; - - @XmlElement - String values; - - public String getIncrement() { - return increment; - } - - public void setIncriment(String increment) { - this.increment = increment; - } - - public String getValues() { - return values; - } - - public void setValues(String values) { - this.values = values; - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/LevelRange.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/LevelRange.java deleted file mode 100644 index 95c57394ec..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/LevelRange.java +++ /dev/null @@ -1,101 +0,0 @@ -/* -* The following software products were developed by Raytheon: -* -* ADE (AWIPS Development Environment) software -* CAVE (Common AWIPS Visualization Environment) software -* EDEX (Environmental Data Exchange) software -* uFrame™ (Universal Framework) software -* -* Copyright (c) 2010 Raytheon Co. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/org/documents/epl-v10.php -* -* -* Contractor Name: Raytheon Company -* Contractor Address: -* 6825 Pine Street, Suite 340 -* Mail Stop B8 -* Omaha, NE 68106 -* 402.291.0100 -* -* -* SOFTWARE HISTORY -* -* Date Ticket# Engineer Description -* ------------ ---------- ----------- -------------------------- -* Dec 9, 2011 ekladstrup Initial creation -* -*/ - -package com.raytheon.uf.edex.ogc.common.colormap; - -import javax.xml.bind.annotation.XmlAccessOrder; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorOrder; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -/** - * TODO Add Description - * - * @author ekladstrup - * @version 1.0 - */ -@XmlAccessorType(XmlAccessType.NONE) -@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) -public class LevelRange { - - @XmlAttribute - private String level; - - @XmlElement - private Float upper; - - @XmlElement - private Float lower; - - @XmlAttribute - private String unit; - - public LevelRange() { - - } - - - public Float getUpper() { - return upper; - } - - public void setUpper(Float upper) { - this.upper = upper; - } - - public Float getLower() { - return lower; - } - - public void setLower(Float lower) { - this.lower = lower; - } - - public void setLevel(String level) { - this.level = level; - } - - public String getLevel() { - return level; - } - - - public void setUnit(String unit) { - this.unit = unit; - } - - - public String getUnit() { - return unit; - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/MapRange.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/MapRange.java deleted file mode 100644 index 77b0a7cfe3..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/MapRange.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * The following software products were developed by Raytheon: - * - * ADE (AWIPS Development Environment) software - * CAVE (Common AWIPS Visualization Environment) software - * EDEX (Environmental Data Exchange) software - * uFrame™ (Universal Framework) software - * - * Copyright (c) 2010 Raytheon Co. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/org/documents/epl-v10.php - * - * - * Contractor Name: Raytheon Company - * Contractor Address: - * 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 9, 2011 ekladstrup Initial creation - * - */ -package com.raytheon.uf.edex.ogc.common.colormap; - -import javax.xml.bind.annotation.XmlAccessOrder; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorOrder; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -/** - * TODO Add Description - * - * @author ekladstrup - * @version 1.0 - */ -@XmlAccessorType(XmlAccessType.NONE) -@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) -public class MapRange { - - @XmlAttribute - private String type; - - /** - * indicates that this range was pulled from "thin air" and can be replaced - * if a better range is known - */ - @XmlAttribute - private boolean replaceable = false; - - @XmlElement - private Float upperMinimum; - - @XmlElement - private Float upperMaximum; - - @XmlElement - private Float lowerMinimum; - - @XmlElement - private Float lowerMaximum; - - public MapRange() { - - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Float getUpperMinimum() { - return upperMinimum; - } - - public void setUpperMinimum(Float upperMinimum) { - this.upperMinimum = upperMinimum; - } - - public Float getUpperMaximum() { - return upperMaximum; - } - - public void setUpperMaximum(Float upperMaximum) { - this.upperMaximum = upperMaximum; - } - - public Float getLowerMinimum() { - return lowerMinimum; - } - - public void setLowerMinimum(Float lowerMinimum) { - this.lowerMinimum = lowerMinimum; - } - - public Float getLowerMaximum() { - return lowerMaximum; - } - - public void setLowerMaximum(Float lowerMaximum) { - this.lowerMaximum = lowerMaximum; - } - - public void setReplaceable(boolean replaceable) { - this.replaceable = replaceable; - } - - public boolean isReplaceable() { - return replaceable; - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/StyleRule.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/StyleRule.java deleted file mode 100644 index 54da933899..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/StyleRule.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * The following software products were developed by Raytheon: - * - * ADE (AWIPS Development Environment) software - * CAVE (Common AWIPS Visualization Environment) software - * EDEX (Environmental Data Exchange) software - * uFrame™ (Universal Framework) software - * - * Copyright (c) 2010 Raytheon Co. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/org/documents/epl-v10.php - * - * - * Contractor Name: Raytheon Company - * Contractor Address: - * 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 8, 2011 ekladstrup Initial creation - * - */ -package com.raytheon.uf.edex.ogc.common.colormap; - -import javax.xml.bind.annotation.XmlAccessOrder; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorOrder; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; - -/** - * TODO Add Description - * - * @author ekladstrup - * @version 1.0 - */ -@XmlAccessorType(XmlAccessType.NONE) -@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) -public class StyleRule { - @XmlElement - private String layerRegex; - - @XmlElement - private LevelRange levelRange; - - @XmlElement - private MapRange mapRange; - - @XmlElement - private MapRange dataRange; - - @XmlElement - private ColorbarLabeling colorbarLabeling; - - @XmlElement - private String colorMapName; - - @XmlElement - private String displayUnits; - - public StyleRule() { - - } - - public String getLayerRegex() { - return layerRegex; - } - - public void setLayerRegex(String layerRegex) { - this.layerRegex = layerRegex; - } - - public void setLevelRange(LevelRange levelRange) { - this.levelRange = levelRange; - } - - public LevelRange getLevelRange() { - return levelRange; - } - - public void setMapRange(MapRange mapRange) { - this.mapRange = mapRange; - } - - public MapRange getMapRange() { - return mapRange; - } - - public void setDataRange(MapRange dataRange) { - this.dataRange = dataRange; - } - - public MapRange getDataRange() { - return dataRange; - } - - public void setColorbarLabeling(ColorbarLabeling colorbarLabeling) { - this.colorbarLabeling = colorbarLabeling; - } - - public ColorbarLabeling getColorbarLabeling() { - return colorbarLabeling; - } - - public void setColorMapName(String colorMapName) { - this.colorMapName = colorMapName; - } - - public String getColorMapName() { - return colorMapName; - } - - public void setDisplayUnits(String displayUnits) { - this.displayUnits = displayUnits; - } - - public String getDisplayUnits() { - return displayUnits; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/StyleRuleLibrary.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/StyleRuleLibrary.java deleted file mode 100644 index 8995e44779..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/colormap/StyleRuleLibrary.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * The following software products were developed by Raytheon: - * - * ADE (AWIPS Development Environment) software - * CAVE (Common AWIPS Visualization Environment) software - * EDEX (Environmental Data Exchange) software - * uFrame™ (Universal Framework) software - * - * Copyright (c) 2010 Raytheon Co. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/org/documents/epl-v10.php - * - * - * Contractor Name: Raytheon Company - * Contractor Address: - * 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 8, 2011 ekladstrup Initial creation - * - */ -package com.raytheon.uf.edex.ogc.common.colormap; - -import java.io.InputStream; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.measure.unit.Unit; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlRootElement; - -import com.raytheon.uf.common.dataplugin.PluginDataObject; -import com.raytheon.uf.edex.ogc.common.spatial.AltUtil; -import com.raytheon.uf.edex.ogc.common.spatial.VerticalCoordinate; -import com.raytheon.uf.edex.ogc.common.spatial.VerticalCoordinate.Reference; -import com.raytheon.uf.edex.ogc.common.spatial.VerticalEnabled; -import com.raytheon.uf.edex.ogc.common.spatial.VerticalSpatialFactory; - -/** - * TODO Add Description - * - * @author ekladstrup - * @version 1.0 - */ -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) -public class StyleRuleLibrary { - - @XmlElements({ @XmlElement(name = "styleRule", type = StyleRule.class) }) - private List rules; - - private Map> _ruleMap; - - public StyleRuleLibrary() { - - } - - public static StyleRuleLibrary load(InputStream inputStream) - throws JAXBException { - JAXBContext context = JAXBContext.newInstance(StyleRuleLibrary.class); - Unmarshaller unmarshaller = context.createUnmarshaller(); - Object lib = unmarshaller.unmarshal(inputStream); - if (lib instanceof StyleRuleLibrary) { - return (StyleRuleLibrary) lib; - } else { - return null; - } - - } - - public void setRules(List rules) { - this.rules = rules; - } - - public List getRules() { - return rules; - } - - protected Map> getRuleMap() { - if (_ruleMap == null && rules != null) { - _ruleMap = new HashMap>(); - for (StyleRule rule : rules) { - String cmap = rule.getColorMapName(); - List list = _ruleMap.get(cmap); - if (list == null) { - list = new ArrayList(); - _ruleMap.put(cmap, list); - } - list.add(rule); - } - } - return _ruleMap; - } - - /** - * @param rule - * @param record - * @return false if there was a range and it was out of bounds, true - * otherwise - * @throws ParseException - */ - protected boolean initRule(StyleRule rule, PluginDataObject record) - throws ParseException { - LevelRange range = rule.getLevelRange(); - if (range != null) { - // only accept if range is ok - return initRange(rule, record); - } - // if there is no range, we accept the rule - return true; - } - - /** - * @param rule - * @param record - * @return true if range is in bounds - * @throws ParseException - */ - @SuppressWarnings("unchecked") - protected boolean initRange(StyleRule rule, PluginDataObject record) - throws ParseException { - LevelRange range = rule.getLevelRange(); - VerticalEnabled enabled; - if (record instanceof VerticalEnabled) { - enabled = (VerticalEnabled) record; - } else if ((enabled = (VerticalEnabled) VerticalSpatialFactory - .getEnabled(record.getClass())) != null) { - } else { - return false; - } - VerticalCoordinate vert = enabled.getVerticalCoordinate(record); - - if (vert != null) { - Unit styleLevelUnit = Unit.valueOf(range.getUnit()); - double levelValue = AltUtil.convert(styleLevelUnit, - Reference.UNKNOWN, vert).getValue(); - if (levelValue >= range.getLower() - && levelValue <= range.getUpper()) { - setupLevelRange(rule, levelValue); - // range is in bounds - return true; - } - } - // range is out of bounds - return false; - } - - public StyleRule getMatchForLayer(PluginDataObject record) - throws ParseException { - if (record == null) { - return null; - } - String datauri = record.getDataURI(); - for (StyleRule rule : rules) { - String pattern = rule.getLayerRegex(); - if (datauri.matches(pattern)) { - // do not return rule if there is an invalid range - if (initRule(rule, record)) { - return rule; - } - } - } - return null; - } - - public StyleRule getMatchForLayer(String layerName) throws ParseException { - if (layerName == null) { - return null; - } - for (StyleRule rule : rules) { - String pattern = rule.getLayerRegex(); - if (layerName.matches(pattern)) { - return rule; - } - } - return null; - } - - public StyleRule getLayerStyleWithNewCmap(PluginDataObject record, - String newColormap) throws ParseException { - StyleRule rule = getMatchForLayer(record); - if (rule != null && newColormap != null) { - rule.setColorMapName(newColormap); - return rule; - } - return null; - } - - private void setupLevelRange(StyleRule rule, Double lvlVal) { - MapRange range = rule.getMapRange(); - LevelRange lRange = rule.getLevelRange(); - if (range != null && lRange != null) { - if (range.getLowerMaximum() != null - && range.getLowerMinimum() != null) { - // calculate upper and lower - double maxRange = Math.abs(range.getUpperMaximum() - - range.getLowerMaximum()); - double minRange = Math.abs(range.getUpperMinimum() - - range.getLowerMinimum()); - double levelRange = Math.abs(lRange.getUpper() - - lRange.getLower()); - - double lvlRatioOffset = (lvlVal - lRange.getLower()) - / levelRange; - - Double newMax = (maxRange * lvlRatioOffset) - + range.getLowerMaximum(); - Double newMin = (minRange * lvlRatioOffset) - + range.getLowerMinimum(); - - range.setUpperMaximum(newMax.floatValue()); - range.setUpperMinimum(newMin.floatValue()); - } - } - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/DefaultLayerCollector.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/DefaultLayerCollector.java index 3725fde40a..c3d9e9997f 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/DefaultLayerCollector.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/DefaultLayerCollector.java @@ -40,6 +40,26 @@ import com.raytheon.uf.edex.database.dao.DaoConfig; import com.raytheon.uf.edex.database.query.DatabaseQuery; import com.raytheon.uf.edex.ogc.common.OgcException; +/** + * Collects layer metadata from data records. Designed for use with records that + * contain all data for a layer at a specific time and level. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + * @param + * @param + * @param + */ public abstract class DefaultLayerCollector, R extends PluginDataObject> extends LayerCollector { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/DefaultPointDataDimension.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/DefaultPointDataDimension.java index 16bece1b67..782d235ad6 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/DefaultPointDataDimension.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/DefaultPointDataDimension.java @@ -13,20 +13,21 @@ import java.util.HashSet; import java.util.Set; /** - * TODO Add Description + * Default dimension object for point data that has no extra dimension + * information. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 24, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class DefaultPointDataDimension extends SimpleDimension { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/ILayerCache.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/ILayerCache.java index 9a66441291..4789157b6d 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/ILayerCache.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/ILayerCache.java @@ -23,15 +23,39 @@ import java.util.List; import com.raytheon.uf.edex.ogc.common.OgcException; + /** - * + * Interface for retrieving layer information that may be in storage or cached + * in memory. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Sept 11, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement - * @version 1.0 + * @version 1.0 + * @param + * @param */ public interface ILayerCache> { + /** + * @return all layers + * @throws OgcException + */ public List getLayers() throws OgcException; + /** + * @param name + * @return layer with matching name or null if none found + * @throws OgcException + */ public L getLayer(String name) throws OgcException; } diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/LayerCollector.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/LayerCollector.java index 24198d8340..c8ed17019f 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/LayerCollector.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/LayerCollector.java @@ -32,6 +32,26 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.edex.ogc.common.OgcException; import com.raytheon.uf.edex.ogc.common.OgcException.Code; +/** + * Abstract base for layer collectors. Provides common utility methods for child + * classes. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + * @param + * @param + * @param + */ public abstract class LayerCollector, R extends PluginDataObject> implements ILayerCache { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/LayerTransformer.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/LayerTransformer.java index 2cca1633a0..acd6d7994a 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/LayerTransformer.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/LayerTransformer.java @@ -54,15 +54,24 @@ import com.raytheon.uf.edex.ogc.common.StyleLookup; import com.vividsolutions.jts.geom.Polygon; /** - * - * + * Converts layer objects from storage to intermediate OGC metadata layer + * objects. + * + *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Jun 13, 2011            bclement     Initial creation
- *
- **/
+ *  Jun 13, 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + * @param + * @param + */ public class LayerTransformer> { protected static IUFStatusHandler log = UFStatus diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/PointDataLayer.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/PointDataLayer.java index b1b938913a..231697d249 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/PointDataLayer.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/PointDataLayer.java @@ -36,17 +36,22 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.edex.ogc.common.db.LayerTransformer.TimeFormat; /** -* SOFTWARE HISTORY -* -* Date Ticket# Engineer Description -* ------------ ---------- ----------- -------------------------- -* Mar 29, 2011 bclement Initial creation -* 10/22/2013 2742 dhladky @Entity made for Db dependency in AWIPS code, changed to @MappedSuperclass -* -* -* @author bclement -* @version 1.0 -*/ + * Layer metadata storage for point data types + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 29, 2011            bclement     Initial creation
+ * 10/22/2013   2742       dhladky      @Entity made for Db dependency in AWIPS code, changed to @MappedSuperclass
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ @MappedSuperclass @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @XmlAccessorType(XmlAccessType.NONE) diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SQLParamRestriction.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SQLParamRestriction.java index e201cb7817..163a93bf70 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SQLParamRestriction.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SQLParamRestriction.java @@ -19,20 +19,20 @@ import org.hibernate.criterion.Criterion; import org.hibernate.engine.TypedValue; /** - * TODO Add Description + * Hibernate criterion that allows for direct SQL restrictions * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 20, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class SQLParamRestriction implements Criterion { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SimpleDimension.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SimpleDimension.java index 8e0d29e325..63517383cd 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SimpleDimension.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SimpleDimension.java @@ -28,13 +28,11 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; /** - * - * Simple Dimension + * Layer dimension metadata storage object * *
  * SOFTWARE HISTORY
@@ -51,7 +49,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
 @XmlAccessorType(XmlAccessType.NONE)
 @DynamicSerialize
 public abstract class SimpleDimension implements Comparable,
-        Serializable, ISerializableObject {
+        Serializable {
 
     private static final long serialVersionUID = 4654482181227204619L;
 
diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SimpleLayer.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SimpleLayer.java
index 1cfae420c8..76e22c78de 100644
--- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SimpleLayer.java
+++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SimpleLayer.java
@@ -38,15 +38,24 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
 import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
 import com.vividsolutions.jts.geom.Polygon;
 
- /**
+/**
+ * Layer metadata storage object
+ * 
+ * 
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Mar 29, 2011            bclement     Initial creation
  * 04/22/2013   1746      dhladky      Removed DB dependency from WFS code
- *
- **/
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + * @param + */ @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SingleLayerCollector.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SingleLayerCollector.java index cbd18330a8..bbef928516 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SingleLayerCollector.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/db/SingleLayerCollector.java @@ -47,10 +47,26 @@ import com.raytheon.uf.common.geospatial.MapUtil; import com.raytheon.uf.edex.ogc.common.OgcException; import com.vividsolutions.jts.geom.Envelope; + /** + * Collects layer metadata from data records. Designed for use with plugins that + * have a single layer which all records contribute to (like pointdata) + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 + * @param + * @param + * @param */ public abstract class SingleLayerCollector, R extends PluginDataObject> extends LayerCollector { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/FeatureFactory.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/FeatureFactory.java index c62ca43dcc..5c82486054 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/FeatureFactory.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/FeatureFactory.java @@ -25,13 +25,31 @@ import org.opengis.feature.simple.SimpleFeature; import com.raytheon.uf.common.dataplugin.PluginDataObject; + /** + * Interface for creating geotools feature objects from data records + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 16, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 */ public interface FeatureFactory { + /** + * Create a simple feature from each plugin data object + * + * @param pdos + * @return + */ public List convert(PluginDataObject[] pdos); } diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/GmlUtils.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/GmlUtils.java index acb45545bf..8e49e4ed45 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/GmlUtils.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/GmlUtils.java @@ -19,22 +19,21 @@ import com.raytheon.uf.edex.ogc.common.Version; import com.raytheon.uf.edex.ogc.common.http.MimeType; /** - * TODO Add Description + * Utility methods and constants for GML version parsing and comparison * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 30, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ - public class GmlUtils { public static final MimeType GML31_TYPE = new MimeType( diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/JsonFeatureFormatter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/JsonFeatureFormatter.java index 49b4381191..9b3c22e3e7 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/JsonFeatureFormatter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/JsonFeatureFormatter.java @@ -36,7 +36,19 @@ import com.raytheon.uf.edex.ogc.common.OgcResponse; import com.raytheon.uf.edex.ogc.common.OgcResponse.TYPE; import com.raytheon.uf.edex.ogc.common.http.MimeType; + /** + * Converts simple features to GeoJSON + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 9, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ObsLocation.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ObsLocation.java index f3fa18f7ca..f96c866667 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ObsLocation.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ObsLocation.java @@ -27,11 +27,11 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; -import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; - import net.opengis.gml.v_3_1_1.DirectPositionType; import net.opengis.gml.v_3_1_1.PointType; +import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; + /** * ObsLocation OGC representation. diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ShpFeatureFormatter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ShpFeatureFormatter.java index f7721b2d03..29eddb7e20 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ShpFeatureFormatter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ShpFeatureFormatter.java @@ -54,9 +54,20 @@ import com.raytheon.uf.edex.ogc.common.OgcResponse.TYPE; import com.raytheon.uf.edex.ogc.common.http.MimeType; /** - * + * Convert simple features to shape files + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Feb 28, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement - * @version 1.0 + * @version 1.0 */ public class ShpFeatureFormatter implements SimpleFeatureFormatter { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/SimpleFeatureFormatter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/SimpleFeatureFormatter.java index 1ae85869e7..44751fa6eb 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/SimpleFeatureFormatter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/SimpleFeatureFormatter.java @@ -28,19 +28,51 @@ import com.raytheon.uf.edex.ogc.common.OgcResponse; import com.raytheon.uf.edex.ogc.common.http.MimeType; /** + * Interface for converting simple features to different output formats + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 8, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 */ public interface SimpleFeatureFormatter { + /** + * Format features and return in response wrapper + * + * @param features + * @return + * @throws Exception + */ public OgcResponse format(List> features) throws Exception; + /** + * Format features and output to stream + * + * @param features + * @param out + * @throws Exception + */ public void format(List> features, OutputStream out) throws Exception; + /** + * @return mime type supported by this formatter + */ public MimeType getMimeType(); + /** + * @param format + * @return true if this formatter is suitable for format + */ public boolean matchesFormat(MimeType format); } diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/AbstractPdoFilter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/AbstractPdoFilter.java index d8c905798c..46d4b3798f 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/AbstractPdoFilter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/AbstractPdoFilter.java @@ -12,20 +12,20 @@ package com.raytheon.uf.edex.ogc.common.filter; import com.raytheon.uf.common.dataplugin.PluginDataObject; /** - * TODO Add Description + * Abstract base for in memory filtering of data records * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 14, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public abstract class AbstractPdoFilter { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/ComparisonFilter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/ComparisonFilter.java index ed69ba0233..6df4742aee 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/ComparisonFilter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/ComparisonFilter.java @@ -18,20 +18,20 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.edex.ogc.common.util.ConvertService; /** - * TODO Add Description + * In memory data record filtering by standard comparison operators * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 14, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class ComparisonFilter extends AbstractPdoFilter { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/LogicFilter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/LogicFilter.java index d9a7b0b06f..92b23fae42 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/LogicFilter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/LogicFilter.java @@ -14,20 +14,21 @@ import java.util.Arrays; import com.raytheon.uf.common.dataplugin.PluginDataObject; /** - * TODO Add Description + * In memory data record filtering that combines other filters using logical + * operators * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 14, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class LogicFilter extends AbstractPdoFilter { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/SpatialFilter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/SpatialFilter.java index e558648466..5b67db2cf1 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/SpatialFilter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/SpatialFilter.java @@ -27,20 +27,20 @@ import com.vividsolutions.jts.geom.LinearRing; import com.vividsolutions.jts.geom.Polygon; /** - * Spatial PDO Filter + * In memory data record filtering using spatial fields * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 14, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class SpatialFilter extends AbstractPdoFilter { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/TemporalFilter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/TemporalFilter.java index 4096aaab82..1a8aa91d4f 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/TemporalFilter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/TemporalFilter.java @@ -16,20 +16,20 @@ import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.TimeRange; /** - * Temporal PDO Filter + * In memory data record filtering using time fields * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 14, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class TemporalFilter extends AbstractPdoFilter { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/VerticalFilter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/VerticalFilter.java index ef85d8dafd..844bf9350f 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/VerticalFilter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/filter/VerticalFilter.java @@ -23,20 +23,20 @@ import com.raytheon.uf.edex.ogc.common.spatial.VerticalEnabled; import com.raytheon.uf.edex.ogc.common.spatial.VerticalSpatialFactory; /** - * TODO Add Description + * In memory data record filtering using vertical fields * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Apr 23, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class VerticalFilter extends AbstractPdoFilter { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/EnvelopeConverter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/EnvelopeConverter.java index 3096e617d7..a9d3ddcf1b 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/EnvelopeConverter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/EnvelopeConverter.java @@ -39,6 +39,16 @@ import com.vividsolutions.jts.geom.Envelope; /** * Convert GML 3.1.1 envelopes to JTS envelopes * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 26, 2011           bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/GeometryConverter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/GeometryConverter.java index 46db08f930..0e76005e01 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/GeometryConverter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/GeometryConverter.java @@ -31,6 +31,17 @@ import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.io.ParseException; /** + * Converts GML 3.1.1 objects to JTS + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 25, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/GmlWktWriter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/GmlWktWriter.java index da3fb34f1f..61b3664a38 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/GmlWktWriter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_1_1/GmlWktWriter.java @@ -50,6 +50,17 @@ import net.opengis.gml.v_3_1_1.PolygonType; import net.opengis.gml.v_3_1_1.RingType; /** + * Converts GML 3.1.1 objects to Well Known Text + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 25, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_2_1/EnvelopeConverter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_2_1/EnvelopeConverter.java index 2a43479bf4..744437ed19 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_2_1/EnvelopeConverter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_2_1/EnvelopeConverter.java @@ -39,6 +39,16 @@ import com.vividsolutions.jts.geom.Envelope; /** * Converter for GML 3.2.1 envelopes to JTS envelopes * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 26, 2011            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_2_1/GeometryConverter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_2_1/GeometryConverter.java index 52e924ec52..0fb297d454 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_2_1/GeometryConverter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/gml3_2_1/GeometryConverter.java @@ -74,6 +74,16 @@ import com.vividsolutions.jts.io.ParseException; /** * Converts between GML 3.2.1 and JTS geometries * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 25, 2011             bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/EndpointInfo.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/EndpointInfo.java index 0241d94788..98b4c313cd 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/EndpointInfo.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/EndpointInfo.java @@ -10,20 +10,20 @@ package com.raytheon.uf.edex.ogc.common.http; /** - * TODO Add Description + * Endpoint information client used when connecting to service * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 26, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class EndpointInfo { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/IOgcHttpPooler.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/IOgcHttpPooler.java index 6680f68b34..9d6428c589 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/IOgcHttpPooler.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/IOgcHttpPooler.java @@ -10,20 +10,20 @@ package com.raytheon.uf.edex.ogc.common.http; /** - * TODO Add Description + * Interface for pooling OGC http handlers. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 31, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public interface IOgcHttpPooler { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/MimeType.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/MimeType.java index 6e8a03b6a2..33f50f5c9b 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/MimeType.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/MimeType.java @@ -18,19 +18,20 @@ import java.util.regex.Pattern; import org.apache.commons.lang.StringUtils; /** + * Data object representing a MIME type used in service requests * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 29, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class MimeType { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpHandler.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpHandler.java index 18144e1bca..5b0529156e 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpHandler.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpHandler.java @@ -43,9 +43,22 @@ import com.raytheon.uf.edex.ogc.common.OgcResponse.TYPE; import com.raytheon.uf.edex.ogc.common.output.IOgcHttpResponse; import com.raytheon.uf.edex.ogc.common.output.OgcResponseOutput; + /** - * @author bclement + * Abstract base for HTTP handlers. Provides common utility methods. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public abstract class OgcHttpHandler { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpPool.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpPool.java index 6121e5934e..43f1a36fec 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpPool.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpPool.java @@ -28,9 +28,22 @@ import org.apache.commons.pool.impl.GenericKeyedObjectPool; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; + /** - * @author bclement + * Pooling for OGC http handlers * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class OgcHttpPool extends GenericKeyedObjectPool implements IOgcHttpPooler { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpRequest.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpRequest.java index 0c940eb112..77cf421b02 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpRequest.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/OgcHttpRequest.java @@ -25,6 +25,22 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +/** + * OGC HTTP request wrapper + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ public class OgcHttpRequest { protected HttpServletRequest request; diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/SingleHttpPool.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/SingleHttpPool.java index 3d8be73c93..4d3773439b 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/SingleHttpPool.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/http/SingleHttpPool.java @@ -10,20 +10,21 @@ package com.raytheon.uf.edex.ogc.common.http; /** - * TODO Add Description + * HTTP pooling for handlers that are thread safe and don't require a separate + * instance per request. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 31, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class SingleHttpPool implements IOgcHttpPooler { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/jaxb/OgcJaxbManager.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/jaxb/OgcJaxbManager.java index 94ecc07478..92830231f7 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/jaxb/OgcJaxbManager.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/jaxb/OgcJaxbManager.java @@ -62,6 +62,16 @@ import com.sun.xml.bind.marshaller.NamespacePrefixMapper; /** * Cache and utility class for OGC JAXB * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/jaxb/TransientAnnotationReader.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/jaxb/TransientAnnotationReader.java index 041129c0f8..a9ddfdfd7c 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/jaxb/TransientAnnotationReader.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/jaxb/TransientAnnotationReader.java @@ -27,20 +27,21 @@ import com.sun.xml.bind.v2.model.annotation.RuntimeAnnotationReader; import com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader; /** - * TODO Add Description + * JAXB utility to allow for Transient annotation to be added to fields and + * methods of classes * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 11, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ @SuppressWarnings("rawtypes") diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/level/LevelDimUtil.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/level/LevelDimUtil.java index 40d61b7e3b..092e303bd1 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/level/LevelDimUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/level/LevelDimUtil.java @@ -18,20 +18,20 @@ import com.raytheon.uf.edex.ogc.common.OgcException; import com.raytheon.uf.edex.ogc.common.OgcException.Code; /** - * TODO Add Description + * Utility methods for parsing and formatting level names for OGC metadata * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jun 18, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class LevelDimUtil { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/IOgcHttpResponse.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/IOgcHttpResponse.java index 42071d844d..b7baf2090d 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/IOgcHttpResponse.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/IOgcHttpResponse.java @@ -13,20 +13,20 @@ import java.io.IOException; import java.io.OutputStream; /** - * TODO Add Description + * Interface for OGC HTTP output * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jan 7, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public interface IOgcHttpResponse { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/OgcResponseOutput.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/OgcResponseOutput.java index 13a1ab6aff..6966d20bc6 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/OgcResponseOutput.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/OgcResponseOutput.java @@ -37,9 +37,20 @@ import com.raytheon.uf.edex.ogc.common.OgcResponse; import com.raytheon.uf.edex.ogc.common.OgcResponse.ErrorType; /** - * + * Utility methods for sending OGC HTTP response output + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Feb 28, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement - * @version 1.0 + * @version 1.0 */ public class OgcResponseOutput { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/ServletOgcResponse.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/ServletOgcResponse.java index 9b8f94f879..c5cd6adae8 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/ServletOgcResponse.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/ServletOgcResponse.java @@ -15,19 +15,20 @@ import java.io.OutputStream; import javax.servlet.http.HttpServletResponse; /** + * OGC HTTP response adapter for standard servlet response object * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jan 7, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class ServletOgcResponse implements IOgcHttpResponse { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/StoredHttpResponse.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/StoredHttpResponse.java index 1398eae705..c2ceb1c725 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/StoredHttpResponse.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/output/StoredHttpResponse.java @@ -16,20 +16,20 @@ import java.io.OutputStream; import javax.servlet.http.HttpServletResponse; /** - * TODO Add Description + * OGC HTTP response adapter for capturing OGC HTTP responses as byte arrays * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jan 7, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class StoredHttpResponse implements IOgcHttpResponse { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/AbstractOwsService.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/AbstractOwsService.java index a1361dee5d..10c41a3636 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/AbstractOwsService.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/AbstractOwsService.java @@ -21,20 +21,20 @@ import net.opengis.ows.v_1_1_0.ExceptionType; import com.raytheon.uf.edex.ogc.common.http.EndpointInfo; /** - * TODO Add Description + * Abstract base class for OGC web services. Provides common utility methods. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jan 31, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public abstract class AbstractOwsService { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/CustomWsdlInterceptor.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/CustomWsdlInterceptor.java index 43c46e6da7..a9332b35df 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/CustomWsdlInterceptor.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/soap/CustomWsdlInterceptor.java @@ -31,7 +31,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; /** - * WSDL reader + * Provides custom WSDL for CXF endpoints * *
  * 
diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/AltUtil.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/AltUtil.java
index f27779a1f0..9b7859fce2 100644
--- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/AltUtil.java
+++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/AltUtil.java
@@ -16,20 +16,20 @@ import javax.measure.unit.Unit;
 import com.raytheon.uf.edex.ogc.common.spatial.VerticalCoordinate.Reference;
 
 /**
- * TODO Add Description
+ * Altitude utility methods and constants
  * 
  * 
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Apr 4, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class AltUtil { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/Composite3DBoundingBox.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/Composite3DBoundingBox.java index 4ba0018560..e41a006e24 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/Composite3DBoundingBox.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/Composite3DBoundingBox.java @@ -13,20 +13,21 @@ import org.geotools.geometry.jts.ReferencedEnvelope; /** - * TODO Add Description + * 3D bounding box composed of 2D referenced envelope for horizontal bounds and + * vertical coordinate for vertical bounds * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Apr 16, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class Composite3DBoundingBox { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/CoordinateUtil.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/CoordinateUtil.java index 10a520c481..dba9cdfd25 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/CoordinateUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/CoordinateUtil.java @@ -18,20 +18,20 @@ import java.util.regex.Pattern; import org.apache.commons.lang.StringUtils; /** - * TODO Add Description + * Utility methods for parsing coordinates from GML strings * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Apr 16, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class CoordinateUtil { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/CrsLookup.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/CrsLookup.java index c82c16c5a9..e9acbdeca4 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/CrsLookup.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/CrsLookup.java @@ -46,10 +46,21 @@ import com.raytheon.uf.edex.ogc.common.OgcException; import com.raytheon.uf.edex.ogc.common.spatial.VerticalCoordinate.Reference; /** - * TODO Add Description - * + * Coordinate Reference System utility methods and constants. Used to parse CRS + * codes and URNs to geotools objects and format geotools objects for output. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Feb 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement - * @version 1.0 + * @version 1.0 */ public class CrsLookup { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/NativeCrsAuthority.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/NativeCrsAuthority.java index 9a9ba98fba..f93a1e4b72 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/NativeCrsAuthority.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/NativeCrsAuthority.java @@ -14,20 +14,21 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem; import com.raytheon.uf.edex.ogc.common.OgcException; /** - * TODO Add Description + * Interface for retrieving geotools coordinate reference system objects using + * native CRS URNs * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 6, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public interface NativeCrsAuthority { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/NativeCrsFactory.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/NativeCrsFactory.java index 917c808844..311b76c458 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/NativeCrsFactory.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/NativeCrsFactory.java @@ -24,20 +24,22 @@ import com.raytheon.uf.edex.core.EDEXUtil; import com.raytheon.uf.edex.ogc.common.OgcException; /** - * TODO Add Description + * Factory for retrieving geotools coordinate reference system objects from + * native CRS URNs. Uses NativeCrsAuthority beans registered in spring to create + * new CRS objects. Uses an internal LRU cache. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 6, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class NativeCrsFactory { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/RecordUtil.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/RecordUtil.java index b60636af62..7e597f9e7c 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/RecordUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/RecordUtil.java @@ -43,7 +43,8 @@ import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Polygon; /** - * Removing code only used by ogc services from {@link PluginDao} to here + * Utility methods for reprojecting data records. Removing code only used by ogc + * services from {@link PluginDao} to here * *
  * 
diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/VerticalCoordinate.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/VerticalCoordinate.java
index 7e1b937b46..09e33485d9 100644
--- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/VerticalCoordinate.java
+++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/VerticalCoordinate.java
@@ -20,20 +20,20 @@ import javax.measure.unit.Unit;
 import javax.measure.unit.UnitFormat;
 
 /**
- * TODO Add Description
+ * Vertical level information which can be a point or range.
  * 
  * 
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Apr 23, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class VerticalCoordinate implements Comparable { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/VerticalSpatialFactory.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/VerticalSpatialFactory.java index f37a002326..a186087b9e 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/VerticalSpatialFactory.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/VerticalSpatialFactory.java @@ -20,20 +20,21 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.edex.core.EDEXUtil; /** - * TODO Add Description + * Factory for retrieving vertical coordinate objects from vertically enabled + * classes. Uses VerticalEnabled beans registered in spring. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 29, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class VerticalSpatialFactory { diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/stats/OperationType.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/stats/OperationType.java index c0fac344e3..0ca02d67d4 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/stats/OperationType.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/stats/OperationType.java @@ -9,6 +9,22 @@ */ package com.raytheon.uf.edex.ogc.common.stats; +/** + * Type of operation for which statistics are being measured + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2013            behemmi     Initial creation
+ * 
+ * 
+ * + * @author behemmi + * @version 1.0 + */ public enum OperationType { STORE, QUERY, DELETE, // special case for encompassing all values diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/stats/ServiceType.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/stats/ServiceType.java index f8c5a94231..1afb8fe38a 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/stats/ServiceType.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/stats/ServiceType.java @@ -13,8 +13,18 @@ package com.raytheon.uf.edex.ogc.common.stats; * Enumeration representing the types of operations that statistics are recorded * for within the IGCServiceRecorder * - * @author behemmi + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2013            behemmi     Initial creation
+ * 
+ * 
+ * + * @author behemmi + * @version 1.0 */ public enum ServiceType { WFS, WCS, OGC, REGISTRY, diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/time/ForecastTimeUtil.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/time/ForecastTimeUtil.java index 6d0b1946bf..e3729ad9bb 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/time/ForecastTimeUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/time/ForecastTimeUtil.java @@ -42,6 +42,18 @@ import com.raytheon.uf.edex.ogc.common.db.SimpleDimension; import com.raytheon.uf.edex.ogc.common.db.SimpleLayer; /** + * Utility methods and constants for forecast times. Used to find valid reftime, + * forecast time and valid time combinations from OGC layer metadata. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Nov 3, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/util/Converter.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/util/Converter.java index 9dcf9926a1..5838ffc6a6 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/util/Converter.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/util/Converter.java @@ -12,20 +12,20 @@ package com.raytheon.uf.edex.ogc.common.util; import java.lang.reflect.Field; /** - * TODO Add Description + * Generic object converter interface for OGC * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jul 16, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public interface Converter { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.wfs/META-INF/MANIFEST.MF index 725e9d1e01..644b192f55 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.wfs/META-INF/MANIFEST.MF @@ -32,7 +32,6 @@ Export-Package: com.raytheon.uf.edex.wfs, com.raytheon.uf.edex.wfs.filter, com.raytheon.uf.edex.wfs.filter.v1_1_0, com.raytheon.uf.edex.wfs.filter.v2_0_0, - com.raytheon.uf.edex.wfs.gml, com.raytheon.uf.edex.wfs.provider, com.raytheon.uf.edex.wfs.querystore, com.raytheon.uf.edex.wfs.reg, diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/IWfsProvider.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/IWfsProvider.java index ebd7326e88..8a4d1a2503 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/IWfsProvider.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/IWfsProvider.java @@ -34,6 +34,22 @@ import java.util.Map; import com.raytheon.uf.edex.ogc.common.http.EndpointInfo; import com.raytheon.uf.edex.ogc.common.output.IOgcHttpResponse; +/** + * Interface for WFS version specific implementations + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * November 2012            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ public interface IWfsProvider { public enum WfsOpType { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsException.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsException.java index b24b3940bb..0d9f283a1c 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsException.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsException.java @@ -21,6 +21,22 @@ package com.raytheon.uf.edex.wfs; import com.raytheon.uf.edex.ogc.common.OgcException; +/** + * Exception which includes WFS error codes + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 22, 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ public class WfsException extends Exception { public enum Code { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsFeatureType.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsFeatureType.java index 28f9d70fde..69f2b25d99 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsFeatureType.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsFeatureType.java @@ -26,8 +26,21 @@ import com.raytheon.uf.edex.ogc.common.OgcGeoBoundingBox; import com.raytheon.uf.edex.wfs.request.QualifiedName; /** - * @author bclement + * Feature type metadata object used for capabilities document. Independent from + * JAXB object to support multiple WFS versions. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class WfsFeatureType { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsHttpFactory.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsHttpFactory.java index dcb20dcf36..59b2ccb331 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsHttpFactory.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsHttpFactory.java @@ -25,7 +25,17 @@ import com.raytheon.uf.edex.wfs.reg.WfsRegistryImpl; import com.raytheon.uf.edex.wfs.v1_1_0.Wfs1_1_0Provider; /** - * TODO Add Description + * Http handler factory for WFS + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * May 19, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsHttpHandler.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsHttpHandler.java index a99514e2e3..6e7c68ba05 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsHttpHandler.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/WfsHttpHandler.java @@ -51,6 +51,23 @@ import com.raytheon.uf.edex.ogc.common.output.IOgcHttpResponse; import com.raytheon.uf.edex.ogc.common.output.OgcResponseOutput; import com.raytheon.uf.edex.ogc.common.output.ServletOgcResponse; +/** + * WFS http handler. Delegates WFS HTTP requests to providers using version + * negotiation. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * May 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ public class WfsHttpHandler extends OgcHttpHandler { protected final TreeMap providers; diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/FeatureAdapter.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/FeatureAdapter.java index 5116aefb9b..f0a32c83ba 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/FeatureAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/FeatureAdapter.java @@ -32,6 +32,17 @@ import com.raytheon.uf.common.json.JsonException; import com.raytheon.uf.common.json.JsonService; /** + * Converts jaxb objects to geotools feature objects + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 19, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/FeatureTypeConfig.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/FeatureTypeConfig.java index 1abc3f037e..2d9b246ec5 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/FeatureTypeConfig.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/FeatureTypeConfig.java @@ -22,6 +22,17 @@ package com.raytheon.uf.edex.wfs.feature; import com.raytheon.uf.edex.ogc.common.OgcNamespace; /** + * Configuration for adapting java objects to geotools features + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 19, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/IFeatureTypeCache.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/IFeatureTypeCache.java index e133e2dafe..7de8174116 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/IFeatureTypeCache.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/IFeatureTypeCache.java @@ -35,6 +35,17 @@ import org.opengis.referencing.NoSuchAuthorityCodeException; import com.raytheon.uf.edex.ogc.common.OgcException; /** + * Interface for retrieving geotools feature types + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 19, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/SimpleFeatureTypeCache.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/SimpleFeatureTypeCache.java index f817b710dc..fa4ce1e77e 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/SimpleFeatureTypeCache.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/feature/SimpleFeatureTypeCache.java @@ -37,6 +37,17 @@ import com.raytheon.uf.edex.ogc.common.OgcException; import com.raytheon.uf.edex.ogc.common.spatial.CrsLookup; /** + * Creates goetools simple feature types and caches results internally. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 19, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbsExpressionOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbsExpressionOp.java deleted file mode 100644 index 8f562876ae..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbsExpressionOp.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.filter; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.JAXBElement; - -import net.opengis.filter.v_1_1_0.BinaryOperatorType; -import net.opengis.filter.v_1_1_0.FunctionType; -import net.opengis.filter.v_1_1_0.LiteralType; -import net.opengis.filter.v_1_1_0.PropertyNameType; - -/** - * - * @author bclement - * @version 1.0 - */ -public abstract class AbsExpressionOp { - - public abstract Object visit(JAXBElement element, - OgcExpressionVisitor visitor, Object obj) throws Exception; - - public static class Literal extends AbsExpressionOp { - @Override - public Object visit(JAXBElement element, - OgcExpressionVisitor visitor, Object obj) throws Exception { - LiteralType literal = (LiteralType) element.getValue(); - return visitor.literal(literal.getContent(), obj); - } - } - - public static class Add extends AbsExpressionOp { - @Override - public Object visit(JAXBElement element, - OgcExpressionVisitor visitor, Object obj) throws Exception { - BinaryOperatorType binary = (BinaryOperatorType) element.getValue(); - List> exprs = binary.getExpression(); - ExpressionProcessor left = new ExpressionProcessor(exprs.get(0)); - ExpressionProcessor right = new ExpressionProcessor(exprs.get(1)); - return visitor.add(left, right, obj); - } - } - - public static class Sub extends AbsExpressionOp { - @Override - public Object visit(JAXBElement element, - OgcExpressionVisitor visitor, Object obj) throws Exception { - BinaryOperatorType binary = (BinaryOperatorType) element.getValue(); - List> exprs = binary.getExpression(); - ExpressionProcessor left = new ExpressionProcessor(exprs.get(0)); - ExpressionProcessor right = new ExpressionProcessor(exprs.get(1)); - return visitor.sub(left, right, obj); - } - } - - public static class Mul extends AbsExpressionOp { - @Override - public Object visit(JAXBElement element, - OgcExpressionVisitor visitor, Object obj) throws Exception { - BinaryOperatorType binary = (BinaryOperatorType) element.getValue(); - List> exprs = binary.getExpression(); - ExpressionProcessor left = new ExpressionProcessor(exprs.get(0)); - ExpressionProcessor right = new ExpressionProcessor(exprs.get(1)); - return visitor.mul(left, right, obj); - } - } - - public static class Div extends AbsExpressionOp { - @Override - public Object visit(JAXBElement element, - OgcExpressionVisitor visitor, Object obj) throws Exception { - BinaryOperatorType binary = (BinaryOperatorType) element.getValue(); - List> exprs = binary.getExpression(); - ExpressionProcessor left = new ExpressionProcessor(exprs.get(0)); - ExpressionProcessor right = new ExpressionProcessor(exprs.get(1)); - return visitor.div(left, right, obj); - } - } - - public static class Property extends AbsExpressionOp { - @Override - public Object visit(JAXBElement element, - OgcExpressionVisitor visitor, Object obj) throws Exception { - PropertyNameType prop = (PropertyNameType) element.getValue(); - return visitor.property(prop, obj); - } - } - - public static class Function extends AbsExpressionOp { - @Override - public Object visit(JAXBElement element, - OgcExpressionVisitor visitor, Object obj) throws Exception { - FunctionType f = (FunctionType) element.getValue(); - String name = f.getName(); - List> exprs = f.getExpression(); - List procs = new ArrayList( - exprs.size()); - for (JAXBElement expr : exprs) { - procs.add(new ExpressionProcessor(expr)); - } - return visitor.function(procs, name, obj); - } - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbstractCompOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbstractCompOp.java deleted file mode 100644 index 208dc44b1e..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbstractCompOp.java +++ /dev/null @@ -1,190 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.filter; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.JAXBElement; - -import net.opengis.filter.v_1_1_0.BinaryComparisonOpType; -import net.opengis.filter.v_1_1_0.ComparisonOpsType; -import net.opengis.filter.v_1_1_0.PropertyIsBetweenType; -import net.opengis.filter.v_1_1_0.PropertyIsLikeType; -import net.opengis.filter.v_1_1_0.PropertyIsNullType; - -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; - -/** - * - * @author bclement - * @version 1.0 - */ -public abstract class AbstractCompOp { - - protected static final Map binaryMap; - - protected IUFStatusHandler log = UFStatus.getHandler(this.getClass()); - - static { - binaryMap = new HashMap(); - binaryMap.put("PropertyIsEqualTo", new Equal()); - binaryMap.put("PropertyIsNotEqualTo", new NotEqual()); - binaryMap.put("PropertyIsLessThan", new LessThan()); - binaryMap.put("PropertyIsGreaterThan", new GreaterThan()); - binaryMap.put("PropertyIsLessThanOrEqualTo", new LessThanEqual()); - binaryMap.put("PropertyIsGreaterThanOrEqualTo", new GreaterThanEqual()); - } - - public abstract Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception; - - public static class Like extends AbstractCompOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - return visitor.isLike((PropertyIsLikeType) op.getValue(), obj); - } - } - - public static class Null extends AbstractCompOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - return visitor.isNull((PropertyIsNullType) op.getValue(), obj); - } - } - - public static class Between extends AbstractCompOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - PropertyIsBetweenType between = (PropertyIsBetweenType) op - .getValue(); - ExpressionProcessor exp = new ExpressionProcessor( - between.getExpression()); - ExpressionProcessor lower = new ExpressionProcessor(between - .getLowerBoundary().getExpression()); - ExpressionProcessor upper = new ExpressionProcessor(between - .getUpperBoundary().getExpression()); - return visitor.between(lower, exp, upper, obj); - } - } - - public static class BinaryOp extends AbstractCompOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - String name = op.getName().getLocalPart(); - AbstractCompOp compOp = binaryMap.get(name); - if (compOp != null) { - return compOp.visit(op, visitor, obj); - } else { - throw new Exception("Unknown binary operator: " + name); - } - } - } - - public static class Equal extends AbstractCompOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinaryComparisonOpType binary = (BinaryComparisonOpType) op - .getValue(); - List> expressions = binary.getExpression(); - return visitor.equal(new ExpressionProcessor(expressions.get(0)), - new ExpressionProcessor(expressions.get(1)), - binary.isMatchCase(), obj); - } - } - - public static class NotEqual extends AbstractCompOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinaryComparisonOpType binary = (BinaryComparisonOpType) op - .getValue(); - List> expressions = binary.getExpression(); - return visitor.notEqual( - new ExpressionProcessor(expressions.get(0)), - new ExpressionProcessor(expressions.get(1)), - binary.isMatchCase(), obj); - } - } - - public static class LessThan extends AbstractCompOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinaryComparisonOpType binary = (BinaryComparisonOpType) op - .getValue(); - List> expressions = binary.getExpression(); - return visitor.lessThan( - new ExpressionProcessor(expressions.get(0)), - new ExpressionProcessor(expressions.get(1)), - binary.isMatchCase(), obj); - } - } - - public static class GreaterThan extends AbstractCompOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinaryComparisonOpType binary = (BinaryComparisonOpType) op - .getValue(); - List> expressions = binary.getExpression(); - return visitor.greaterThan( - new ExpressionProcessor(expressions.get(0)), - new ExpressionProcessor(expressions.get(1)), - binary.isMatchCase(), obj); - } - } - - public static class LessThanEqual extends AbstractCompOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinaryComparisonOpType binary = (BinaryComparisonOpType) op - .getValue(); - List> expressions = binary.getExpression(); - return visitor.lessThanEqual( - new ExpressionProcessor(expressions.get(0)), - new ExpressionProcessor(expressions.get(1)), - binary.isMatchCase(), obj); - } - } - - public static class GreaterThanEqual extends AbstractCompOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinaryComparisonOpType binary = (BinaryComparisonOpType) op - .getValue(); - List> expressions = binary.getExpression(); - return visitor.greaterThanEqual( - new ExpressionProcessor(expressions.get(0)), - new ExpressionProcessor(expressions.get(1)), - binary.isMatchCase(), obj); - } - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbstractLogicOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbstractLogicOp.java deleted file mode 100644 index 0e84dff989..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbstractLogicOp.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.filter; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.JAXBElement; - -import net.opengis.filter.v_1_1_0.BinaryLogicOpType; -import net.opengis.filter.v_1_1_0.ComparisonOpsType; -import net.opengis.filter.v_1_1_0.FilterType; -import net.opengis.filter.v_1_1_0.LogicOpsType; -import net.opengis.filter.v_1_1_0.SpatialOpsType; -import net.opengis.filter.v_1_1_0.UnaryLogicOpType; - -/** - * - * @author bclement - * @version 1.0 - */ -public abstract class AbstractLogicOp { - - public abstract Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception; - - protected Map, List>> sortByType( - List> elements) { - Map, List>> rval = new HashMap, List>>(); - for (JAXBElement e : elements) { - List> list = rval.get(e.getDeclaredType()); - if (list == null) { - list = new ArrayList>(); - rval.put(e.getDeclaredType(), list); - } - list.add(e); - } - return rval; - } - - @SuppressWarnings("unchecked") - protected List getProcessors(List> elements) - throws Exception { - List rval = new ArrayList( - elements.size()); - for (JAXBElement e : elements) { - Class type = e.getDeclaredType(); - FilterProcessor p; - // FIXME this is slow - if (ComparisonOpsType.class.isAssignableFrom(type)) { - p = FilterProcessor - .newFromComparison((JAXBElement) e); - } else if (LogicOpsType.class.isAssignableFrom(type)) { - p = FilterProcessor - .newFromLogic((JAXBElement) e); - } else if (SpatialOpsType.class.isAssignableFrom(type)) { - p = FilterProcessor - .newFromSpatial((JAXBElement) e); - } else { - throw new Exception("Unknown operator: " + type); - } - rval.add(p); - } - return rval; - } - - protected FilterType createFilter( - JAXBElement comps, - JAXBElement spats, - JAXBElement logic) { - FilterType rval = new FilterType(); - rval.setComparisonOps(comps); - rval.setLogicOps(logic); - rval.setSpatialOps(spats); - return rval; - } - - public static class And extends AbstractLogicOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinaryLogicOpType and = (BinaryLogicOpType) op.getValue(); - List> gah = and - .getComparisonOpsOrSpatialOpsOrLogicOps(); - List processors = getProcessors(gah); - return visitor.and(processors, obj); - } - } - - public static class Or extends AbstractLogicOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinaryLogicOpType or = (BinaryLogicOpType) op.getValue(); - List> gah = or - .getComparisonOpsOrSpatialOpsOrLogicOps(); - List processors = getProcessors(gah); - return visitor.or(processors, obj); - } - } - - public static class Not extends AbstractLogicOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - UnaryLogicOpType not = (UnaryLogicOpType) op.getValue(); - JAXBElement comps = not - .getComparisonOps(); - JAXBElement spats = not.getSpatialOps(); - JAXBElement logics = not.getLogicOps(); - FilterType filter = createFilter(comps, spats, logics); - return visitor.not(new FilterProcessor(filter), obj); - } - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbstractSpatialOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbstractSpatialOp.java deleted file mode 100644 index 71256f24bf..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/AbstractSpatialOp.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.filter; - -import javax.xml.bind.JAXBElement; - -import net.opengis.filter.v_1_1_0.BBOXType; -import net.opengis.filter.v_1_1_0.BinarySpatialOpType; -import net.opengis.filter.v_1_1_0.DistanceBufferType; -import net.opengis.filter.v_1_1_0.SpatialOpsType; - -/** - * - * @author bclement - * @version 1.0 - */ -public abstract class AbstractSpatialOp { - - public abstract Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception; - - public static class SpatialEquals extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinarySpatialOpType binary = (BinarySpatialOpType) op.getValue(); - return visitor.spatialEquals(binary, obj); - } - } - - public static class Disjoint extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinarySpatialOpType binary = (BinarySpatialOpType) op.getValue(); - return visitor.disjoint(binary, obj); - } - } - - public static class Touches extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinarySpatialOpType binary = (BinarySpatialOpType) op.getValue(); - return visitor.touches(binary, obj); - } - } - - public static class Within extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinarySpatialOpType binary = (BinarySpatialOpType) op.getValue(); - return visitor.within(binary, obj); - } - } - - public static class Overlaps extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinarySpatialOpType binary = (BinarySpatialOpType) op.getValue(); - return visitor.overlaps(binary, obj); - } - } - - public static class Crosses extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinarySpatialOpType binary = (BinarySpatialOpType) op.getValue(); - return visitor.crosses(binary, obj); - } - } - - public static class Intersects extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinarySpatialOpType binary = (BinarySpatialOpType) op.getValue(); - return visitor.intersects(binary, obj); - } - } - - public static class Contains extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BinarySpatialOpType binary = (BinarySpatialOpType) op.getValue(); - return visitor.contains(binary, obj); - } - } - - public static class DWithin extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - DistanceBufferType dist = (DistanceBufferType) op.getValue(); - return visitor.dWithin(dist, obj); - } - } - - public static class Beyond extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - DistanceBufferType dist = (DistanceBufferType) op.getValue(); - return visitor.beyond(dist, obj); - } - } - - public static class Bbox extends AbstractSpatialOp { - @Override - public Object visit(JAXBElement op, - OgcFilterVisitor visitor, Object obj) throws Exception { - BBOXType bbox = (BBOXType) op.getValue(); - return visitor.bbox(bbox, obj); - } - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/EscapingLikeExpression.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/EscapingLikeExpression.java index 72b0e5e5c8..79af6e6c95 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/EscapingLikeExpression.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/EscapingLikeExpression.java @@ -13,20 +13,20 @@ import org.hibernate.criterion.LikeExpression; import org.hibernate.criterion.MatchMode; /** - * TODO Add Description + * Hibernate like expression that allows for a custom escape character * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 17, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class EscapingLikeExpression extends LikeExpression { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/ExpressionProcessor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/ExpressionProcessor.java deleted file mode 100644 index 4a8543c7ab..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/ExpressionProcessor.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.filter; - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.JAXBElement; - -/** - * - * @author bclement - * @version 1.0 - */ -public class ExpressionProcessor { - - protected static final Map expressionMap; - static { - expressionMap = new HashMap(); - expressionMap.put("Literal", new AbsExpressionOp.Literal()); - expressionMap.put("Add", new AbsExpressionOp.Add()); - expressionMap.put("Sub", new AbsExpressionOp.Sub()); - expressionMap.put("Mul", new AbsExpressionOp.Mul()); - expressionMap.put("Div", new AbsExpressionOp.Div()); - expressionMap.put("Function", new AbsExpressionOp.Function()); - expressionMap.put("PropertyName", new AbsExpressionOp.Property()); - } - - JAXBElement expression; - - /** - * @param expression - */ - public ExpressionProcessor(JAXBElement expression) { - super(); - this.expression = expression; - } - - public Object accept(OgcExpressionVisitor visitor, Object obj) - throws Exception { - AbsExpressionOp op = expressionMap.get(expression.getName() - .getLocalPart()); - return op.visit(expression, visitor, obj); - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/FilterProcessor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/FilterProcessor.java deleted file mode 100644 index 974f2f104d..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/FilterProcessor.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.filter; - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.JAXBElement; - -import net.opengis.filter.v_1_1_0.BinaryComparisonOpType; -import net.opengis.filter.v_1_1_0.ComparisonOpsType; -import net.opengis.filter.v_1_1_0.FilterType; -import net.opengis.filter.v_1_1_0.LogicOpsType; -import net.opengis.filter.v_1_1_0.PropertyIsBetweenType; -import net.opengis.filter.v_1_1_0.PropertyIsLikeType; -import net.opengis.filter.v_1_1_0.PropertyIsNullType; -import net.opengis.filter.v_1_1_0.SpatialOpsType; - -import com.raytheon.uf.edex.wfs.filter.AbstractCompOp.BinaryOp; - -/** - * - * @author bclement - * @version 1.0 - */ -public class FilterProcessor { - - protected static final Map, AbstractCompOp> compMap; - static { - compMap = new HashMap, AbstractCompOp>(); - compMap.put(BinaryComparisonOpType.class, new BinaryOp()); - compMap.put(PropertyIsLikeType.class, new AbstractCompOp.Like()); - compMap.put(PropertyIsNullType.class, new AbstractCompOp.Null()); - compMap.put(PropertyIsBetweenType.class, new AbstractCompOp.Between()); - } - - protected static final Map logicMap; - static { - logicMap = new HashMap(); - logicMap.put("And", new AbstractLogicOp.And()); - logicMap.put("Or", new AbstractLogicOp.Or()); - logicMap.put("Not", new AbstractLogicOp.Not()); - } - - protected static final Map spatialMap; - static { - spatialMap = new HashMap(); - spatialMap.put("Equals", new AbstractSpatialOp.SpatialEquals()); - spatialMap.put("Disjoint", new AbstractSpatialOp.Disjoint()); - spatialMap.put("Touches", new AbstractSpatialOp.Touches()); - spatialMap.put("Within", new AbstractSpatialOp.Within()); - spatialMap.put("Overlaps", new AbstractSpatialOp.Overlaps()); - spatialMap.put("Crosses", new AbstractSpatialOp.Crosses()); - spatialMap.put("Intersects", new AbstractSpatialOp.Intersects()); - spatialMap.put("Contains", new AbstractSpatialOp.Contains()); - spatialMap.put("DWithin", new AbstractSpatialOp.DWithin()); - spatialMap.put("Beyond", new AbstractSpatialOp.Beyond()); - spatialMap.put("BBOX", new AbstractSpatialOp.Bbox()); - } - - protected FilterType filter; - - public FilterProcessor(FilterType filter) { - this.filter = filter; - } - - public static FilterProcessor newFromLogic( - JAXBElement ops) { - FilterType f = new FilterType(); - f.setLogicOps(ops); - return new FilterProcessor(f); - } - - public static FilterProcessor newFromComparison( - JAXBElement ops) { - FilterType f = new FilterType(); - f.setComparisonOps(ops); - return new FilterProcessor(f); - } - - public static FilterProcessor newFromSpatial( - JAXBElement ops) { - FilterType f = new FilterType(); - f.setSpatialOps(ops); - return new FilterProcessor(f); - } - - public Object accept(OgcFilterVisitor visitor, Object obj) throws Exception { - JAXBElement comps = filter - .getComparisonOps(); - JAXBElement logics = filter.getLogicOps(); - JAXBElement spats = filter.getSpatialOps(); - Object rval; - if (logics != null && !logics.isNil()) { - String name = logics.getName().getLocalPart(); - AbstractLogicOp op = logicMap.get(name); - rval = op.visit(logics, visitor, obj); - } else if (comps != null && !comps.isNil()) { - Class type = comps.getDeclaredType(); - AbstractCompOp op = compMap.get(type); - rval = op.visit(comps, visitor, obj); - } else if (spats != null && !spats.isNil()) { - String name = spats.getName().getLocalPart(); - AbstractSpatialOp op = spatialMap.get(name); - rval = op.visit(spats, visitor, obj); - } else { - rval = null; - } - return rval; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/OgcExpressionVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/OgcExpressionVisitor.java deleted file mode 100644 index c8669607f3..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/OgcExpressionVisitor.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.filter; - -import java.util.List; - -import net.opengis.filter.v_1_1_0.PropertyNameType; - -/** - * - * @author bclement - * @version 1.0 - */ -public interface OgcExpressionVisitor { - - public Object add(ExpressionProcessor left, ExpressionProcessor right, - Object obj) throws Exception; - - public Object sub(ExpressionProcessor left, ExpressionProcessor right, - Object obj) throws Exception; - - public Object mul(ExpressionProcessor left, ExpressionProcessor right, - Object obj) throws Exception; - - public Object div(ExpressionProcessor left, ExpressionProcessor right, - Object obj) throws Exception; - - public Object literal(List values, Object obj) throws Exception; - - public Object property(PropertyNameType prop, Object obj) throws Exception; - - public Object function(List expressions, String name, - Object obj) throws Exception; -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/OgcFilterVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/OgcFilterVisitor.java deleted file mode 100644 index bb1970d478..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/OgcFilterVisitor.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.filter; - -import java.util.List; - -import net.opengis.filter.v_1_1_0.BBOXType; -import net.opengis.filter.v_1_1_0.BinarySpatialOpType; -import net.opengis.filter.v_1_1_0.DistanceBufferType; -import net.opengis.filter.v_1_1_0.PropertyIsLikeType; -import net.opengis.filter.v_1_1_0.PropertyIsNullType; - -/** - * - * @author bclement - * @version 1.0 - */ -public interface OgcFilterVisitor { - - // comparison - - public Object equal(ExpressionProcessor left, ExpressionProcessor right, - boolean matchCase, Object obj) throws Exception; - - public Object notEqual(ExpressionProcessor left, ExpressionProcessor right, - boolean matchCase, Object obj) throws Exception; - - public Object lessThan(ExpressionProcessor left, ExpressionProcessor right, - boolean matchCase, Object obj) throws Exception; - - public Object greaterThan(ExpressionProcessor left, - ExpressionProcessor right, boolean matchCase, Object obj) - throws Exception; - - public Object greaterThanEqual(ExpressionProcessor left, - ExpressionProcessor right, boolean matchCase, Object obj) - throws Exception; - - public Object lessThanEqual(ExpressionProcessor left, - ExpressionProcessor right, boolean matchCase, Object obj) - throws Exception; - - public Object isLike(PropertyIsLikeType op, Object obj) throws Exception; - - public Object isNull(PropertyIsNullType op, Object obj) throws Exception; - - public Object between(ExpressionProcessor lower, ExpressionProcessor exp, - ExpressionProcessor upper, Object obj) throws Exception; - - // logic - - public Object and(List filters, Object obj) - throws Exception; - - public Object or(List filters, Object obj) - throws Exception; - - public Object not(FilterProcessor filter, Object obj) throws Exception; - - // spatial - - public Object spatialEquals(BinarySpatialOpType op, Object obj) - throws Exception; - - public Object disjoint(BinarySpatialOpType op, Object obj) throws Exception; - - public Object touches(BinarySpatialOpType op, Object obj) throws Exception; - - public Object within(BinarySpatialOpType op, Object obj) throws Exception; - - public Object overlaps(BinarySpatialOpType op, Object obj) throws Exception; - - public Object crosses(BinarySpatialOpType op, Object obj) throws Exception; - - public Object intersects(BinarySpatialOpType op, Object obj) - throws Exception; - - public Object contains(BinarySpatialOpType op, Object obj) throws Exception; - - public Object dWithin(DistanceBufferType op, Object obj) throws Exception; - - public Object beyond(DistanceBufferType op, Object obj) throws Exception; - - public Object bbox(BBOXType op, Object obj) throws Exception; - -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbsExpressionOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbsExpressionOp.java index 9460d4daf9..6bfb0cb818 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbsExpressionOp.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbsExpressionOp.java @@ -30,6 +30,17 @@ import net.opengis.filter.v_1_1_0.LiteralType; import net.opengis.filter.v_1_1_0.PropertyNameType; /** + * OGC Filter parsing for expression operators. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 22, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractCompOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractCompOp.java index 8a0de0eae9..ad2361ca58 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractCompOp.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractCompOp.java @@ -35,6 +35,17 @@ import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; /** + * OGC Filter parsing for comparison operators. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 20, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractLogicOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractLogicOp.java index f1dd1afe70..e04a64b1d7 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractLogicOp.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractLogicOp.java @@ -34,6 +34,17 @@ import net.opengis.filter.v_1_1_0.SpatialOpsType; import net.opengis.filter.v_1_1_0.UnaryLogicOpType; /** + * OGC Filter parsing for logic operators. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 20, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractSpatialOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractSpatialOp.java index 66466fcb28..bac1c42897 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractSpatialOp.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/AbstractSpatialOp.java @@ -27,6 +27,17 @@ import net.opengis.filter.v_1_1_0.DistanceBufferType; import net.opengis.filter.v_1_1_0.SpatialOpsType; /** + * OGC Filter parsing for spatial operators. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 20, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/ExpressionProcessor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/ExpressionProcessor.java index 2101d4464e..958e5bf566 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/ExpressionProcessor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/ExpressionProcessor.java @@ -25,6 +25,17 @@ import java.util.Map; import javax.xml.bind.JAXBElement; /** + * Parses OGC Filter Expression objects using visitor pattern. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 21, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/FilterProcessor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/FilterProcessor.java index ac187199a2..76995c71f9 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/FilterProcessor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/FilterProcessor.java @@ -41,6 +41,17 @@ import net.opengis.filter.v_1_1_0.SpatialOpsType; import com.raytheon.uf.edex.wfs.filter.v1_1_0.AbstractCompOp.BinaryOp; /** + * Parses OGC Filter objects using visitor pattern. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 20, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/OgcExpressionVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/OgcExpressionVisitor.java index b7c45266e4..cb1c3d4ef0 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/OgcExpressionVisitor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/OgcExpressionVisitor.java @@ -24,6 +24,17 @@ import java.util.List; import net.opengis.filter.v_1_1_0.PropertyNameType; /** + * Visitor Pattern interface for parsing OGC Filter Expressions + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 21, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/OgcFilterVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/OgcFilterVisitor.java index c6c6a5a4f2..01e42afcee 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/OgcFilterVisitor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/OgcFilterVisitor.java @@ -28,6 +28,17 @@ import net.opengis.filter.v_1_1_0.PropertyIsLikeType; import net.opengis.filter.v_1_1_0.PropertyIsNullType; /** + * Visitor Pattern interface for parsing OGC Filter objects + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 20, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/QueryExpressionVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/QueryExpressionVisitor.java index 50ea64f1df..0ecb47d6bf 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/QueryExpressionVisitor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/QueryExpressionVisitor.java @@ -28,6 +28,17 @@ import com.raytheon.uf.common.status.UFStatus; /** + * Parses OGC Filter Expressions to hibernate query operands + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 22, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/QueryFilterVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/QueryFilterVisitor.java index ea278a982e..be0445fbf6 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/QueryFilterVisitor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v1_1_0/QueryFilterVisitor.java @@ -55,6 +55,17 @@ import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Geometry; /** + * Parses OGC Filter to hibernate criterion + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 22, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbsExpressionOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbsExpressionOp.java index 3ff5ee692f..eb0f16501c 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbsExpressionOp.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbsExpressionOp.java @@ -30,6 +30,16 @@ import net.opengis.filter.v_2_0_0.LiteralType; /** * Visitor pattern support classes for filter expression operations * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractCompOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractCompOp.java index 2ce9a7f4ce..dc1cd76dc6 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractCompOp.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractCompOp.java @@ -38,6 +38,16 @@ import com.raytheon.uf.common.status.UFStatus; /** * Visitor pattern support classes for comparison operators * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractLogicOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractLogicOp.java index f330bb94e7..fd597f7fd7 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractLogicOp.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractLogicOp.java @@ -35,6 +35,16 @@ import net.opengis.filter.v_2_0_0.UnaryLogicOpType; /** * Visitor pattern support classes for logic operators * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractQueryFilterVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractQueryFilterVisitor.java index d75ccbece1..1284eaeade 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractQueryFilterVisitor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractQueryFilterVisitor.java @@ -48,7 +48,7 @@ import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.io.WKTReader; /** - * TODO Add Description + * Abstract base for filter parsing. Provides common utility methods. * *
  * 
diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractSpatialOp.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractSpatialOp.java
index 54e18368db..9ee5842534 100644
--- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractSpatialOp.java
+++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/AbstractSpatialOp.java
@@ -29,6 +29,16 @@ import net.opengis.filter.v_2_0_0.SpatialOpsType;
 /**
  * Visitor pattern support classes for spatial operations
  * 
+ * 
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/ExpressionProcessor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/ExpressionProcessor.java index 03efa3e56c..2a8bae2bf1 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/ExpressionProcessor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/ExpressionProcessor.java @@ -27,6 +27,16 @@ import javax.xml.bind.JAXBElement; /** * Top level visitor pattern support class for expressions * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/Filter2Processor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/Filter2Processor.java index 5185990121..52ba8f4013 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/Filter2Processor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/Filter2Processor.java @@ -47,6 +47,16 @@ import com.raytheon.uf.edex.wfs.filter.v2_0_0.AbstractCompOp.Null; /** * Top level visitor pattern support class for filters * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/FilterFunction.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/FilterFunction.java index f935607f81..a3d6affb4f 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/FilterFunction.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/FilterFunction.java @@ -10,20 +10,20 @@ package com.raytheon.uf.edex.wfs.filter.v2_0_0; /** - * TODO Add Description + * Abstract base for parsed functions from OGC filters * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 20, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public abstract class FilterFunction { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/IExpressionVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/IExpressionVisitor.java index 67f893a375..b502870430 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/IExpressionVisitor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/IExpressionVisitor.java @@ -33,6 +33,16 @@ import java.util.List; /** * Visitor interface for expressions * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/IFilter2Visitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/IFilter2Visitor.java index 6535a63c38..d90c72f6a7 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/IFilter2Visitor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/IFilter2Visitor.java @@ -42,6 +42,16 @@ import net.opengis.filter.v_2_0_0.PropertyIsNullType; /** * Filter 2.0 visitor interface * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/QueryExpressionVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/QueryExpressionVisitor.java index 409bc64c99..04173e5c5c 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/QueryExpressionVisitor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/QueryExpressionVisitor.java @@ -31,6 +31,16 @@ import com.raytheon.uf.edex.wfs.provider.VisitorBag; /** * Visitor for query expressions * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/QueryFilterVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/QueryFilterVisitor.java index 5b198b6dd2..b9493e86c6 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/QueryFilterVisitor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/QueryFilterVisitor.java @@ -66,6 +66,16 @@ import com.vividsolutions.jts.geom.Geometry; /** * Visitor for building hibernate criterion from filter * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/TimeFunction.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/TimeFunction.java index 9ed260bea3..15a4592e4b 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/TimeFunction.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/filter/v2_0_0/TimeFunction.java @@ -16,20 +16,20 @@ import java.util.Map; import java.util.Set; /** - * TODO Add Description + * Function object for temporal filter functions * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 20, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public abstract class TimeFunction extends FilterFunction { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/gml/EnvelopeConverter.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/gml/EnvelopeConverter.java deleted file mode 100644 index 39da5947f1..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/gml/EnvelopeConverter.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.gml; - -import java.util.Arrays; -import java.util.List; - -import net.opengis.gml.v_3_1_1.CoordType; -import net.opengis.gml.v_3_1_1.CoordinatesType; -import net.opengis.gml.v_3_1_1.DirectPositionType; -import net.opengis.gml.v_3_1_1.EnvelopeType; - -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Envelope; - -/** - * - * @author bclement - * @version 1.0 - */ -public class EnvelopeConverter { - - public Envelope convert(EnvelopeType env) throws Exception { - DirectPositionType lower = env.getLowerCorner(); - DirectPositionType upper = env.getUpperCorner(); - if (lower == null || upper == null) { - return handleDeprecated(env); - } - return translate(lower, upper); - } - - protected Envelope translate(DirectPositionType lower, - DirectPositionType upper) throws Exception { - List lowers = lower.getValue(); - List uppers = upper.getValue(); - if (lowers == null || uppers == null || lowers.size() != 2 - || uppers.size() != 2) { - throw new Exception("Unsupported envelope format"); - } - Coordinate l = new Coordinate(lowers.get(0), lowers.get(1)); - Coordinate u = new Coordinate(uppers.get(0), uppers.get(1)); - return new Envelope(l, u); - } - - protected Envelope handleDeprecated(EnvelopeType env) throws Exception { - List coord = env.getCoord(); - List pos = env.getPos(); - CoordinatesType coordinates = env.getCoordinates(); - DirectPositionType lower; - DirectPositionType upper; - if (coord != null && coord.size() == 2) { - CoordType c0 = coord.get(0); - CoordType c1 = coord.get(1); - lower = createPos(c0); - upper = createPos(c1); - } else if (pos != null && pos.size() == 2) { - lower = pos.get(0); - upper = pos.get(1); - } else if (coordinates != null) { - String value = coordinates.getValue(); - String[] parts = value.trim().split("\\s"); - lower = createPos(parts[0]); - upper = createPos(parts[1]); - } else { - throw new Exception("Unsupported envelope format"); - } - return translate(lower, upper); - } - - /** - * @param string - * @return - */ - private DirectPositionType createPos(String string) { - return createPos(string.split(",")); - } - - protected DirectPositionType createPos(String[] doubles) { - Double[] rval = new Double[doubles.length]; - for (int i = 0; i < doubles.length; ++i) { - rval[i] = Double.parseDouble(doubles[i]); - } - return createPos(rval); - } - - protected DirectPositionType createPos(CoordType coord) throws Exception { - Double[] rval; - if (coord.isSetZ()) { - rval = new Double[] { coord.getX().doubleValue(), - coord.getY().doubleValue(), coord.getZ().doubleValue() }; - } else if (coord.isSetY()) { - rval = new Double[] { coord.getX().doubleValue(), - coord.getY().doubleValue() }; - } else { - rval = new Double[] { coord.getX().doubleValue() }; - } - return createPos(rval); - } - - protected DirectPositionType createPos(Double... coords) { - DirectPositionType rval = new DirectPositionType(); - rval.setValue(Arrays.asList(coords)); - return rval; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/gml/GeometryConverter.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/gml/GeometryConverter.java deleted file mode 100644 index 962bcdd1ec..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/gml/GeometryConverter.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.gml; - -import net.opengis.gml.v_3_1_1.AbstractGeometryType; - -import org.geotools.geometry.jts.JTS; -import org.jvnet.jaxb2_commons.locator.DefaultRootObjectLocator; -import org.jvnet.ogc.gml.v_3_1_1.jts.ConversionFailedException; -import org.jvnet.ogc.gml.v_3_1_1.jts.GML311ToJTSGeometryConverter; - -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.io.ParseException; - -/** - * - * @author bclement - * @version 1.0 - */ -public class GeometryConverter { - - public Geometry convert(Envelope env) throws ParseException { - return JTS.toGeometry(env); - } - - public Geometry convert(AbstractGeometryType value) - throws ConversionFailedException { - GML311ToJTSGeometryConverter converter = new GML311ToJTSGeometryConverter(); - return converter.createGeometry(new DefaultRootObjectLocator(value), - value); - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/gml/GmlWktWriter.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/gml/GmlWktWriter.java deleted file mode 100644 index 2ab732954f..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/gml/GmlWktWriter.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.gml; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.JAXBElement; - -import net.opengis.gml.v_3_1_1.AbstractCurveType; -import net.opengis.gml.v_3_1_1.AbstractGeometryType; -import net.opengis.gml.v_3_1_1.AbstractRingPropertyType; -import net.opengis.gml.v_3_1_1.AbstractRingType; -import net.opengis.gml.v_3_1_1.CoordType; -import net.opengis.gml.v_3_1_1.CurvePropertyType; -import net.opengis.gml.v_3_1_1.DirectPositionListType; -import net.opengis.gml.v_3_1_1.DirectPositionType; -import net.opengis.gml.v_3_1_1.LineStringPropertyType; -import net.opengis.gml.v_3_1_1.LineStringType; -import net.opengis.gml.v_3_1_1.LinearRingType; -import net.opengis.gml.v_3_1_1.MultiLineStringType; -import net.opengis.gml.v_3_1_1.MultiPointType; -import net.opengis.gml.v_3_1_1.MultiPolygonType; -import net.opengis.gml.v_3_1_1.PointArrayPropertyType; -import net.opengis.gml.v_3_1_1.PointPropertyType; -import net.opengis.gml.v_3_1_1.PointType; -import net.opengis.gml.v_3_1_1.PolygonPropertyType; -import net.opengis.gml.v_3_1_1.PolygonType; -import net.opengis.gml.v_3_1_1.RingType; - -/** - * - * @author bclement - * @version 1.0 - */ -public abstract class GmlWktWriter { - - protected static final Map, GmlWktWriter> geomMap; - static { - geomMap = new HashMap, GmlWktWriter>(); - geomMap.put(PolygonType.class, new Polygon()); - geomMap.put(MultiPolygonType.class, new MultiPolygon()); - geomMap.put(PointType.class, new Point()); - geomMap.put(MultiPointType.class, new MultiPoint()); - geomMap.put(LinearRingType.class, new LinearRing()); - geomMap.put(LineStringType.class, new LineString()); - geomMap.put(MultiLineStringType.class, new MultiLineString()); - } - - public abstract String write(AbstractGeometryType geom) throws Exception; - - public static String write(JAXBElement elem) - throws Exception { - GmlWktWriter writer = geomMap.get(elem.getDeclaredType()); - if (writer != null) { - return writer.write(elem.getValue()); - } else { - throw new Exception("Unsupported geometry type: " - + elem.getDeclaredType()); - } - } - - protected void addPolygon(PolygonType poly, StringBuilder sb) - throws Exception { - sb.append('('); - AbstractRingPropertyType value = poly.getExterior().getValue(); - AbstractRingType ring = value.getRing().getValue(); - addAbstractRing(ring, sb); - List> interior = poly - .getInterior(); - if (interior != null && !interior.isEmpty()) { - sb.append(','); - addInterior(interior, sb); - } - sb.append(')'); - } - - /** - * @param interior - * @param sb - * @throws Exception - */ - protected void addInterior( - List> interior, - StringBuilder sb) throws Exception { - Iterator> i = interior.iterator(); - sb.append('('); - addAbstractRing(i.next().getValue().getRing().getValue(), sb); - while (i.hasNext()) { - sb.append(','); - addAbstractRing(i.next().getValue().getRing().getValue(), sb); - } - } - - protected void addAbstractRing(AbstractRingType ring, StringBuilder sb) - throws Exception { - if (ring instanceof LinearRingType) { - addLinearRing((LinearRingType) ring, sb); - } else if (ring instanceof RingType) { - addRing((RingType) ring, sb); - } else { - throw new Exception("Unsupported ring type" + ring.getClass()); - } - } - - /** - * @param ring - * @param sb - * @throws Exception - */ - private void addRing(RingType ring, StringBuilder sb) throws Exception { - List curvProps = ring.getCurveMember(); - Iterator i = curvProps.iterator(); - AbstractCurveType curve = i.next().getCurve().getValue(); - if (curve instanceof LineStringType) { - addLineString((LineStringType) curve, sb); - } else { - throw new Exception("Unsupported curve type: " + curve.getClass()); - } - } - - /** - * @param ring - * @param sb - * @throws Exception - */ - private void addLinearRing(LinearRingType ring, StringBuilder sb) - throws Exception { - DirectPositionListType posList = ring.getPosList(); - List coord = ring.getCoord(); - List> elems = ring.getPosOrPointPropertyOrPointRep(); - addLine(posList, elems, coord, sb); - } - - protected void addLine(DirectPositionListType posList, - List> elems, List coord, StringBuilder sb) - throws Exception { - sb.append("("); - if (posList != null) { - addPosList(posList, sb); - } else if (elems != null) { - addMixedPos(elems, sb); - } else if (coord != null) { - addCoords(coord, sb); - } else { - throw new Exception("Unsupported LineString format"); - } - sb.append(")"); - } - - /** - * @param coord - * @param sb - */ - protected void addCoords(List coord, StringBuilder sb) { - Iterator i = coord.iterator(); - addPoint(convert(i.next()), sb); - while (i.hasNext()) { - sb.append(", "); - addPoint(convert(i.next()), sb); - } - } - - protected void addLineString(LineStringType lst, StringBuilder sb) - throws Exception { - DirectPositionListType posList = lst.getPosList(); - List> elems = lst.getPosOrPointPropertyOrPointRep(); - addLine(posList, elems, null, sb); - } - - protected void addMixedPos(List> elems, StringBuilder sb) - throws Exception { - Iterator> i = elems.iterator(); - while (i.hasNext()) { - JAXBElement elem = i.next(); - Object value = elem.getValue(); - List point = null; - if (value instanceof DirectPositionType) { - DirectPositionType pos = (DirectPositionType) value; - point = pos.getValue(); - } else if (value instanceof PointPropertyType) { - PointPropertyType pointProp = (PointPropertyType) value; - DirectPositionType pos = pointProp.getPoint().getPos(); - CoordType coord = pointProp.getPoint().getCoord(); - if (pos != null) { - point = pos.getValue(); - } else if (coord != null) { - point = convert(coord); - } - } - if (point == null) { - throw new Exception("Unsupported position type: " - + value.getClass()); - } - addPoint(point, sb); - if (i.hasNext()) { - sb.append(", "); - } - } - } - - public void addPointPropList(List pointProps, - StringBuilder sb) throws Exception { - Iterator i = pointProps.iterator(); - addPoint(i.next().getPoint(), sb); - while (i.hasNext()) { - sb.append(' '); - addPoint(i.next().getPoint(), sb); - } - } - - public void addPointList(List point, StringBuilder sb) - throws Exception { - Iterator i = point.iterator(); - addPoint(i.next(), sb); - while (i.hasNext()) { - sb.append(' '); - addPoint(i.next(), sb); - } - } - - protected void addPoint(PointType point, StringBuilder sb) throws Exception { - DirectPositionType pos = point.getPos(); - CoordType coord = point.getCoord(); - if (pos != null) { - addPoint(pos.getValue(), sb); - } else if (coord != null) { - addPoint(convert(coord), sb); - } else { - throw new Exception("Unsupported point format"); - } - } - - protected void addPoint(List point, StringBuilder sb) { - Iterator j = point.iterator(); - sb.append(j.next()); - while (j.hasNext()) { - sb.append(" "); - sb.append(j.next()); - } - } - - protected List convert(CoordType coord) { - ArrayList rval = new ArrayList(3); - rval.add(coord.getX().doubleValue()); - BigDecimal y = coord.getY(); - BigDecimal z = coord.getZ(); - if (y != null) { - rval.add(y.doubleValue()); - if (z != null) { - rval.add(z.doubleValue()); - } - } - return rval; - } - - protected void addPosList(DirectPositionListType poslist, StringBuilder sb) - throws Exception { - int dim = poslist.getSrsDimension().intValue(); - List value = poslist.getValue(); - if (dim < 2 || value.size() % dim != 0) { - throw new Exception("Invalid dimensions for position list"); - } - Iterator i = value.iterator(); - while (i.hasNext()) { - sb.append(i.next()); - for (int j = 0; j < dim; ++j) { - sb.append(" "); - sb.append(i.next()); - } - if (i.hasNext()) { - sb.append(", "); - } - } - } - - public static class LineString extends GmlWktWriter { - @Override - public String write(AbstractGeometryType geom) throws Exception { - LineStringType lst = (LineStringType) geom; - StringBuilder sb = new StringBuilder("LINESTRING "); - addLineString(lst, sb); - return sb.toString(); - } - } - - public static class MultiLineString extends GmlWktWriter { - @Override - public String write(AbstractGeometryType geom) throws Exception { - MultiLineStringType mlst = (MultiLineStringType) geom; - StringBuilder sb = new StringBuilder("MULTILINESTRING ("); - Iterator i = mlst.getLineStringMember() - .iterator(); - addLineString(i.next().getLineString(), sb); - while (i.hasNext()) { - sb.append(','); - addLineString(i.next().getLineString(), sb); - } - sb.append(')'); - return sb.toString(); - } - } - - public static class Point extends GmlWktWriter { - @Override - public String write(AbstractGeometryType geom) throws Exception { - PointType p = (PointType) geom; - StringBuilder sb = new StringBuilder("POINT ("); - addPoint(p, sb); - sb.append(')'); - return sb.toString(); - } - } - - public static class MultiPoint extends GmlWktWriter { - @Override - public String write(AbstractGeometryType geom) throws Exception { - MultiPointType mult = (MultiPointType) geom; - StringBuilder sb = new StringBuilder("MULTIPOINT ("); - List pointProps = mult.getPointMember(); - PointArrayPropertyType array = mult.getPointMembers(); - if (pointProps != null) { - addPointPropList(pointProps, sb); - } - if (array != null) { - addPointList(array.getPoint(), sb); - } - sb.append(')'); - return sb.toString(); - } - } - - public static class Polygon extends GmlWktWriter { - @Override - public String write(AbstractGeometryType geom) throws Exception { - PolygonType poly = (PolygonType) geom; - StringBuilder sb = new StringBuilder("POLYGON "); - addPolygon(poly, sb); - return sb.toString(); - } - } - - public static class MultiPolygon extends GmlWktWriter { - @Override - public String write(AbstractGeometryType geom) throws Exception { - MultiPolygonType poly = (MultiPolygonType) geom; - StringBuilder sb = new StringBuilder("MULTIPOLYGON ("); - List value = poly.getPolygonMember(); - Iterator i = value.iterator(); - addPolygon(i.next().getPolygon(), sb); - while (i.hasNext()) { - sb.append(','); - addPolygon(i.next().getPolygon(), sb); - } - sb.append(')'); - return sb.toString(); - } - } - - public static class LinearRing extends GmlWktWriter { - @Override - public String write(AbstractGeometryType geom) throws Exception { - LinearRingType ring = (LinearRingType) geom; - StringBuilder sb = new StringBuilder("LINEARRING "); - addAbstractRing(ring, sb); - return sb.toString(); - } - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/AbstractWfsProvider.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/AbstractWfsProvider.java index aece70f579..16a49bd856 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/AbstractWfsProvider.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/AbstractWfsProvider.java @@ -9,6 +9,8 @@ */ package com.raytheon.uf.edex.wfs.provider; +import java.io.IOException; +import java.io.InputStream; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; @@ -33,6 +35,8 @@ import com.raytheon.uf.edex.wfs.request.SortBy; import com.raytheon.uf.edex.wfs.request.SortBy.Order; /** + * Abstract base for WFS providers for specific service versions. Provides + * common utility methods and constants. * *
  * 
@@ -250,4 +254,20 @@ public abstract class AbstractWfsProvider implements IWfsProvider {
         return otr;
     }
 
+    /**
+     * Read input stream to string
+     * 
+     * @param in
+     * @return
+     * @throws IOException
+     */
+    protected String getXml(InputStream in) throws IOException {
+        java.util.Scanner scanner = new java.util.Scanner(in);
+        try {
+            return scanner.useDelimiter("\\A").next();
+        } finally {
+            scanner.close();
+        }
+    }
+
 }
diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/Capabilities.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/Capabilities.java
deleted file mode 100644
index dfd1d065ba..0000000000
--- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/Capabilities.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- * 
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- * 
- * Contractor Name:        Raytheon Company
- * Contractor Address:     6825 Pine Street, Suite 340
- *                         Mail Stop B8
- *                         Omaha, NE 68106
- *                         402.291.0100
- * 
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-package com.raytheon.uf.edex.wfs.provider;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-
-import net.opengis.filter.v_1_1_0.ArithmeticOperatorsType;
-import net.opengis.filter.v_1_1_0.ComparisonOperatorType;
-import net.opengis.filter.v_1_1_0.ComparisonOperatorsType;
-import net.opengis.filter.v_1_1_0.FilterCapabilities;
-import net.opengis.filter.v_1_1_0.GeometryOperandsType;
-import net.opengis.filter.v_1_1_0.IdCapabilitiesType;
-import net.opengis.filter.v_1_1_0.LogicalOperators;
-import net.opengis.filter.v_1_1_0.ScalarCapabilitiesType;
-import net.opengis.filter.v_1_1_0.SpatialCapabilitiesType;
-import net.opengis.filter.v_1_1_0.SpatialOperatorNameType;
-import net.opengis.filter.v_1_1_0.SpatialOperatorType;
-import net.opengis.filter.v_1_1_0.SpatialOperatorsType;
-import net.opengis.ows.v_1_0_0.CodeType;
-import net.opengis.ows.v_1_0_0.DCP;
-import net.opengis.ows.v_1_0_0.DomainType;
-import net.opengis.ows.v_1_0_0.HTTP;
-import net.opengis.ows.v_1_0_0.Operation;
-import net.opengis.ows.v_1_0_0.OperationsMetadata;
-import net.opengis.ows.v_1_0_0.RequestMethodType;
-import net.opengis.ows.v_1_0_0.ServiceIdentification;
-import net.opengis.wfs.v_1_1_0.FeatureTypeListType;
-import net.opengis.wfs.v_1_1_0.FeatureTypeType;
-import net.opengis.wfs.v_1_1_0.GMLObjectTypeListType;
-import net.opengis.wfs.v_1_1_0.GMLObjectTypeType;
-import net.opengis.wfs.v_1_1_0.OutputFormatListType;
-import net.opengis.wfs.v_1_1_0.WFSCapabilitiesType;
-
-import com.raytheon.uf.edex.ogc.common.OgcNamespace;
-import com.raytheon.uf.edex.ogc.common.OgcOperationInfo;
-import com.raytheon.uf.edex.ogc.common.OgcServiceInfo;
-import com.raytheon.uf.edex.wfs.WfsException;
-import com.raytheon.uf.edex.wfs.IWfsProvider.WfsOpType;
-import com.raytheon.uf.edex.wfs.reg.WfsRegistryImpl;
-import com.raytheon.uf.edex.wfs.request.GetCapReq;
-
-/**
- * 
- * @author bclement
- * @version 1.0
- */
-public class Capabilities {
-
-    protected String SERV_TYPE = "WFS";
-
-    protected String SERV_TITLE = "EDEX WFS";
-
-    protected String OWS_NS = OgcNamespace.OWS;
-
-    protected String GML_NS = OgcNamespace.GML;
-
-    protected String OGC_NS = OgcNamespace.OGC;
-
-    protected String WFS_NS = OgcNamespace.WFS;
-
-    protected String GML_MIME = "text/xml; subtype=gml/3.1.1";
-
-    protected String[] gmlObjects = { "AbstractFeatureType", "PointType",
-            "LineStringType", "PolygonType", "MultiPointType" };
-
-    protected String[] geometryOperands = { "Envelope", "Point", "LineString",
-            "Polygon" };
-
-    protected SpatialOperatorNameType[] spatialOperators = {
-            SpatialOperatorNameType.BBOX, SpatialOperatorNameType.EQUALS };
-
-    protected ComparisonOperatorType[] comparisonOperators = {
-            ComparisonOperatorType.LESS_THAN,
-            ComparisonOperatorType.GREATER_THAN,
-            ComparisonOperatorType.LESS_THAN_EQUAL_TO,
-            ComparisonOperatorType.GREATER_THAN_EQUAL_TO,
-            ComparisonOperatorType.EQUAL_TO,
-            ComparisonOperatorType.NOT_EQUAL_TO };
-
-    protected String[] logicOperators = { "And" };
-
-    protected FeatureTranslator translator = new FeatureTranslator();
-
-    protected WfsRegistryImpl registry;
-
-    public Capabilities(WfsRegistryImpl registry) {
-        this.registry = registry;
-    }
-
-    public WFSCapabilitiesType getCapabilities(GetCapReq request,
-            OgcServiceInfo serviceinfo) throws WfsException {
-        WFSCapabilitiesType cap = new WFSCapabilitiesType();
-        cap.setServiceIdentification(getServiceId(serviceinfo));
-        cap.setOperationsMetadata(getOpData(serviceinfo));
-        cap.setFeatureTypeList(getFeatureTypes(request, serviceinfo));
-        cap.setServesGMLObjectTypeList(getServesGML());
-        cap.setSupportsGMLObjectTypeList(getSupportsGML());
-        cap.setFilterCapabilities(getFilterCap());
-        return cap;
-    }
-
-    /**
-     * @param serviceinfo
-     * @return
-     */
-    protected OperationsMetadata getOpData(OgcServiceInfo serviceinfo) {
-        OperationsMetadata rval = new OperationsMetadata();
-        List operations = new LinkedList();
-        for (OgcOperationInfo op : serviceinfo.getOperations()) {
-            Operation to = new Operation();
-            to.setName(op.getType().toString());
-            to.setDCP(getDcpList(op));
-            to.setParameter(getOpParams(op));
-            operations.add(to);
-        }
-        rval.setOperation(operations);
-        rval.setParameter(getParams(serviceinfo));
-        // may want to do constraints as well
-        return rval;
-    }
-
-    /**
-     * @param op
-     * @return
-     */
-    private List getOpParams(OgcOperationInfo op) {
-        return Arrays.asList(
-                getAsDomainType("AcceptVersions", op.getVersions()),
-                getAsDomainType("AcceptFormats", op.getFormats()));
-    }
-
-    /**
-     * @param op
-     * @return
-     */
-    protected List getDcpList(OgcOperationInfo op) {
-        List rval = new LinkedList();
-        DCP dcp = new DCP();
-        HTTP http = new HTTP();
-        List> value = new LinkedList>();
-        if (op.hasHttpGet()) {
-            value.add(getRequestType("Get", op.getHttpGetRes()));
-        }
-        if (op.hasHttpPost()) {
-            value.add(getRequestType("Post", op.getHttpPostRes()));
-        }
-        http.setGetOrPost(value);
-        dcp.setHTTP(http);
-        rval.add(dcp);
-        return rval;
-    }
-
-    protected JAXBElement getRequestType(String name,
-            String value) {
-        JAXBElement rval = new JAXBElement(
-                new QName(OWS_NS, name), RequestMethodType.class,
-                new RequestMethodType());
-        rval.getValue().setHref(value);
-        return rval;
-    }
-
-    protected DomainType getAsDomainType(String name, Collection values) {
-        DomainType rval = new DomainType();
-        rval.setName(name);
-        List toVals = new ArrayList(values.size());
-        for (String val : values) {
-            toVals.add(val);
-        }
-        rval.setValue(toVals);
-        return rval;
-    }
-
-    /**
-     * @param serviceinfo
-     * @return
-     */
-    protected List getParams(OgcServiceInfo serviceinfo) {
-        // TODO this info should be passed in from somewhere
-        return Arrays.asList(getAsDomainType("srsName",
-                Arrays.asList("EPSG:4326")));
-    }
-
-    /**
-     * @return
-     */
-    protected FilterCapabilities getFilterCap() {
-        FilterCapabilities rval = new FilterCapabilities();
-        rval.setScalarCapabilities(getScalarCapabilities());
-        rval.setSpatialCapabilities(getSpatialCapabilities());
-        rval.setIdCapabilities(getIdCapabilities());
-        return rval;
-    }
-
-    /**
-     * @return
-     */
-    protected IdCapabilitiesType getIdCapabilities() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @return
-     */
-    protected SpatialCapabilitiesType getSpatialCapabilities() {
-        SpatialCapabilitiesType rval = new SpatialCapabilitiesType();
-        rval.setGeometryOperands(getGeometryOperands());
-        rval.setSpatialOperators(getSpatialOperators());
-        return rval;
-    }
-
-    /**
-     * @return
-     */
-    protected SpatialOperatorsType getSpatialOperators() {
-        SpatialOperatorsType rval = new SpatialOperatorsType();
-        List ops = new ArrayList(
-                spatialOperators.length);
-        for (SpatialOperatorNameType name : spatialOperators) {
-            SpatialOperatorType op = new SpatialOperatorType();
-            op.setName(name);
-            ops.add(op);
-        }
-        rval.setSpatialOperator(ops);
-        return rval;
-    }
-
-    /**
-     * @return
-     */
-    protected GeometryOperandsType getGeometryOperands() {
-        GeometryOperandsType rval = new GeometryOperandsType();
-        List ops = new ArrayList(geometryOperands.length);
-        for (String op : geometryOperands) {
-            QName name = new QName(OgcNamespace.GML, op);
-            ops.add(name);
-        }
-        rval.setGeometryOperand(ops);
-        return rval;
-    }
-
-    /**
-     * @return
-     */
-    protected ScalarCapabilitiesType getScalarCapabilities() {
-        ScalarCapabilitiesType rval = new ScalarCapabilitiesType();
-        rval.setArithmeticOperators(getArithmeticOperators());
-        rval.setComparisonOperators(getComparisonOperators());
-        rval.setLogicalOperators(GetLogicalOperators());
-        return rval;
-    }
-
-    /**
-     * @return
-     */
-    protected LogicalOperators GetLogicalOperators() {
-        return null;
-    }
-
-    /**
-     * @return
-     */
-    protected ComparisonOperatorsType getComparisonOperators() {
-        ComparisonOperatorsType rval = new ComparisonOperatorsType();
-        List ops = new ArrayList(
-                comparisonOperators.length);
-        for (ComparisonOperatorType op : comparisonOperators) {
-            ops.add(op);
-        }
-        rval.setComparisonOperator(ops);
-        return rval;
-    }
-
-    /**
-     * @return
-     */
-    protected ArithmeticOperatorsType getArithmeticOperators() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @return
-     */
-    protected GMLObjectTypeListType getSupportsGML() {
-        GMLObjectTypeListType rval = new GMLObjectTypeListType();
-        List gmlObs = new ArrayList(
-                gmlObjects.length);
-        for (String type : gmlObjects) {
-            gmlObs.add(getGMLObjType(type));
-        }
-        rval.setGMLObjectType(gmlObs);
-        return rval;
-    }
-
-    protected GMLObjectTypeType getGMLObjType(String name) {
-        GMLObjectTypeType rval = new GMLObjectTypeType();
-        rval.setName(new QName(GML_NS, name));
-        OutputFormatListType outFormats = new OutputFormatListType();
-        outFormats.setFormat(Arrays.asList(GML_MIME));
-        rval.setOutputFormats(outFormats);
-        return rval;
-    }
-
-    /**
-     * @return
-     */
-    protected GMLObjectTypeListType getServesGML() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @param request
-     * @param serviceinfo
-     * @return
-     * @throws WfsException
-     */
-    protected FeatureTypeListType getFeatureTypes(GetCapReq request,
-            OgcServiceInfo serviceinfo) throws WfsException {
-        FeatureTypeListType rval = new FeatureTypeListType();
-        // rval.setOperations(getOperations(serviceinfo));
-        rval.setFeatureType(getFeatureTypes(request));
-        return rval;
-    }
-
-    protected List getFeatureTypes(GetCapReq request)
-            throws WfsException {
-        return translator.transform(registry.getFeatures());
-    }
-
-    /**
-     * @param serviceinfo
-     * @return
-     */
-    protected ServiceIdentification getServiceId(
-            OgcServiceInfo serviceinfo) {
-        ServiceIdentification rval = new ServiceIdentification();
-        CodeType ct = new CodeType();
-        ct.setValue(SERV_TYPE);
-        rval.setServiceType(ct);
-        rval.setTitle(SERV_TITLE);
-        return rval;
-    }
-}
diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureDescriber.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureDescriber.java
index fb631e8f43..b61f3c25ef 100644
--- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureDescriber.java
+++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureDescriber.java
@@ -26,20 +26,20 @@ import com.raytheon.uf.edex.wfs.request.DescFeatureTypeReq;
 import com.raytheon.uf.edex.wfs.request.QualifiedName;
 
 /**
- * TODO Add Description
+ * Generates feature type descriptions for describe feature type operation
  * 
  * 
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 25, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class FeatureDescriber { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureFetcher.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureFetcher.java index 49f229f361..a206364ea2 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureFetcher.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureFetcher.java @@ -37,15 +37,15 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.edex.ogc.common.OgcBoundingBox; import com.raytheon.uf.edex.ogc.common.OgcException; import com.raytheon.uf.edex.ogc.common.OgcServiceInfo; +import com.raytheon.uf.edex.wfs.IWfsProvider.WfsOpType; import com.raytheon.uf.edex.wfs.WfsException; import com.raytheon.uf.edex.wfs.WfsException.Code; -import com.raytheon.uf.edex.wfs.IWfsProvider.WfsOpType; +import com.raytheon.uf.edex.wfs.reg.IWfsSource; import com.raytheon.uf.edex.wfs.reg.WfsQuery; import com.raytheon.uf.edex.wfs.reg.WfsQueryOptions; import com.raytheon.uf.edex.wfs.reg.WfsQueryResults; import com.raytheon.uf.edex.wfs.reg.WfsQueryResults.ResultType; import com.raytheon.uf.edex.wfs.reg.WfsRegistryImpl; -import com.raytheon.uf.edex.wfs.reg.IWfsSource; import com.raytheon.uf.edex.wfs.request.FeatureQuery; import com.raytheon.uf.edex.wfs.request.GetFeatureReq; import com.raytheon.uf.edex.wfs.request.QualifiedName; @@ -53,6 +53,17 @@ import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Polygon; /** + * Abstract base for retrieving features from storage + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 29, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureTranslator.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureTranslator.java deleted file mode 100644 index 9f2db859d5..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/FeatureTranslator.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.provider; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import javax.xml.namespace.QName; - -import net.opengis.ows.v_1_0_0.KeywordsType; -import net.opengis.ows.v_1_0_0.WGS84BoundingBoxType; -import net.opengis.wfs.v_1_1_0.FeatureTypeType; - -import com.raytheon.uf.edex.ogc.common.OgcGeoBoundingBox; -import com.raytheon.uf.edex.wfs.WfsFeatureType; -import com.raytheon.uf.edex.wfs.request.QualifiedName; - -/** - * - * @author bclement - * @version 1.0 - */ -public class FeatureTranslator { - - public List transform(List features) { - List rval = new ArrayList( - features.size()); - for (WfsFeatureType f : features) { - rval.add(transform(f)); - } - return rval; - } - - /** - * @param source - * @return - */ - public FeatureTypeType transform(WfsFeatureType from) { - FeatureTypeType fType = new FeatureTypeType(); - QName name = transform(from.getName()); - fType.setName(name); - fType.setTitle(from.getTitle()); - fType.setAbstract(from.getAbs()); - fType.setKeywords(getAsKeywordList(from.getKeywords())); - fType.setDefaultSRS(from.getDefaultSRS()); - fType.setOtherSRS(from.getOtherSRS()); - fType.setWGS84BoundingBox(getBBox(from.getBbox())); - return fType; - } - - protected QName transform(QualifiedName from) { - return new QName(from.getNamespace(), from.getName()); - } - - /** - * @param bbox - * @return - */ - private List getBBox(OgcGeoBoundingBox bbox) { - List rval = new LinkedList(); - WGS84BoundingBoxType to = new WGS84BoundingBoxType(); - List ur = new LinkedList(); - List ll = new LinkedList(); - ur.add(bbox.getMaxx()); - ur.add(bbox.getMaxy()); - ll.add(bbox.getMinx()); - ll.add(bbox.getMiny()); - to.setUpperCorner(ur); - to.setLowerCorner(ll); - rval.add(to); - return rval; - } - - protected List getAsKeywordList(List keywords) { - List rval = new LinkedList(); - if (keywords != null && !keywords.isEmpty()) { - KeywordsType kwType = new KeywordsType(); - kwType.setKeyword(keywords); - rval.add(kwType); - } - return rval; - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/QueryExpressionVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/QueryExpressionVisitor.java deleted file mode 100644 index 994f20ee5f..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/QueryExpressionVisitor.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.provider; - -import java.util.List; - -import net.opengis.filter.v_1_1_0.PropertyNameType; - -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.edex.wfs.filter.ExpressionProcessor; -import com.raytheon.uf.edex.wfs.filter.OgcExpressionVisitor; - -/** - * - * @author bclement - * @version 1.0 - */ -public class QueryExpressionVisitor implements OgcExpressionVisitor { - - protected IUFStatusHandler log = UFStatus.getHandler(this.getClass()); - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcExpressionVisitor#add(com.raytheon.uf. - * edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, java.lang.Object) - */ - @Override - public Object add(ExpressionProcessor left, ExpressionProcessor right, - Object obj) throws Exception { - throw new Exception("Unsupported expression: add"); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcExpressionVisitor#sub(com.raytheon.uf. - * edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, java.lang.Object) - */ - @Override - public Object sub(ExpressionProcessor left, ExpressionProcessor right, - Object obj) throws Exception { - throw new Exception("Unsupported expression: sub"); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcExpressionVisitor#mul(com.raytheon.uf. - * edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, java.lang.Object) - */ - @Override - public Object mul(ExpressionProcessor left, ExpressionProcessor right, - Object obj) throws Exception { - throw new Exception("Unsupported expression: mul"); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcExpressionVisitor#div(com.raytheon.uf. - * edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, java.lang.Object) - */ - @Override - public Object div(ExpressionProcessor left, ExpressionProcessor right, - Object obj) throws Exception { - throw new Exception("Unsupported expression: div"); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcExpressionVisitor#literal(java.util.List, - * java.lang.Object) - */ - @Override - public Object literal(List values, Object obj) throws Exception { - if (values.size() != 1) { - log.warn("Unsupported literal values: " + values.toArray()); - } - return values.get(0); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcExpressionVisitor#property(net.opengis - * .filter.v_1_1_0.PropertyNameType, java.lang.Object) - */ - @Override - public Object property(PropertyNameType prop, Object obj) throws Exception { - List content = prop.getContent(); - if (content.size() != 1) { - log.warn("Unsupported property name values: " + content.toArray()); - } - return content.get(0); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcExpressionVisitor#function(java.util.List, - * java.lang.String, java.lang.Object) - */ - @Override - public Object function(List expressions, String name, - Object obj) throws Exception { - throw new Exception("Unsupported expression type: function"); - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/QueryFilterVisitor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/QueryFilterVisitor.java deleted file mode 100644 index 4dd36e1dc0..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/QueryFilterVisitor.java +++ /dev/null @@ -1,507 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.provider; - -import java.util.AbstractMap.SimpleEntry; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map.Entry; - -import javax.xml.bind.JAXBElement; - -import net.opengis.filter.v_1_1_0.BBOXType; -import net.opengis.filter.v_1_1_0.BinarySpatialOpType; -import net.opengis.filter.v_1_1_0.DistanceBufferType; -import net.opengis.filter.v_1_1_0.PropertyIsLikeType; -import net.opengis.filter.v_1_1_0.PropertyIsNullType; -import net.opengis.gml.v_3_1_1.AbstractGeometryType; -import net.opengis.gml.v_3_1_1.EnvelopeType; - -import org.apache.commons.lang.StringUtils; -import org.geotools.geometry.jts.JTS; -import org.hibernate.criterion.Conjunction; -import org.hibernate.criterion.Criterion; -import org.hibernate.criterion.Disjunction; -import org.hibernate.criterion.Junction; -import org.hibernate.criterion.MatchMode; -import org.hibernate.criterion.Restrictions; -import org.hibernatespatial.criterion.SpatialRestrictions; - -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.edex.ogc.common.util.ConvertService; -import com.raytheon.uf.edex.wfs.filter.ExpressionProcessor; -import com.raytheon.uf.edex.wfs.filter.FilterProcessor; -import com.raytheon.uf.edex.wfs.filter.OgcFilterVisitor; -import com.raytheon.uf.edex.wfs.gml.EnvelopeConverter; -import com.raytheon.uf.edex.wfs.gml.GeometryConverter; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; - -/** - * - * @author bclement - * @version 1.0 - */ -public class QueryFilterVisitor implements OgcFilterVisitor { - - protected IUFStatusHandler log = UFStatus.getHandler(this.getClass()); - - protected GeometryConverter geomConverter = new GeometryConverter(); - - protected EnvelopeConverter envConverter = new EnvelopeConverter(); - - protected QueryExpressionVisitor exprVisitor = new QueryExpressionVisitor(); - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#equal(com.raytheon.uf.edex - * .filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, boolean, - * java.lang.Object) - */ - @Override - public Criterion equal(ExpressionProcessor left, ExpressionProcessor right, - boolean matchCase, Object obj) throws Exception { - VisitorBag bag = (VisitorBag) obj; - Entry e = getBinaryProps(left, right, bag); - return Restrictions.eq(e.getKey(), e.getValue()); - } - - protected Entry getBinaryProps(ExpressionProcessor left, - ExpressionProcessor right, VisitorBag bag) throws Exception { - String prop = (String) left.accept(exprVisitor, bag); - String value = (String) right.accept(exprVisitor, bag); - Class ent = bag.getRootEntity(); - String[] path = parseProp(prop); - Object val = ConvertService.get().convertAsType(value, ent, path); - String field = StringUtils.join(path, "."); - return new SimpleEntry(bag.filterField(field), val); - } - - protected String[] parseProp(String prop) { - // TODO we may want to keep the namespaces - String[] rval = prop.trim().split("\\/"); - for (int i = 0; i < rval.length; ++i) { - int index = rval[i].lastIndexOf(':'); - if (index > -1) { - rval[i] = rval[i].substring(index + 1); - } - } - return rval; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#notEqual(com.raytheon.uf - * .edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, boolean, - * java.lang.Object) - */ - @Override - public Criterion notEqual(ExpressionProcessor left, - ExpressionProcessor right, boolean matchCase, Object obj) - throws Exception { - VisitorBag bag = (VisitorBag) obj; - Entry e = getBinaryProps(left, right, bag); - return Restrictions.ne(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#lessThan(com.raytheon.uf - * .edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, boolean, - * java.lang.Object) - */ - @Override - public Criterion lessThan(ExpressionProcessor left, - ExpressionProcessor right, boolean matchCase, Object obj) - throws Exception { - VisitorBag bag = (VisitorBag) obj; - Entry e = getBinaryProps(left, right, bag); - return Restrictions.lt(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#greaterThan(com.raytheon - * .uf.edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, boolean, - * java.lang.Object) - */ - @Override - public Criterion greaterThan(ExpressionProcessor left, - ExpressionProcessor right, boolean matchCase, Object obj) - throws Exception { - VisitorBag bag = (VisitorBag) obj; - Entry e = getBinaryProps(left, right, bag); - return Restrictions.gt(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#greaterThanEqual(com.raytheon - * .uf.edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, boolean, - * java.lang.Object) - */ - @Override - public Criterion greaterThanEqual(ExpressionProcessor left, - ExpressionProcessor right, boolean matchCase, Object obj) - throws Exception { - VisitorBag bag = (VisitorBag) obj; - Entry e = getBinaryProps(left, right, bag); - return Restrictions.ge(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#lessThanEqual(com.raytheon - * .uf.edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, boolean, - * java.lang.Object) - */ - @Override - public Criterion lessThanEqual(ExpressionProcessor left, - ExpressionProcessor right, boolean matchCase, Object obj) - throws Exception { - VisitorBag bag = (VisitorBag) obj; - Entry e = getBinaryProps(left, right, bag); - return Restrictions.le(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#isLike(net.opengis.filter - * .v_1_1_0.PropertyIsLikeType, java.lang.Object) - */ - @Override - public Criterion isLike(PropertyIsLikeType op, Object obj) throws Exception { - // FIXME this is not correct, needs to take wildcard, anychar and - // escapes into account - VisitorBag bag = (VisitorBag) obj; - String prop = (String) op.getPropertyName().getContent().get(0); - String value = (String) op.getLiteral().getContent().get(0); - return Restrictions.like(bag.filterField(prop), value, - MatchMode.ANYWHERE); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#isNull(net.opengis.filter - * .v_1_1_0.PropertyIsNullType, java.lang.Object) - */ - @Override - public Criterion isNull(PropertyIsNullType op, Object obj) throws Exception { - VisitorBag bag = (VisitorBag) obj; - String field = (String) op.getPropertyName().getContent().get(0); - return Restrictions.isNull(bag.filterField(field)); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#between(com.raytheon.uf. - * edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, - * com.raytheon.uf.edex.filter.ExpressionProcessor, java.lang.Object) - */ - @Override - public Criterion between(ExpressionProcessor lower, - ExpressionProcessor exp, ExpressionProcessor upper, Object obj) - throws Exception { - VisitorBag bag = (VisitorBag) obj; - - Entry lowerPart = getBinaryProps(exp, lower, bag); - Entry upperPart = getBinaryProps(exp, upper, bag); - - return Restrictions.between(lowerPart.getKey(), lowerPart.getValue(), - upperPart.getValue()); - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.edex.filter.OgcFilterVisitor#and(java.util.List, - * java.lang.Object) - */ - @Override - public Criterion and(List filters, Object obj) - throws Exception { - Conjunction rval = Restrictions.conjunction(); - acceptAll(filters, obj, rval); - return rval; - } - - protected void acceptAll(List filters, Object obj, - Junction junc) throws Exception { - Iterator i = filters.iterator(); - while (i.hasNext()) { - junc.add((Criterion) i.next().accept(this, obj)); - } - } - - protected List addAll(List l1, List l2) { - if (l1 == null) { - return l2; - } - if (l2 == null) { - return l1; - } - ArrayList rval = new ArrayList(l1.size() + l2.size()); - rval.addAll(l1); - rval.addAll(l2); - return rval; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.edex.filter.OgcFilterVisitor#or(java.util.List, - * java.lang.Object) - */ - @Override - public Criterion or(List filters, Object obj) - throws Exception { - Disjunction rval = Restrictions.disjunction(); - acceptAll(filters, obj, rval); - return rval; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#not(com.raytheon.uf.edex - * .filter.FilterProcessor, java.lang.Object) - */ - @Override - public Criterion not(FilterProcessor filter, Object obj) throws Exception { - return Restrictions.not((Criterion) filter.accept(this, obj)); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#spatialEquals(net.opengis - * .filter.v_1_1_0.BinarySpatialOpType, java.lang.Object) - */ - @Override - public Criterion spatialEquals(BinarySpatialOpType op, Object obj) - throws Exception { - VisitorBag bag = (VisitorBag) obj; - Entry e = getBinarySpatial(op, bag); - return SpatialRestrictions - .eq(bag.filterField(e.getKey()), e.getValue()); - } - - protected Entry getBinarySpatial( - BinarySpatialOpType binary, VisitorBag bag) throws Exception { - List lst = binary.getPropertyName().getContent(); - String str = getStringWarn(lst, "Unsupported property name type"); - String prop = StringUtils.join(parseProp(str), '.'); - Geometry shape = getGeometry(binary); - return new SimpleEntry(bag.filterField(prop), shape); - } - - protected Geometry getGeometry(BinarySpatialOpType binary) throws Exception { - JAXBElement env = binary.getEnvelope(); - JAXBElement geom = binary.getGeometry(); - Geometry shape; - if (env != null && !env.isNil()) { - Envelope envelope = envConverter.convert(env.getValue()); - shape = geomConverter.convert(envelope); - } else if (geom != null && !geom.isNil()) { - shape = geomConverter.convert(geom.getValue()); - } else { - throw new Exception("Unsupported geometry format"); - } - return shape; - } - - protected String getStringWarn(List lst, String msg) { - if (lst.size() != 1) { - log.warn(msg); - } - return (String) lst.get(0); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#disjoint(net.opengis.filter - * .v_1_1_0.BinarySpatialOpType, java.lang.Object) - */ - @Override - public Criterion disjoint(BinarySpatialOpType op, Object obj) - throws Exception { - Entry e = getBinarySpatial(op, (VisitorBag) obj); - return SpatialRestrictions.disjoint(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#touches(net.opengis.filter - * .v_1_1_0.BinarySpatialOpType, java.lang.Object) - */ - @Override - public Criterion touches(BinarySpatialOpType op, Object obj) - throws Exception { - Entry e = getBinarySpatial(op, (VisitorBag) obj); - return SpatialRestrictions.touches(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#within(net.opengis.filter - * .v_1_1_0.BinarySpatialOpType, java.lang.Object) - */ - @Override - public Criterion within(BinarySpatialOpType op, Object obj) - throws Exception { - Entry e = getBinarySpatial(op, (VisitorBag) obj); - return SpatialRestrictions.within(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#overlaps(net.opengis.filter - * .v_1_1_0.BinarySpatialOpType, java.lang.Object) - */ - @Override - public Criterion overlaps(BinarySpatialOpType op, Object obj) - throws Exception { - Entry e = getBinarySpatial(op, (VisitorBag) obj); - return SpatialRestrictions.overlaps(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#crosses(net.opengis.filter - * .v_1_1_0.BinarySpatialOpType, java.lang.Object) - */ - @Override - public Criterion crosses(BinarySpatialOpType op, Object obj) - throws Exception { - Entry e = getBinarySpatial(op, (VisitorBag) obj); - return SpatialRestrictions.crosses(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#intersects(net.opengis.filter - * .v_1_1_0.BinarySpatialOpType, java.lang.Object) - */ - @Override - public Criterion intersects(BinarySpatialOpType op, Object obj) - throws Exception { - Entry e = getBinarySpatial(op, (VisitorBag) obj); - return SpatialRestrictions.intersects(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#contains(net.opengis.filter - * .v_1_1_0.BinarySpatialOpType, java.lang.Object) - */ - @Override - public Criterion contains(BinarySpatialOpType op, Object obj) - throws Exception { - Entry e = getBinarySpatial(op, (VisitorBag) obj); - return SpatialRestrictions.contains(e.getKey(), e.getValue()); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#dWithin(net.opengis.filter - * .v_1_1_0.DistanceBufferType, java.lang.Object) - */ - @Override - public Object dWithin(DistanceBufferType op, Object obj) throws Exception { - throw new Exception("dWithin queries not supported"); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#beyond(net.opengis.filter - * .v_1_1_0.DistanceBufferType, java.lang.Object) - */ - @Override - public Object beyond(DistanceBufferType op, Object obj) throws Exception { - throw new Exception("Beyond queries not supported"); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.filter.OgcFilterVisitor#bbox(net.opengis.filter. - * v_1_1_0.BBOXType, java.lang.Object) - */ - @Override - public Criterion bbox(BBOXType op, Object obj) throws Exception { - VisitorBag bag = (VisitorBag) obj; - List lst = op.getPropertyName().getContent(); - String str = getStringWarn(lst, "Unsupported property name type"); - String prop = StringUtils.join(parseProp(str), '.'); - EnvelopeType value = op.getEnvelope().getValue(); - Envelope env = envConverter.convert(value); - return SpatialRestrictions.within(bag.filterField(prop), - JTS.toGeometry(env)); - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/SimpleFilterHandler.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/SimpleFilterHandler.java deleted file mode 100644 index a59510ad0e..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/SimpleFilterHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.wfs.provider; - -import org.geotools.filter.FilterHandler; -import org.opengis.filter.Filter; -import org.xml.sax.helpers.DefaultHandler; - -/** - * @author bclement - * - */ -public class SimpleFilterHandler extends DefaultHandler implements - FilterHandler { - - private Filter filter; - - public void filter(Filter filter) { - this.filter = filter; - } - - public Filter getFilter() { - return filter; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/SqlQueryParts.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/SqlQueryParts.java deleted file mode 100644 index d094667d4e..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/SqlQueryParts.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright 09/24/12 Raytheon Company. - * - * Unlimited Rights - * This software was developed pursuant to Contract Number - * DTFAWA-10-D-00028 with the US Government. The US Government’s rights - * in and to this copyrighted software are as specified in DFARS - * 252.227-7014 which was made part of the above contract. - */ - -package com.raytheon.uf.edex.wfs.provider; - -public class SqlQueryParts { - -} diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/VisitorBag.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/VisitorBag.java index fc0694ca52..6861fd55d8 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/VisitorBag.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/VisitorBag.java @@ -23,6 +23,18 @@ import java.util.Map; /** + * Visitor pattern carry-on that allows for plugin specific configuration to be + * used by filter parser + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 22, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/AbstractWfsSource.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/AbstractWfsSource.java index 5f11d48396..078bea45f8 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/AbstractWfsSource.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/AbstractWfsSource.java @@ -48,8 +48,19 @@ import com.raytheon.uf.edex.wfs.request.SortBy; /** * Abstract base class for WFS sources * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * May 9, 2012            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 + * @param */ public abstract class AbstractWfsSource extends AbstractOgcSource implements IWfsSource { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IFeatureTypeModifier.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IFeatureTypeModifier.java index 8bd9c24a8e..5b85e8de0a 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IFeatureTypeModifier.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IFeatureTypeModifier.java @@ -14,7 +14,7 @@ import java.util.List; import com.raytheon.uf.edex.wfs.WfsFeatureType; /** - * TODO Add Description + * Interface for modifying WFS feature type metadata * *
  * 
diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IPdoGmlTranslator.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IPdoGmlTranslator.java
index 4a6f899a1d..95e3dcda60 100644
--- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IPdoGmlTranslator.java
+++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IPdoGmlTranslator.java
@@ -26,6 +26,17 @@ import javax.xml.bind.JAXBElement;
 import com.raytheon.uf.common.dataplugin.PluginDataObject;
 
 /**
+ * Interface for converting data records to GML jaxb objects
+ * 
+ * 
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 26, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsRegistry.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsRegistry.java index c57c2e2041..859f868436 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsRegistry.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsRegistry.java @@ -30,8 +30,20 @@ package com.raytheon.uf.edex.wfs.reg; import com.raytheon.uf.common.util.registry.RegistryException; /** - * @author bclement + * Spring registry for plugin specific WFS sources * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public interface IWfsRegistry { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsSource.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsSource.java index 77e0c9cd11..75f7cc4a02 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsSource.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsSource.java @@ -36,7 +36,18 @@ import com.raytheon.uf.edex.wfs.request.QualifiedName; /** * Source interface for WFS data adapters * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement + * @version 1.0 */ public interface IWfsSource { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsTranslator.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsTranslator.java index a773c8cfc9..56aa15223b 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsTranslator.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/IWfsTranslator.java @@ -37,6 +37,17 @@ import net.opengis.gml.v_3_1_1.AbstractFeatureType; import com.raytheon.uf.common.dataplugin.PluginDataObject; /** + * Interface for converting data records to JAXB objects + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/PluginWfsSource.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/PluginWfsSource.java index 76b09c3d4c..2bac76c33b 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/PluginWfsSource.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/PluginWfsSource.java @@ -44,6 +44,16 @@ import com.raytheon.uf.edex.wfs.request.QualifiedName; /** * Abstract implementation for sources backed by plugin data objects * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 26, 2011            bclement     Initial creation
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/WfsRegistryImpl.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/WfsRegistryImpl.java index ef2ca0fc21..cdfbddf64f 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/WfsRegistryImpl.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/reg/WfsRegistryImpl.java @@ -51,6 +51,17 @@ import com.raytheon.uf.edex.wfs.request.QualifiedName; /** * Wfs registry implementation. Handles wfs sources and the JAXB context * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 11, 2011            bclement     Initial creation        
+ * May 30, 2013   753      dhladky      reverted to original
+ * 
+ * 
+ * * @author bclement * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/DescFeatureTypeReq.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/DescFeatureTypeReq.java index 30bc03f2ee..ff5335cee0 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/DescFeatureTypeReq.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/DescFeatureTypeReq.java @@ -28,8 +28,20 @@ import javax.xml.namespace.QName; import net.opengis.wfs.v_1_1_0.DescribeFeatureTypeType; /** - * @author bclement + * Request wrapper for WFS describe feature type request * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * April 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class DescFeatureTypeReq extends WfsRequest { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/DescQueryReq.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/DescQueryReq.java index fb38e0fd75..42e954f679 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/DescQueryReq.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/DescQueryReq.java @@ -15,20 +15,20 @@ import java.util.List; import net.opengis.wfs.v_2_0_0.DescribeStoredQueriesType; /** - * TODO Add Description + * Request wrapper for WFS describe stored query request * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 8, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class DescQueryReq extends WfsRequest { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/FeatureQuery.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/FeatureQuery.java index 6659105691..d53d97cdf9 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/FeatureQuery.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/FeatureQuery.java @@ -28,12 +28,24 @@ import javax.xml.namespace.QName; import net.opengis.filter.v_2_0_0.FilterType; import net.opengis.wfs.v_2_0_0.QueryType; -import com.raytheon.uf.edex.wfs.request.SortBy.Order; import com.raytheon.uf.edex.ogc.common.OgcTimeRange; +import com.raytheon.uf.edex.wfs.request.SortBy.Order; /** - * @author bclement + * Wrapper object for WFS feature query information from a get feature request * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * April 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class FeatureQuery { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetCapReq.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetCapReq.java index fc34df9ad5..17c30cf763 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetCapReq.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetCapReq.java @@ -22,8 +22,20 @@ package com.raytheon.uf.edex.wfs.request; import net.opengis.wfs.v_1_1_0.GetCapabilitiesType; /** - * @author bclement + * Request wrapper for WFS get capabilities request * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * April 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class GetCapReq extends WfsRequest { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetFeatureReq.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetFeatureReq.java index 819d35471d..0bd73f38ec 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetFeatureReq.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetFeatureReq.java @@ -44,8 +44,20 @@ import com.raytheon.uf.edex.wfs.request.FeatureQuery.QFilterType; import com.raytheon.uf.edex.wfs.request.SortBy.Order; /** - * @author bclement + * Wrapper for WFS get feature request * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * April 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class GetFeatureReq extends WfsRequest { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetPropValueReq.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetPropValueReq.java index c69292be1a..9630c5b1d4 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetPropValueReq.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/GetPropValueReq.java @@ -10,20 +10,20 @@ package com.raytheon.uf.edex.wfs.request; /** - * TODO Add Description + * Wrapper for WFS get property value request * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 21, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class GetPropValueReq extends WfsRequest { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/ListQueriesReq.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/ListQueriesReq.java index 7732e0271d..00841859a6 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/ListQueriesReq.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/ListQueriesReq.java @@ -11,20 +11,20 @@ package com.raytheon.uf.edex.wfs.request; /** - * TODO Add Description + * Wrapper for WFS list stored queries request * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 8, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class ListQueriesReq extends WfsRequest { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/QualifiedName.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/QualifiedName.java index 8358a6d5e7..a489e1e9d7 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/QualifiedName.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/QualifiedName.java @@ -22,8 +22,20 @@ package com.raytheon.uf.edex.wfs.request; import javax.xml.namespace.QName; /** - * @author bclement + * Object representing an XML qualified name. Should be replaced with QName * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * April 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class QualifiedName { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/SortBy.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/SortBy.java index 16d199615e..2ca7f0c067 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/SortBy.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/SortBy.java @@ -20,8 +20,20 @@ package com.raytheon.uf.edex.wfs.request; /** - * @author bclement + * Object containing sort information from a WFS get feature request * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * April 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class SortBy { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/TransReq.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/TransReq.java index d9636a79c1..1d8741e29f 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/TransReq.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/TransReq.java @@ -24,8 +24,20 @@ import net.opengis.wfs.v_1_1_0.TransactionType; import com.raytheon.uf.edex.wfs.reg.Unique; /** - * @author bclement + * Wrapper for WFS transaction request * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * April 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 */ public class TransReq extends WfsRequest { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/WfsRequest.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/WfsRequest.java index dd878be180..f7c1114d0a 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/WfsRequest.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/request/WfsRequest.java @@ -22,6 +22,22 @@ package com.raytheon.uf.edex.wfs.request; import com.raytheon.uf.edex.ogc.common.OgcResponse; import com.raytheon.uf.edex.ogc.common.http.MimeType; +/** + * Abstract base for WFS request wrappers + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 22, 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ public class WfsRequest { public enum Type { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/Wfs.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/Wfs.java index 9296fb889f..834b218776 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/Wfs.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/Wfs.java @@ -47,14 +47,24 @@ import org.apache.cxf.interceptor.InInterceptors; import com.raytheon.uf.edex.ogc.common.soap.ServiceExceptionReport; import com.raytheon.uf.edex.wfs.soap2_0_0.util.DescribeFeatureTypeResponseType; -/* SOFTWARE HISTORY -* Date Ticket# Engineer Description -* ------------ ---------- ----------- -------------------------- -* unknown bclements Initial creation -* 10/22/2013 2472 dhladky removed FAA dependencies, fixed path for CXFlogger. -*
-*/ +/** + * SOAP endpoint interface for WFS 2.0 + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 9, 2012            bclement     Initial creation
+ * 10/22/2013   2472        dhladky     removed FAA dependencies, fixed path for CXFlogger.
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ @GZIP @InInterceptors(interceptors = "com.raytheon.uf.edex.log.cxf.CXFLogger") @WebService(name = "wfs", targetNamespace = "http://www.opengis.net/wfs/requests/2.0") diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/WfsImpl.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/WfsImpl.java index ff608a4915..65e64a97fe 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/WfsImpl.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/WfsImpl.java @@ -53,20 +53,20 @@ import com.raytheon.uf.edex.wfs.soap2_0_0.util.DescribeFeatureTypeResponseType; import com.raytheon.uf.edex.wfs.v2_0_0.Wfs2_0_0Provider; /** - * TODO Add Description + * SOAP endpoint implementation for WFS 2.0 * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 9, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class WfsImpl extends AbstractOwsService implements Wfs { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/WfsTransientAnnotationReader.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/WfsTransientAnnotationReader.java index 97324c8660..a4c9f5f60f 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/WfsTransientAnnotationReader.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/WfsTransientAnnotationReader.java @@ -14,19 +14,21 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.edex.ogc.common.jaxb.TransientAnnotationReader; /** + * Adds transient annotations to external classes used by WFS so they can be + * marshalled in the SOAP response * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Nov 21, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class WfsTransientAnnotationReader extends TransientAnnotationReader { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/util/DescribeFeatureTypeResponseType.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/util/DescribeFeatureTypeResponseType.java index 7779b7baf3..34696b61fb 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/util/DescribeFeatureTypeResponseType.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/soap2_0_0/util/DescribeFeatureTypeResponseType.java @@ -17,20 +17,20 @@ import javax.xml.bind.annotation.XmlRootElement; import org.w3.xmlschema.Schema; /** - * TODO Add Description + * SOAP response for WFS 2.0 describe feature type operation * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 10, 2012            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/util/JaxbTransUtil.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/util/JaxbTransUtil.java index 1f8d7d75b5..d3441c80f6 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/util/JaxbTransUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/util/JaxbTransUtil.java @@ -34,6 +34,17 @@ import net.opengis.gml.v_3_1_1.PointType; import com.vividsolutions.jts.geom.Point; /** + * Utility methods for creating JAXB objects for GML + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 15, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Capabilities.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Capabilities.java index 214fbfa941..f019f9739f 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Capabilities.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Capabilities.java @@ -61,12 +61,23 @@ import com.raytheon.uf.edex.ogc.common.OgcOperationInfo; import com.raytheon.uf.edex.ogc.common.OgcServiceInfo; import com.raytheon.uf.edex.ogc.common.feature.GmlUtils; import com.raytheon.uf.edex.ogc.common.http.MimeType; -import com.raytheon.uf.edex.wfs.WfsException; import com.raytheon.uf.edex.wfs.IWfsProvider.WfsOpType; +import com.raytheon.uf.edex.wfs.WfsException; import com.raytheon.uf.edex.wfs.reg.WfsRegistryImpl; import com.raytheon.uf.edex.wfs.request.GetCapReq; /** + * Utility class for creating capabilities documents for WFS 1.1.0 + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 29, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/FeatureTranslator.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/FeatureTranslator.java index 5ab08d0feb..0f0ec1de22 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/FeatureTranslator.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/FeatureTranslator.java @@ -34,6 +34,17 @@ import com.raytheon.uf.edex.wfs.WfsFeatureType; import com.raytheon.uf.edex.wfs.request.QualifiedName; /** + * Converts feature type metadata objects to WFS 1.1.0 feature type jaxb objects + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 27, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/Transactor.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Transactor.java similarity index 91% rename from edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/Transactor.java rename to edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Transactor.java index 5fde6c2c61..108b77d320 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/provider/Transactor.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Transactor.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.edex.wfs.provider; +package com.raytheon.uf.edex.wfs.v1_1_0; import java.math.BigInteger; import java.util.Iterator; @@ -30,6 +30,17 @@ import net.opengis.wfs.v_1_1_0.TransactionSummaryType; import com.raytheon.uf.edex.wfs.request.TransReq; /** + * Handles transaction requests for WFS 1.1.0 + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 29, 2011            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Wfs1_1_0Provider.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Wfs1_1_0Provider.java index 2beb6bf41a..dc83c42ebf 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Wfs1_1_0Provider.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v1_1_0/Wfs1_1_0Provider.java @@ -19,7 +19,6 @@ **/ package com.raytheon.uf.edex.wfs.v1_1_0; -import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.math.BigInteger; @@ -68,7 +67,6 @@ import com.raytheon.uf.edex.wfs.provider.AbstractWfsProvider; import com.raytheon.uf.edex.wfs.provider.FeatureDescriber; import com.raytheon.uf.edex.wfs.provider.FeatureFetcher.CountedFeatures; import com.raytheon.uf.edex.wfs.provider.Gml31FeatureFetcher; -import com.raytheon.uf.edex.wfs.provider.Transactor; import com.raytheon.uf.edex.wfs.reg.WfsRegistryImpl; import com.raytheon.uf.edex.wfs.request.DescFeatureTypeReq; import com.raytheon.uf.edex.wfs.request.FeatureQuery; @@ -81,6 +79,22 @@ import com.raytheon.uf.edex.wfs.request.WfsRequest; import com.raytheon.uf.edex.wfs.request.WfsRequest.Type; import com.raytheon.uf.edex.wfs.soap2_0_0.util.DescribeFeatureTypeResponseType; +/** + * WFS 1.1.0 implementation + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 22, 2011            bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ public class Wfs1_1_0Provider extends AbstractWfsProvider { protected final IUFStatusHandler log = UFStatus.getHandler(this.getClass()); @@ -166,17 +180,6 @@ public class Wfs1_1_0Provider extends AbstractWfsProvider { return resp; } - /** - * Read input stream to string - * - * @param in - * @return - * @throws IOException - */ - protected String getXml(InputStream in) throws IOException { - return new java.util.Scanner(in).useDelimiter("\\A").next(); - } - /** * Decode post request from input stream * diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/Capabilities.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/Capabilities.java index a7c5625f91..a1a7af2c2d 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/Capabilities.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/Capabilities.java @@ -59,12 +59,23 @@ import com.raytheon.uf.edex.ogc.common.OgcOperationInfo; import com.raytheon.uf.edex.ogc.common.OgcServiceInfo; import com.raytheon.uf.edex.ogc.common.feature.GmlUtils; import com.raytheon.uf.edex.ogc.common.http.MimeType; -import com.raytheon.uf.edex.wfs.WfsException; import com.raytheon.uf.edex.wfs.IWfsProvider.WfsOpType; +import com.raytheon.uf.edex.wfs.WfsException; import com.raytheon.uf.edex.wfs.reg.WfsRegistryImpl; import com.raytheon.uf.edex.wfs.request.GetCapReq; /** + * Utility class for creating capabilities documents for WFS 2.0 + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/FeatureTranslator.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/FeatureTranslator.java index 9252d95f43..278e5d588c 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/FeatureTranslator.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/FeatureTranslator.java @@ -38,6 +38,17 @@ import com.raytheon.uf.edex.wfs.WfsFeatureType; import com.raytheon.uf.edex.wfs.request.QualifiedName; /** + * Converts feature type metadata objects to WFS 2.0 feature type jaxb objects + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
+ * 
+ * 
* * @author bclement * @version 1.0 diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/Wfs2_0_0Provider.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/Wfs2_0_0Provider.java index c5004d4384..3cb0c191c0 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/Wfs2_0_0Provider.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/Wfs2_0_0Provider.java @@ -19,7 +19,6 @@ **/ package com.raytheon.uf.edex.wfs.v2_0_0; -import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.math.BigInteger; @@ -110,21 +109,21 @@ import com.raytheon.uf.edex.wfs.soap2_0_0.util.DescribeFeatureTypeResponseType; import com.raytheon.uf.edex.wfs.util.XMLGregorianCalendarConverter; /** - * TODO Add Description - * - * @author bclement - * @version 1.0 + * WFS 2.0 implementation + * + *
  * 
- *  * 
- *
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
+ * Oct 17, 2012            bclement     Initial creation
  * Sep 18, 2013 #411       skorolev    Added required RESPONSE METADATA
- *
+ * 
  * 
* + * @author bclement + * @version 1.0 */ public class Wfs2_0_0Provider extends AbstractWfsProvider implements IStoredQueryCallback { @@ -228,16 +227,6 @@ public class Wfs2_0_0Provider extends AbstractWfsProvider implements return resp; } - /** - * Read input stream to string - * - * @param in - * @return - * @throws IOException - */ - protected String getXml(InputStream in) throws IOException { - return new java.util.Scanner(in).useDelimiter("\\A").next(); - } /** * Decode post request from input stream diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/WfsOperationsDescriber.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/WfsOperationsDescriber.java index 75dcb35d1e..8b26da8323 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/WfsOperationsDescriber.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/v2_0_0/WfsOperationsDescriber.java @@ -21,20 +21,20 @@ import com.raytheon.uf.edex.ogc.common.OgcServiceInfo; import com.raytheon.uf.edex.wfs.IWfsProvider.WfsOpType; /** - * TODO Add Description + * Produces operations metadata for WFS 2.0 capabilities document * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 21, 2013            bclement     Initial creation
- *
+ * 
  * 
- * + * * @author bclement - * @version 1.0 + * @version 1.0 */ public class WfsOperationsDescriber extends AbstractOpDescriber { diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/AbstractWxxm32Translator.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/AbstractWxxm32Translator.java index 35db8b1cee..e27de452c0 100644 --- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/AbstractWxxm32Translator.java +++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/AbstractWxxm32Translator.java @@ -79,7 +79,7 @@ import com.raytheon.uf.edex.wfs.request.QualifiedName; import com.vividsolutions.jts.geom.Geometry; /** - * TODO Add Description + * Abstract base for translation between data records and WXXM GML JAXB objects * *
  * 
diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/IPdoWxxmTranslator.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/IPdoWxxmTranslator.java
index 59749ff713..0d7c96ee53 100644
--- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/IPdoWxxmTranslator.java
+++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/IPdoWxxmTranslator.java
@@ -16,7 +16,7 @@ import com.raytheon.uf.edex.wfs.WfsFeatureType;
 import com.raytheon.uf.edex.wfs.reg.IPdoGmlTranslator;
 
 /**
- * TODO Add Description
+ * Interface for translating between data records and WXXM GML JAXB objects
  * 
  * 
  * 
diff --git a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/WxxmWfsSource.java b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/WxxmWfsSource.java
index 0f18f6d05a..c31a5ee740 100644
--- a/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/WxxmWfsSource.java
+++ b/edexOsgi/com.raytheon.uf.edex.wfs/src/com/raytheon/uf/edex/wfs/wxxm/WxxmWfsSource.java
@@ -28,7 +28,7 @@ import com.raytheon.uf.edex.wfs.reg.PluginWfsSource;
 import com.raytheon.uf.edex.wfs.request.QualifiedName;
 
 /**
- * TODO Add Description
+ * Abstract base for WFS sources that produce WXXM feature types
  * 
  * 
  *