use of net.opengis.gml.v_3_2_1.PointType in project ddf by codice.
the class RegistryPackageWebConverterTest method getFirstExtrinsicObject.
private ExtrinsicObjectType getFirstExtrinsicObject() {
ExtrinsicObjectType extrinsicObject = RIM_FACTORY.createExtrinsicObjectType();
// set default values
extrinsicObject.setMimeType(extrinsicObject.getMimeType());
extrinsicObject.setIsOpaque(extrinsicObject.isIsOpaque());
extrinsicObject.setId("urn:registry:node");
extrinsicObject.setObjectType("urn:registry:federation:node");
extrinsicObject.getSlot().add(stHelper.create("liveDate", "2015-11-01T06:15:30-07:00", "xs:dateTime"));
extrinsicObject.getSlot().add(stHelper.create("dataStartDate", "2015-11-01T13:15:30Z", "xs:dateTime"));
extrinsicObject.getSlot().add(stHelper.create("dataEndDate", "2015-12-01T23:01:40Z", "xs:dateTime"));
extrinsicObject.getSlot().add(stHelper.create("lastUpdated", "2016-01-26T17:16:34.996Z", "xs:dateTime"));
extrinsicObject.getSlot().add(stHelper.create("links", "https://some/link/to/my/repo", "xs:string"));
SlotType1 locationSlot = stHelper.create("location", (String) null, "urn:ogc:def:dataType:ISO-19107:2003:GM_Point");
PointType point = GML_FACTORY.createPointType();
point.setSrsDimension(BigInteger.valueOf(2));
point.setSrsName("urn:ogc:def:crs:EPSG::4326");
DirectPositionType directPosition = GML_FACTORY.createDirectPositionType();
directPosition.getValue().add(112.267472);
directPosition.getValue().add(33.467944);
point.setPos(directPosition);
ValueListType valueList = WRS_FACTORY.createValueListType();
AnyValueType anyValue = WRS_FACTORY.createAnyValueType();
anyValue.getContent().add(GML_FACTORY.createPoint(point));
valueList.getAnyValue().add(anyValue);
locationSlot.setValueList(RIM_FACTORY.createValueList(valueList));
extrinsicObject.getSlot().add(locationSlot);
SlotType1 boundsSlot = stHelper.create("bounds", (String) null, "urn:ogc:def:dataType:ISO-19107:2003:GM_Envelope");
EnvelopeType bounds = GML_FACTORY.createEnvelopeType();
bounds.setSrsName("urn:ogc:def:crs:EPSG::4326");
directPosition = GML_FACTORY.createDirectPositionType();
directPosition.getValue().add(112.267472);
directPosition.getValue().add(33.467944);
bounds.setUpperCorner(directPosition);
directPosition = GML_FACTORY.createDirectPositionType();
directPosition.getValue().add(110.267472);
directPosition.getValue().add(30.467944);
bounds.setLowerCorner(directPosition);
valueList = WRS_FACTORY.createValueListType();
anyValue = WRS_FACTORY.createAnyValueType();
anyValue.getContent().add(GML_FACTORY.createEnvelope(bounds));
valueList.getAnyValue().add(anyValue);
boundsSlot.setValueList(RIM_FACTORY.createValueList(valueList));
extrinsicObject.getSlot().add(boundsSlot);
extrinsicObject.getSlot().add(stHelper.create("region", "USA", "urn:ogc:def:ebRIM-ClassificationScheme:UNSD:GlobalRegions"));
List<String> values = new ArrayList<>();
values.add("youtube");
values.add("myCamera");
extrinsicObject.getSlot().add(stHelper.create("inputDataSources", values, "xs:string"));
values = new ArrayList<>();
values.add("video");
values.add("sensor");
extrinsicObject.getSlot().add(stHelper.create("dataTypes", values, "xs:string"));
extrinsicObject.getSlot().add(stHelper.create("securityLevel", "role=guest", "xs:string"));
extrinsicObject.setName(istHelper.create("Node Name"));
extrinsicObject.setDescription(istHelper.create("A little something describing this node in less than 1024 characters"));
extrinsicObject.setVersionInfo(getVersionInfo("2.9.x"));
ClassificationType classification = RIM_FACTORY.createClassificationType();
classification.setId("urn:classification:id0");
classification.setClassifiedObject("classifiedObjectId");
extrinsicObject.getClassification().add(classification);
return extrinsicObject;
}
use of net.opengis.gml.v_3_2_1.PointType in project ddf by codice.
the class TestWfs10JTStoGML200Converter method testGMLToPointType.
@Test
public void testGMLToPointType() throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
String pointGML = Wfs10JTStoGML200Converter.convertGeometryToGML(getGeometryFromWkt(POINT)).replaceAll("\n", "");
PointType pointType = (PointType) Wfs10JTStoGML200Converter.convertGMLToGeometryType(pointGML, Wfs10Constants.POINT);
assertThat(Wfs10Constants.POINT.getLocalPart().equals(pointType.getJAXBElementName().getLocalPart()), is(Boolean.TRUE));
String coords = pointType.getCoordinates().getValue().replaceAll("\n", "").trim();
assertThat(POINT_COORDS.equals(coords), is(Boolean.TRUE));
}
use of net.opengis.gml.v_3_2_1.PointType in project ddf by codice.
the class TestWfs10JTStoGML200Converter method testPointTypeToJAXB.
@Test
public void testPointTypeToJAXB() throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
String pointGML = Wfs10JTStoGML200Converter.convertGeometryToGML(getGeometryFromWkt(POINT));
PointType pointType = (PointType) Wfs10JTStoGML200Converter.convertGMLToGeometryType(pointGML, Wfs10Constants.POINT);
JAXBElement<PointType> pointTypeJAXBElement = (JAXBElement<PointType>) Wfs10JTStoGML200Converter.convertGeometryTypeToJAXB(pointType);
JAXB.marshal(pointTypeJAXBElement, writer);
String xml = writer.toString();
Diff diff = XMLUnit.compareXML(xml, POINT_GML);
assertTrue(XMLUNIT_SIMILAR, diff.similar());
assertThat(diff.similar(), is(Boolean.TRUE));
assertThat(diff.identical(), is(Boolean.FALSE));
}
use of net.opengis.gml.v_3_2_1.PointType in project ddf by codice.
the class Wfs20JTStoGML321Converter method createGeometryPropertyType.
private static GeometryPropertyType createGeometryPropertyType(Geometry geometry, String srsName) {
final GeometryPropertyType geometryPropertyType = GML320_OBJECT_FACTORY.createGeometryPropertyType();
if (geometry instanceof Point) {
PointType pointType = convertToPointType((Point) geometry, srsName);
geometryPropertyType.setAbstractGeometry(convertPointTypeToJAXB(pointType));
} else if (geometry instanceof LineString) {
LineStringType lineStringType = convertToLineStringType((LineString) geometry, srsName);
geometryPropertyType.setAbstractGeometry(convertLineStringTypeToJAXB(lineStringType));
} else if (geometry instanceof Polygon) {
PolygonType polygonType = convertToPolygonType((Polygon) geometry, srsName);
geometryPropertyType.setAbstractGeometry(convertPolygonTypeToJAXB(polygonType));
} else if (geometry instanceof MultiPoint) {
MultiPointType multiPointType = convertToMultiPointType((MultiPoint) geometry, srsName);
geometryPropertyType.setAbstractGeometry(convertMultiPointTypeToJAXB(multiPointType));
} else if (geometry instanceof MultiLineString) {
MultiCurveType multiCurveType = convertToMultiLineStringType((MultiLineString) geometry, srsName);
geometryPropertyType.setAbstractGeometry(convertMultiCurveTypeToJAXB(multiCurveType));
} else if (geometry instanceof MultiPolygon) {
MultiSurfaceType multiSurfaceType = convertToMultiSurfaceType((MultiPolygon) geometry, srsName);
geometryPropertyType.setAbstractGeometry(convertMultiSurfaceTypeToJAXB(multiSurfaceType));
} else if (geometry instanceof GeometryCollection) {
MultiGeometryType multiGeometryType = convertToMultiGeometryType((GeometryCollection) geometry, srsName);
geometryPropertyType.setAbstractGeometry(convertMultiGeometryTypeToJAXB(multiGeometryType));
} else {
throw new IllegalArgumentException();
}
return geometryPropertyType;
}
use of net.opengis.gml.v_3_2_1.PointType in project ddf by codice.
the class Wfs20JTStoGML321Converter method convertToPointType.
public static PointType convertToPointType(Point point, String srsName) {
PointType pointType = GML320_OBJECT_FACTORY.createPointType();
pointType.setPos(convertToDirectPositionType(point.getCoordinate(), srsName));
pointType.setSrsName(srsName);
return pointType;
}
Aggregations