Search in sources :

Example 1 with OutputType

use of org.geotoolkit.wcs.xml.v100.OutputType in project geotoolkit by Geomatys.

the class WcsXMLBindingTest method marshallingTest100.

/**
 * Test simple Record Marshalling.
 *
 * @throws JAXBException
 */
@Test
public void marshallingTest100() throws JAXBException, IOException, ParserConfigurationException, SAXException {
    GetCoverageType getCoverage = new GetCoverageType("source1", null, null, "nearest neighbor", new OutputType("image/png", "EPSG:4326"));
    StringWriter sw = new StringWriter();
    marshaller.marshal(getCoverage, sw);
    String result = sw.toString();
    String expResult = "<wcs:GetCoverage version=\"1.0.0\" service=\"WCS\" " + "xmlns:wcs=\"http://www.opengis.net/wcs\">" + '\n' + "    <wcs:sourceCoverage>source1</wcs:sourceCoverage>" + '\n' + "    <wcs:interpolationMethod>nearest neighbor</wcs:interpolationMethod>" + '\n' + "    <wcs:output>" + '\n' + "        <wcs:crs>EPSG:4326</wcs:crs>" + '\n' + "        <wcs:format>image/png</wcs:format>" + '\n' + "    </wcs:output>" + '\n' + "</wcs:GetCoverage>" + '\n';
    assertXmlEquals(expResult, result, "xmlns:*");
}
Also used : GetCoverageType(org.geotoolkit.wcs.xml.v100.GetCoverageType) StringWriter(java.io.StringWriter) OutputType(org.geotoolkit.wcs.xml.v100.OutputType)

Example 2 with OutputType

use of org.geotoolkit.wcs.xml.v100.OutputType in project geotoolkit by Geomatys.

the class WcsXMLBindingTest method marshallingTest111.

/**
 * Test simple Record Marshalling.
 *
 * @throws JAXBException
 */
@Test
public void marshallingTest111() throws JAXBException, IOException, ParserConfigurationException, SAXException {
    org.geotoolkit.wcs.xml.v111.RangeSubsetType.FieldSubset field = new org.geotoolkit.wcs.xml.v111.RangeSubsetType.FieldSubset("id1", "NEAREST");
    org.geotoolkit.wcs.xml.v111.RangeSubsetType dsub = new org.geotoolkit.wcs.xml.v111.RangeSubsetType(Arrays.asList(field));
    org.geotoolkit.wcs.xml.v111.GetCoverageType getCoverage = new org.geotoolkit.wcs.xml.v111.GetCoverageType(new CodeType("source1"), null, dsub, new org.geotoolkit.wcs.xml.v111.OutputType(null, "EPSG:4326"));
    StringWriter sw = new StringWriter();
    marshaller.marshal(getCoverage, sw);
    String result = sw.toString();
    String expResult = "<ns5:GetCoverage version=\"1.1.1\" service=\"WCS\"" + " xmlns:ns5=\"http://www.opengis.net/wcs/1.1.1\"" + " xmlns:ows=\"http://www.opengis.net/ows/1.1\">" + '\n' + "    <ows:Identifier>source1</ows:Identifier>" + '\n' + "    <ns5:RangeSubset>" + '\n' + "        <ns5:FieldSubset>" + '\n' + "            <ows:Identifier>id1</ows:Identifier>" + '\n' + "            <ns5:InterpolationType>NEAREST</ns5:InterpolationType>" + '\n' + "        </ns5:FieldSubset>" + '\n' + "    </ns5:RangeSubset>" + '\n' + "    <ns5:Output store=\"false\" format=\"EPSG:4326\"/>" + '\n' + "</ns5:GetCoverage>" + '\n';
    assertXmlEquals(expResult, result, "xmlns:*");
}
Also used : GetCoverageType(org.geotoolkit.wcs.xml.v100.GetCoverageType) StringWriter(java.io.StringWriter) CodeType(org.geotoolkit.ows.xml.v110.CodeType)

Aggregations

StringWriter (java.io.StringWriter)2 GetCoverageType (org.geotoolkit.wcs.xml.v100.GetCoverageType)2 CodeType (org.geotoolkit.ows.xml.v110.CodeType)1 OutputType (org.geotoolkit.wcs.xml.v100.OutputType)1