public static CodeType code(CodeType value) { return code(value.getValue()); }
: ((LanguageStringType) serviceType.getTitle().get(0)).getValue(); setTitle(title); setName(serviceType.getServiceType().getValue());
matrixSet.setCRS(tm.getSupportedCRS()); matrixSet.setWellKnownScaleSet(tm.getWellKnownScaleSet()); matrixSet.setIdentifier(tm.getIdentifier().getValue()); if (tm.getBoundingBox() != null) { matrixSet.setBbox(bbox2bbox(tm.getBoundingBox())); TileMatrix matrix = new TileMatrix(); matrix.setIdentifier(mat.getIdentifier().getValue()); matrix.setDenominator(mat.getScaleDenominator()); matrix.setMatrixHeight(mat.getMatrixHeight().intValue()); throw new ServiceException( "MatrixSet " + tm.getIdentifier().getValue() + ": unable to create CRS " + matrixSet.getCrs());
private WMTSLayer parseLayer(LayerType layerType) { String title = ((LanguageStringType) layerType.getTitle().get(0)).getValue(); WMTSLayer layer = new WMTSLayer(title); layer.setName(layerType.getIdentifier().getValue()); for (StyleType styleType : styles) { StyleImpl style = new StyleImpl(); style.setName(styleType.getIdentifier().getValue()); StringBuilder t = new StringBuilder(); for (Object title1 : styleType.getTitle()) { for (DimensionType dimensionType : dimensionList) { CodeType identifierType = dimensionType.getIdentifier(); String dimIdentifier = identifierType.getValue(); String dimDefault = dimensionType.getDefault();
public AbstractInputProvider(InputType input, ProcessParameterIO ppio) { this.input = input; this.ppio = ppio; this.inputId = input.getIdentifier().getValue(); }
public SimpleInputProvider(InputType input, ProcessParameterIO ppio, WPSExecutionManager executor, ApplicationContext context) { this.input = input; this.ppio = ppio; this.context = context; this.executor = executor; this.inputId = input.getIdentifier().getValue(); }
public String getAttachmentFileName(Object value, Operation operation) { final GetCoverageType request = (GetCoverageType) operation.getParameters()[0]; final String identifier = request.getIdentifier().getValue(); return identifier.replace(':', '_') + ".eml"; }
@Override public String[][] getHeaders(Object value, Operation operation) throws ServiceException { final GetCoverageType request = (GetCoverageType) operation.getParameters()[0]; final String identifier = request.getIdentifier().getValue(); return new String[][] { { "Content-Disposition", "attachment;filename=\"" + identifier.replace(':', '_') + ".eml\"" } }; }
/** * Display custom process function, a process function that was read from GeoServer. * * @param selectedValue the selected value */ private void displayCustomProcessFunction(String selectedValue) { ProcessBriefType selectedFunction = null; for (ProcessBriefType function : availableFunctionList) { if (function.getIdentifier().getValue().compareTo(selectedValue) == 0) { selectedFunction = function; break; } } functionParameterTableModel.populate(selectedFunction); }
public WMTSService(ServiceIdentificationType serviceType) { String title = serviceType.getTitle().isEmpty() ? "N/A" : ((LanguageStringType) serviceType.getTitle().get(0)).getValue(); setTitle(title); setName(serviceType.getServiceType().getValue()); List<String> retList = new ArrayList<>(); for (Object okti : serviceType.getKeywords()) { KeywordsTypeImpl kti = (KeywordsTypeImpl) okti; for (Object olsti : kti.getKeyword()) { LanguageStringTypeImpl lsti = (LanguageStringTypeImpl) olsti; retList.add(lsti.getValue()); } } setKeywordList(retList.toArray(new String[retList.size()])); } }
@Override protected void qualifyRequest( WorkspaceInfo ws, PublishedInfo l, Operation operation, Request request) { GetCapabilitiesType caps = parameter(operation, GetCapabilitiesType.class); if (caps != null) { return; } DescribeCoverageType dcov = parameter(operation, DescribeCoverageType.class); if (dcov != null) { qualifyLayerNames(dcov.getIdentifier(), ws); return; } GetCoverageType gcov = parameter(operation, GetCoverageType.class); if (gcov != null) { if (gcov.getIdentifier() != null && gcov.getIdentifier().getValue() != null) { gcov.getIdentifier().setValue(qualifyName(gcov.getIdentifier().getValue(), ws)); } } } }
@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()); }
private Object decodeInputData(final InputType input) { Object output = null; DataType data = input.getData(); String parameterName = input.getIdentifier().getValue(); Parameter<?> parameter = this.inputParameters.get(parameterName); try { if (null != data.getLiteralData()) { output = this.decodeLiteralData(data.getLiteralData(), parameter.type); } if (null != data.getComplexData()) { output = this.decodeComplexData(data.getComplexData(), parameter.type); } } catch (Exception e) { throw new WPSException("InvalidParameterValue", parameterName); } if (null != data.getBoundingBoxData()) { // Parse bounding box data throw new WPSException("NoApplicableCode", "Unimplemented"); } return output; }
@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()); }
public void testAxisKeys() throws Exception { RangeSubsetType rs = (RangeSubsetType) parser.parse("radiance[bands[Red,Green,Blue]]"); assertNotNull(rs); assertEquals(1, rs.getFieldSubset().size()); FieldSubsetType field = (FieldSubsetType) rs.getFieldSubset().get(0); assertEquals("radiance", field.getIdentifier().getValue()); assertEquals(1, field.getAxisSubset().size()); AxisSubsetType axis = (AxisSubsetType) field.getAxisSubset().get(0); assertEquals("bands", axis.getIdentifier()); List keys = axis.getKey(); assertEquals(3, keys.size()); assertEquals("Red", keys.get(0)); assertEquals("Green", keys.get(1)); assertEquals("Blue", keys.get(2)); } }
@Test public void testAxisSingleKey() throws Exception { RangeSubsetType rs = (RangeSubsetType) parser.parse("radiance[bands[Red]]"); assertNotNull(rs); assertEquals(1, rs.getFieldSubset().size()); FieldSubsetType field = (FieldSubsetType) rs.getFieldSubset().get(0); assertEquals("radiance", field.getIdentifier().getValue()); assertEquals(1, field.getAxisSubset().size()); AxisSubsetType axis = (AxisSubsetType) field.getAxisSubset().get(0); assertEquals("bands", axis.getIdentifier()); List keys = axis.getKey(); assertEquals(1, keys.size()); assertEquals("Red", keys.get(0)); }
@Test public void testBasic() throws Exception { Map<String, Object> raw = baseMap(); final String layerId = getLayerId(TASMANIA_BM); raw.put("identifier", layerId); raw.put("format", "image/tiff"); raw.put("BoundingBox", "-45,146,-42,147"); raw.put("store", "false"); raw.put("GridBaseCRS", "urn:ogc:def:crs:EPSG:6.6:4326"); GetCoverageType getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw); assertEquals(layerId, getCoverage.getIdentifier().getValue()); assertEquals("image/tiff", getCoverage.getOutput().getFormat()); assertFalse(getCoverage.getOutput().isStore()); assertEquals( "urn:ogc:def:crs:EPSG:6.6:4326", getCoverage.getOutput().getGridCRS().getGridBaseCRS()); }