use of org.geotoolkit.gml.xml.v311.CodeType 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:*");
}
use of org.geotoolkit.gml.xml.v311.CodeType in project geotoolkit by Geomatys.
the class OWSXmlBindingTest method additionalParametersTypeUnmarshalingTest.
@Test
public void additionalParametersTypeUnmarshalingTest() throws JAXBException {
Unmarshaller unmarshaller = owsPool.acquireUnmarshaller();
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<ns4:AdditionalParameters xmlns:ows=\"http://www.opengis.net/ows\" xmlns:ns4=\"http://www.opengis.net/ows/2.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:ins=\"http://www.inspire.org\">\n" + " <ns4:AdditionalParameter>\n" + " <ns4:Name>param-1</ns4:Name>\n" + " <ns4:Value xsi:type=\"xs:string\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">value 1</ns4:Value>\n" + " </ns4:AdditionalParameter>\n" + " <ns4:AdditionalParameter>\n" + " <ns4:Name>param-2</ns4:Name>\n" + " <ns4:Value xsi:type=\"xs:string\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">value 2</ns4:Value>\n" + " </ns4:AdditionalParameter>\n" + "</ns4:AdditionalParameters>" + '\n';
StringReader sr = new StringReader(xml);
AdditionalParametersType result = ((JAXBElement<AdditionalParametersType>) unmarshaller.unmarshal(sr)).getValue();
AdditionalParametersType expResult = new AdditionalParametersType();
List<AdditionalParameter> params = new ArrayList<>();
params.add(new AdditionalParameter(new CodeType("param-1"), Arrays.asList("value 1")));
params.add(new AdditionalParameter(new CodeType("param-2"), Arrays.asList("value 2")));
expResult.setAdditionalParameter(params);
assertEquals(expResult.getAdditionalParameter(), result.getAdditionalParameter());
}
use of org.geotoolkit.gml.xml.v311.CodeType in project geotoolkit by Geomatys.
the class SmlXMLBindingTest method SystemUnmarshallMarshalingTest.
/**
* Test simple Record Marshalling.
*
* @throws java.lang.Exception
*/
@Test
public void SystemUnmarshallMarshalingTest() throws Exception {
Unmarshaller unmarshaller = SensorMLMarshallerPool.getInstance().acquireUnmarshaller();
InputStream is = SmlXMLBindingTest.class.getResourceAsStream("/org/geotoolkit/sml/system.xml");
Object unmarshalled = unmarshaller.unmarshal(is);
if (unmarshalled instanceof JAXBElement) {
unmarshalled = ((JAXBElement) unmarshalled).getValue();
}
assertTrue(unmarshalled instanceof SensorML);
SensorML result = (SensorML) unmarshalled;
Member member = new Member();
member.setRole("urn:x-ogx:def:sensor:OGC:detector");
SystemType system = new SystemType();
List<JAXBElement<String>> kw = new ArrayList<JAXBElement<String>>();
kw.add(sml100Factory.createKeywordsKeywordListKeyword("piezometer"));
kw.add(sml100Factory.createKeywordsKeywordListKeyword("geosciences"));
kw.add(sml100Factory.createKeywordsKeywordListKeyword("point d'eau"));
Keywords keywords = new Keywords(new KeywordList(URI.create("urn:x-brgm:def:gcmd:keywords"), kw));
system.setKeywords(keywords);
Classifier cl1 = new Classifier("intendedApplication", new Term("eaux souterraines", URI.create("urn:x-ogc:def:classifier:OGC:application")));
CodeSpacePropertyType cs = new CodeSpacePropertyType("urn:x-brgm:def:GeoPoint:bss");
Classifier cl2 = new Classifier("sensorType", new Term(cs, "piezometer", URI.create("urn:sensor:classifier:sensorType")));
CodeSpacePropertyType cs3 = new CodeSpacePropertyType("urn:x-sandre:def:mdo:identifier");
Classifier cl3 = new Classifier("waterBody", new Term(cs3, "FR6221", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs4 = new CodeSpacePropertyType("urn:x-sandre:def:mdo:name");
Classifier cl4 = new Classifier("waterBody", new Term(cs4, "Multicouche pliocene et alluvions quaternaires du Roussillon", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs5 = new CodeSpacePropertyType("urn:x-sandre:def:bdhrf:identifier");
Classifier cl5 = new Classifier("hydrologicalEntity", new Term(cs5, "225", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs6 = new CodeSpacePropertyType("urn:x-sandre:def:bdhrf:name");
Classifier cl6 = new Classifier("hydrologicalEntity", new Term(cs6, "Pliocene du Roussillon", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs7 = new CodeSpacePropertyType("urn:x-insee:def:commune:identifier");
Classifier cl7 = new Classifier("commune", new Term(cs7, "66008", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs8 = new CodeSpacePropertyType("urn:x-insee:def:commune:name");
Classifier cl8 = new Classifier("commune", new Term(cs8, "ARGELES SUR MER", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs9 = new CodeSpacePropertyType("urn:x-sandre:def:network:identifier");
Classifier cl9 = new Classifier("network", new Term(cs9, "600000221", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs10 = new CodeSpacePropertyType("urn:x-sandre:def:network:identifier");
Classifier cl10 = new Classifier("network", new Term(cs10, "600000025", URI.create("urn:sensor:classifier:references")));
List<Classifier> cls = new ArrayList<Classifier>();
cls.add(cl1);
cls.add(cl2);
cls.add(cl3);
cls.add(cl4);
cls.add(cl5);
cls.add(cl6);
cls.add(cl7);
cls.add(cl8);
cls.add(cl9);
cls.add(cl10);
ClassifierList claList = new ClassifierList(null, cls);
Classification classification = new Classification(claList);
system.setClassification(classification);
List<Identifier> identifiers = new ArrayList<Identifier>();
cs = new CodeSpacePropertyType("urn:x-brgm:def:samplingStation:bss");
Identifier id1 = new Identifier("bssCode", new Term(cs, "10972X0137/PONT", URI.create("urn:x-ogc:def:identifier:OGC:modelNumber")));
cs = new CodeSpacePropertyType("urn:x-brgm:def:sensorSystem:hydras");
Identifier id2 = new Identifier("supervisorCode", new Term(cs, "00ARGLELES", URI.create("urn:x-ogc:def:identifier:OGC:modelNumber")));
Identifier id3 = new Identifier("longName", new Term("ARGELES", URI.create("urn:x-ogc:def:identifier:OGC:longname")));
identifiers.add(id1);
identifiers.add(id2);
identifiers.add(id3);
IdentifierList identifierList = new IdentifierList(null, identifiers);
Identification identification = new Identification(identifierList);
system.setIdentification(identification);
Capabilities capabilities = new Capabilities();
List<DataComponentPropertyType> fields = new ArrayList<DataComponentPropertyType>();
QuantityType quantity = new QuantityType("urn:x-ogc:def:property:temperature", new UomPropertyType(null, "urn:ogc:unit:degree:celsius"), 0.1);
DataComponentPropertyType field1 = new DataComponentPropertyType("resolution", "urn:x-ogc:def:property:resolution", quantity);
fields.add(field1);
QuantityRange quantityR = new QuantityRange(new UomPropertyType(null, "urn:ogc:unit:percent"), Arrays.asList(-0.5, 0.5));
quantityR.setDefinition("urn:x-ogc:def:property:absoluteAccuracy");
DataComponentPropertyType field2 = new DataComponentPropertyType("accuracy", "urn:x-ogc:def:property:accuracy", quantityR);
fields.add(field2);
DataRecordType record = new DataRecordType("urn:x-ogc:def:property:measurementProperties", fields);
record.setDescription("Toutes les informations sur les contraintes sur les donnees");
JAXBElement<? extends AbstractDataRecordType> jbRecord = swe100Factory.createDataRecord(record);
capabilities.setAbstractDataRecord(jbRecord);
system.setCapabilities(capabilities);
AddressType address1 = new AddressType("SGR LRO-1039 Rue de Pinville-34000 Montpellier", "MONTPELLIER", null, null, null, "m.blaise@brgm.fr");
ContactInfo contactInfo1 = new ContactInfo(null, address1);
ResponsibleParty resp1 = new ResponsibleParty("BLAISE Marion (BRGM)", "BRGM", null, contactInfo1);
Contact contact1 = new Contact("urn:x-ogc:def:role:producer", resp1);
AddressType address2 = new AddressType("Hotel du Departement, B.P. 906, 66 906 Perpignan Cedex", "PERPIGNAN", null, null, null, null);
ContactInfo contactInfo2 = new ContactInfo(null, address2);
ResponsibleParty resp2 = new ResponsibleParty("ASSENS Martine (CG66)", "CONSEIL GENERAL DES PYRENEES ORIENTALES", null, contactInfo2);
Contact contact2 = new Contact("urn:x-ogc:def:role:owner", resp2);
system.setContact(Arrays.asList(contact1, contact2));
IoComponentPropertyType io = new IoComponentPropertyType("level", new ObservableProperty("urn:x-ogc:def:phenomenon:OGC:level"));
InputList inputList = new InputList(Arrays.asList(io));
Inputs inputs = new Inputs(inputList);
system.setInputs(inputs);
fields = new ArrayList<DataComponentPropertyType>();
TimeType time = new TimeType("urn:x-ogc:def:phenomenon:observationTime", new UomPropertyType(null, "urn:x-ogc:def:unit:ISO8601"));
fields.add(new DataComponentPropertyType("time", null, time));
QuantityType q = new QuantityType("urn:x-ogc:def:phenomenon:OGC:depth", new UomPropertyType("m", null), null);
fields.add(new DataComponentPropertyType("depth", null, q));
BooleanType b = new BooleanType("urn:x-ogc:def:phenomenon:BRGM:validity", null);
fields.add(new DataComponentPropertyType("validity", null, b));
DataRecordType outRecord = new DataRecordType(null, fields);
outRecord.setId("outputGroup");
IoComponentPropertyType io2 = new IoComponentPropertyType("piezoMeasurements", swe100Factory.createDataRecord(outRecord));
OutputList outputList = new OutputList(Arrays.asList(io2));
Outputs outputs = new Outputs(outputList);
system.setOutputs(outputs);
fields = new ArrayList<DataComponentPropertyType>();
q = new QuantityType("urn:x-ogc:def:property:depth", new UomPropertyType(null, "urn:ogc:unit:m"), 166.0);
fields.add(new DataComponentPropertyType("MaxDepth", null, q));
DataRecordType charRecord = new DataRecordType(null, fields);
List<DataComponentPropertyType> fields2 = new ArrayList<DataComponentPropertyType>();
fields2.add(new DataComponentPropertyType("physicalProperties", null, swe100Factory.createDataRecord(charRecord)));
DataRecordType ccharRecord = new DataRecordType("urn:x-ogc:def:property:physicalProperties", fields2);
Characteristics characteristics = new Characteristics();
characteristics.setAbstractDataRecord(swe100Factory.createDataRecord(ccharRecord));
system.setCharacteristics(characteristics);
DirectPositionType pos = new DirectPositionType("urn:ogc:crs:EPSG:27582", 2, Arrays.asList(65400.0, 1731368.0));
PointType point = new PointType("STATION_LOCALISATION", pos);
Location location = new Location(point);
system.setSMLLocation(location);
EngineeringDatumType engineeringDatum = new EngineeringDatumType("datum", "Sensor Datum", new CodeType("X, Y et Z sont orthogonal au regard d'un point de reference."));
EngineeringDatumRefType usesEngineeringDatum = new EngineeringDatumRefType(engineeringDatum);
EngineeringCRSType engineeringCRS = new EngineeringCRSType("STATION_FRAME", "Position absolue du capteur", new CoordinateSystemRefType("urn:ogc:def:crs:ogc:1.0:xyzFrame"), usesEngineeringDatum);
SpatialReferenceFrame spatialReferenceFrame = new SpatialReferenceFrame(engineeringCRS);
system.setSpatialReferenceFrame(spatialReferenceFrame);
Document doc = new Document("Fiche descriptive de la station", "text/html", Arrays.asList(new OnlineResource("http://ades.eaufrance.fr/FichePtEau.aspx?code=10972X0137/PONT")));
Documentation documentation = new Documentation(doc);
documentation.setRole("urn:ogc:role:description");
system.setDocumentation(Arrays.asList(documentation));
List<ComponentPropertyType> compos = new ArrayList<ComponentPropertyType>();
compos.add(new ComponentPropertyType("Profondeur", "urn:x-ogc:def:sensor:detector", "capteur_"));
ComponentList componentList = new ComponentList(compos);
Components components = new Components(componentList);
system.setComponents(components);
List<CoordinateType> coordinates = new ArrayList<CoordinateType>();
QuantityType xQuant = new QuantityType("urn:ogc:def:phenomenon:distance", new UomPropertyType("m", null), 0.0);
xQuant.setAxisID("X");
CoordinateType xcoord = new CoordinateType("x", xQuant);
QuantityType yQuant = new QuantityType("urn:ogc:def:phenomenon:distance", new UomPropertyType("m", null), 0.0);
yQuant.setAxisID("Y");
CoordinateType ycoord = new CoordinateType("y", yQuant);
QuantityType zQuant = new QuantityType("urn:ogc:def:phenomenon:distance", new UomPropertyType("m", null), 0.0);
zQuant.setAxisID("Z");
CoordinateType zcoord = new CoordinateType("z", zQuant);
coordinates.add(xcoord);
coordinates.add(ycoord);
coordinates.add(zcoord);
VectorType vect = new VectorType("urn:ogc:def:phenomenon:location", coordinates);
VectorPropertyType vectP = new VectorPropertyType(vect);
PositionType Sposition = new PositionType(URI.create("#REFERENCE_POINT"), URI.create("#PIEZOMETER_FRAME"), vectP, null);
Position position = new Position("piezoPosition", Sposition);
PositionList positionList = new PositionList(null, Arrays.asList(position));
Positions positions = new Positions(positionList);
system.setPositions(positions);
TemporalReferenceFrame temporalReferenceFrame = new TemporalReferenceFrame(new TemporalCRSType("temporalReference", null, null, "calendrier gregorien en heure d'ete", new TemporalCSRefType("urn:x-brgm:temporalCS:gregorian"), new TemporalDatumRefType("urn:x-brgm:temporalDatum:UniversalTime")));
system.setTemporalReferenceFrame(temporalReferenceFrame);
List<Connection> connecL = new ArrayList<Connection>();
connecL.add(new Connection("inputTolevel", new Link(null, new LinkRef("this/inputs/level"), new LinkRef("piezometer/inputs/level"))));
Connection c2 = new Connection("depthToOutput", new Link(null, new LinkRef("piezometer/outputs/depth"), new LinkRef("this/outputs/piezoMeasurements/depth")));
ArrayLink alink = new ArrayLink();
LinkRef sa = new LinkRef("piezometer/outputs/depth");
alink.setSourceArray(sa);
LinkRef si = new LinkRef("this/outputs/piezoMeasurements/depth");
alink.setSourceIndex(si);
LinkRef da = new LinkRef("this/outputs/piezoMeasurements/depth");
alink.setDestinationArray(da);
LinkRef di = new LinkRef("this/outputs/piezoMeasurements/depth");
alink.getDestinationIndex().add(di);
c2.setArrayLink(alink);
connecL.add(c2);
ConnectionList connectionList = new ConnectionList(connecL);
Connections connections = new Connections(connectionList);
system.setConnections(connections);
LayerPropertyType applicationLayer = new LayerPropertyType(new Category("urn:ogc:def:protocol:applicationLink", "urn:x-brgm:def:protocol:hydrasIRIS"));
LayerPropertyType dataLinkLayer = new LayerPropertyType(new Category("urn:ogc:def:protocol:dataLink", "urn:x-brgm:def:dataLink:RTC"));
InterfaceDefinition definition = new InterfaceDefinition(null, applicationLayer, dataLinkLayer);
Interface i1 = new Interface("RS-232", definition);
List<Interface> interfaceL = new ArrayList<Interface>();
interfaceL.add(i1);
InterfaceList interfaceList = new InterfaceList(null, interfaceL);
Interfaces interfaces = new Interfaces(interfaceList);
system.setInterfaces(interfaces);
Rights rights = new Rights(true, true, new Documentation(new Document("Donnees sous copyright du BRGM")));
LegalConstraint legalConstraint = new LegalConstraint(rights);
system.setLegalConstraint(legalConstraint);
system.setDescription("information about the piezometer");
system.setName(new DefaultIdentifier("Piezometer Test"));
member.setProcess(sml100Factory.createSystem(system));
SensorML expectedResult = new SensorML("1.0", Arrays.asList(member));
assertEquals(result.getMember().size(), 1);
assertTrue(result.getMember().get(0).getProcess() != null);
assertTrue(result.getMember().get(0).getProcess().getValue() instanceof SystemType);
SystemType resultProcess = (SystemType) result.getMember().get(0).getProcess().getValue();
assertEquals(resultProcess.getCapabilities().size(), system.getCapabilities().size());
assertTrue(resultProcess.getCapabilities().get(0).getAbstractDataRecord().getValue() instanceof DataRecordType);
DataRecordType resultRecord = (DataRecordType) resultProcess.getCapabilities().get(0).getAbstractDataRecord().getValue();
DataRecordType expRecord = (DataRecordType) system.getCapabilities().get(0).getAbstractDataRecord().getValue();
assertEquals(resultRecord.getField().get(0), expRecord.getField().get(0));
assertEquals(resultRecord.getField().get(1), expRecord.getField().get(1));
assertEquals(resultRecord.getField(), expRecord.getField());
assertEquals(resultProcess.getCapabilities().get(0).getAbstractDataRecord().getValue(), system.getCapabilities().get(0).getAbstractDataRecord().getValue());
assertEquals(resultProcess.getCapabilities().get(0), system.getCapabilities().get(0));
assertEquals(resultProcess.getCapabilities(), system.getCapabilities());
assertTrue(resultProcess.getContact().size() == 2);
assertEquals(resultProcess.getContact().get(0).getContactList(), system.getContact().get(0).getContactList());
assertEquals(resultProcess.getContact().get(0).getResponsibleParty().getContactInfo(), system.getContact().get(0).getResponsibleParty().getContactInfo());
assertEquals(resultProcess.getContact().get(0).getResponsibleParty().getOrganizationName(), system.getContact().get(0).getResponsibleParty().getOrganizationName());
assertEquals(resultProcess.getContact().get(0).getResponsibleParty(), system.getContact().get(0).getResponsibleParty());
assertEquals(resultProcess.getContact().get(0), system.getContact().get(0));
assertEquals(resultProcess.getContact(), system.getContact());
assertTrue(resultProcess.getClassification().size() == 1);
assertTrue(resultProcess.getClassification().get(0).getClassifierList().getClassifier().size() == 10);
assertEquals(resultProcess.getClassification().get(0).getClassifierList().getClassifier().get(0).getTerm(), system.getClassification().get(0).getClassifierList().getClassifier().get(0).getTerm());
assertEquals(resultProcess.getClassification().get(0).getClassifierList().getClassifier().get(0), system.getClassification().get(0).getClassifierList().getClassifier().get(0));
assertEquals(resultProcess.getClassification().get(0).getClassifierList().getClassifier(), system.getClassification().get(0).getClassifierList().getClassifier());
assertEquals(resultProcess.getClassification().get(0).getClassifierList(), system.getClassification().get(0).getClassifierList());
assertEquals(resultProcess.getClassification().get(0), system.getClassification().get(0));
assertEquals(resultProcess.getClassification(), system.getClassification());
assertEquals(resultProcess.getIdentification(), system.getIdentification());
assertEquals(resultProcess.getValidTime(), system.getValidTime());
assertEquals(resultProcess.getParameters(), system.getParameters());
assertEquals(resultProcess.getInputs().getInputList().getInput(), system.getInputs().getInputList().getInput());
assertEquals(resultProcess.getInputs().getInputList(), system.getInputs().getInputList());
assertEquals(resultProcess.getInputs(), system.getInputs());
assertEquals(resultProcess.getOutputs(), system.getOutputs());
assertEquals(resultProcess.getSMLLocation(), system.getSMLLocation());
assertEquals(resultProcess.getPosition(), system.getPosition());
assertEquals(resultProcess.getSpatialReferenceFrame(), system.getSpatialReferenceFrame());
assertEquals(resultProcess.getDocumentation(), system.getDocumentation());
assertEquals(resultProcess.getCharacteristics(), system.getCharacteristics());
assertEquals(resultProcess.getComponents(), system.getComponents());
assertEquals(resultProcess.getPositions(), system.getPositions());
assertEquals(resultProcess.getTemporalReferenceFrame(), system.getTemporalReferenceFrame());
assertEquals(resultProcess.getConnections().getConnectionList().getConnection().get(0), system.getConnections().getConnectionList().getConnection().get(0));
assertEquals(resultProcess.getConnections().getConnectionList().getConnection().get(1), system.getConnections().getConnectionList().getConnection().get(1));
assertEquals(resultProcess.getConnections().getConnectionList().getConnection(), system.getConnections().getConnectionList().getConnection());
assertEquals(resultProcess.getConnections().getConnectionList(), system.getConnections().getConnectionList());
assertEquals(resultProcess.getConnections(), system.getConnections());
assertEquals(resultProcess.getInterfaces(), system.getInterfaces());
assertEquals(resultProcess.getLegalConstraint(), system.getLegalConstraint());
assertEquals(resultProcess.getKeywords(), system.getKeywords());
assertEquals(resultProcess.getId(), system.getId());
assertEquals(resultProcess.getName(), system.getName());
assertEquals(resultProcess, system);
assertEquals(expectedResult.getMember().get(0), result.getMember().get(0));
assertEquals(expectedResult.getMember(), result.getMember());
assertEquals(expectedResult, result);
SensorMLMarshallerPool.getInstance().recycle(unmarshaller);
}
use of org.geotoolkit.gml.xml.v311.CodeType in project geotoolkit by Geomatys.
the class WmtsXmlBindingTest method unmarshallingTest.
/**
* Test simple Record Marshalling.
*/
@Test
public void unmarshallingTest() throws JAXBException {
String xml = "<TileMatrix xmlns=\"http://www.opengis.net/wmts/1.0\" xmlns:ows=\"http://www.opengis.net/ows/1.1\" xmlns:gml=\"http://www.opengis.net/gml\" >" + '\n' + " <ows:Identifier>16d</ows:Identifier>" + '\n' + " <ScaleDenominator>55218.001386</ScaleDenominator>" + '\n' + " <TopLeftPoint>" + '\n' + " <gml:Point gml:id=\"p1\">" + '\n' + " <gml:pos>-90.080000 29.982000</gml:pos>" + '\n' + " </gml:Point>" + '\n' + " </TopLeftPoint>" + '\n' + " <TileWidth>256</TileWidth>" + '\n' + " <TileHeight>256</TileHeight>" + '\n' + " <MatrixWidth>3</MatrixWidth>" + '\n' + " <MatrixHeight>3</MatrixHeight>" + '\n' + " </TileMatrix>";
StringReader sr = new StringReader(xml);
TileMatrix result = (TileMatrix) unmarshaller.unmarshal(sr);
PointType pt = new PointType("p1", new DirectPositionType(-90.080000, 29.982000));
TileMatrix expResult = new TileMatrix(new CodeType("16d"), 55218.001386, 256, 256, 3, 3);
assertEquals(expResult, result);
}
use of org.geotoolkit.gml.xml.v311.CodeType in project ddf by codice.
the class CswEndpoint method buildServiceIdentification.
/**
* Creates the ServiceIdentification portion of the GetCapabilities response TODO: Add more
* DDF-specific information if desired (Fees, Keywords, and AccessConstraints are all currently
* empty, and the abstract is very basic)
*
* @return The constructed ServiceIdentification object
*/
private ServiceIdentification buildServiceIdentification() {
ServiceIdentification si = new ServiceIdentification();
si.setTitle(SERVICE_TITLE);
si.setServiceTypeVersion(SERVICE_TYPE_VERSION);
CodeType type = new CodeType();
type.setValue(CswConstants.CSW);
si.setServiceType(type);
si.setAbstract(SERVICE_ABSTRACT);
return si;
}
Aggregations