@Override public Object parse(String value) throws Exception { RangeSubsetParser parser = new RangeSubsetParser(new StringReader(value)); SimpleNode root = parser.RangeSubset(); RangeSubsetType result = (RangeSubsetType) root.jjtAccept(new RangeSubsetKvpParserVisitor(), null); for (Iterator it = result.getFieldSubset().iterator(); it.hasNext();) { FieldSubsetType type = (FieldSubsetType) it.next(); String interpolationType = type.getInterpolationType(); if(interpolationType != null) { try { InterpolationMethod method = InterpolationMethod.valueOf(interpolationType); } catch(IllegalArgumentException e) { throw new WcsException("Unknown interpolation method " + interpolationType, InvalidParameterValue, "RangeSubset"); } } } return result; }
@Override public Object parse(String value) throws Exception { RangeSubsetParser parser = new RangeSubsetParser(new StringReader(value)); SimpleNode root = parser.RangeSubset(); RangeSubsetType result = (RangeSubsetType) root.jjtAccept(new RangeSubsetKvpParserVisitor(), null); for (Iterator it = result.getFieldSubset().iterator(); it.hasNext(); ) { FieldSubsetType type = (FieldSubsetType) it.next(); String interpolationType = type.getInterpolationType(); if (interpolationType != null) { try { InterpolationMethod method = InterpolationMethod.valueOf(interpolationType); } catch (IllegalArgumentException e) { throw new WcsException( "Unknown interpolation method " + interpolationType, InvalidParameterValue, "RangeSubset"); } } } return result; }
String interpolation = field.getInterpolationType(); if (interpolation != null) { boolean interpolationSupported = false;
String interpolation = field.getInterpolationType(); if (interpolation != null) { boolean interpolationSupported = false;
@Test public void testSimpleFields() throws Exception { RangeSubsetType rs = (RangeSubsetType) parser.parse("radiance;temperature"); assertNotNull(rs); assertEquals(2, rs.getFieldSubset().size()); FieldSubsetType field = (FieldSubsetType) rs.getFieldSubset().get(0); assertEquals("radiance", field.getIdentifier().getValue()); assertEquals(null, field.getInterpolationType()); field = (FieldSubsetType) rs.getFieldSubset().get(1); assertEquals("temperature", field.getIdentifier().getValue()); assertEquals(null, field.getInterpolationType()); }
@Test public void testInterpolation() throws Exception { RangeSubsetType rs = (RangeSubsetType) parser.parse("radiance:linear;temperature:nearest"); assertNotNull(rs); assertEquals(2, rs.getFieldSubset().size()); FieldSubsetType field = (FieldSubsetType) rs.getFieldSubset().get(0); assertEquals("radiance", field.getIdentifier().getValue()); assertEquals("linear", field.getInterpolationType()); field = (FieldSubsetType) rs.getFieldSubset().get(1); assertEquals("temperature", field.getIdentifier().getValue()); assertEquals("nearest", field.getInterpolationType()); }
interpolationType = field.getInterpolationType();
assertEquals("Red_band", keys.get(0)); assertEquals(field.getInterpolationType(), interpolation);
interpolationType = field.getInterpolationType();
FieldSubsetType field = (FieldSubsetType) gc.getRangeSubset().getFieldSubset().get(0); assertEquals("BlueMarble", field.getIdentifier().getValue()); assertEquals("bicubic", field.getInterpolationType()); assertEquals(1, field.getAxisSubset().size()); AxisSubsetType axis = (AxisSubsetType) field.getAxisSubset().get(0);