Search in sources :

Example 1 with TimeInstantPropertyType

use of org.geotoolkit.gml.xml.v321.TimeInstantPropertyType in project arctic-sea by 52North.

the class OmEncoderv20 method addNilResultTime.

private void addNilResultTime(OMObservationType xbObservationTemplate) {
    TimeInstantPropertyType xbResultTime = xbObservationTemplate.addNewResultTime();
    xbResultTime.setNilReason(NIL_REASON_TEMPLATE);
}
Also used : TimeInstantPropertyType(net.opengis.gml.x32.TimeInstantPropertyType)

Example 2 with TimeInstantPropertyType

use of org.geotoolkit.gml.xml.v321.TimeInstantPropertyType in project geotoolkit by Geomatys.

the class TimePeriodTypeTest method getTime3Test.

@Test
public void getTime3Test() throws Exception {
    String snull = null;
    TimeInstantType tb = new TimeInstantType(new TimePositionType("2008-11-01T02:00:00"));
    TimeInstantType te = new TimeInstantType(new TimePositionType("2008-11-01T02:01:00"));
    TimePeriodType tp = new TimePeriodType(null, snull);
    tp.setBegin(new TimeInstantPropertyType(tb));
    tp.setEnd(new TimeInstantPropertyType(te));
    assertEquals(60000, tp.getTime());
    tb = new TimeInstantType(new TimePositionType("2008-11-01T01:00:00"));
    te = new TimeInstantType(new TimePositionType("2008-11-01T02:00:00"));
    tp = new TimePeriodType(null, snull);
    tp.setBegin(new TimeInstantPropertyType(tb));
    tp.setEnd(new TimeInstantPropertyType(te));
    assertEquals(3600000, tp.getTime());
    tp = new TimePeriodType(null, snull);
    tp.setBegin(new TimeInstantPropertyType(tb));
    assertEquals(-1, tp.getTime());
    tp = new TimePeriodType(null, snull);
    tp.setEnd(new TimeInstantPropertyType(te));
    assertEquals(-1, tp.getTime());
    tp = new TimePeriodType(null, snull);
    assertEquals(-1, tp.getTime());
}
Also used : TimeInstantType(org.geotoolkit.gml.xml.v311.TimeInstantType) TimePeriodType(org.geotoolkit.gml.xml.v311.TimePeriodType) TimeInstantPropertyType(org.geotoolkit.gml.xml.v311.TimeInstantPropertyType) TimePositionType(org.geotoolkit.gml.xml.v311.TimePositionType)

Example 3 with TimeInstantPropertyType

use of org.geotoolkit.gml.xml.v321.TimeInstantPropertyType in project arctic-sea by 52North.

the class GmlEncoderv321 method createTimeInstantPropertyType.

private XmlObject createTimeInstantPropertyType(TimeInstant time) throws EncodingException {
    TimeInstantPropertyType timeInstantPropertyType = TimeInstantPropertyType.Factory.newInstance(getXmlOptions());
    createTimeInstantType(time, timeInstantPropertyType.addNewTimeInstant());
    return timeInstantPropertyType;
}
Also used : TimeInstantPropertyType(net.opengis.gml.x32.TimeInstantPropertyType)

Example 4 with TimeInstantPropertyType

use of org.geotoolkit.gml.xml.v321.TimeInstantPropertyType in project geotoolkit by Geomatys.

the class TimePeriodTypeTest method getTime3Test.

@Test
public void getTime3Test() throws Exception {
    final String id = "id-1";
    String snull = null;
    TimeInstantType tb = new TimeInstantType(new TimePositionType("2008-11-01T02:00:00"));
    TimeInstantType te = new TimeInstantType(new TimePositionType("2008-11-01T02:01:00"));
    TimePeriodType tp = new TimePeriodType(id, snull);
    tp.setBegin(new TimeInstantPropertyType(tb));
    tp.setEnd(new TimeInstantPropertyType(te));
    assertEquals(60000, tp.getTime());
    tb = new TimeInstantType(new TimePositionType("2008-11-01T01:00:00"));
    te = new TimeInstantType(new TimePositionType("2008-11-01T02:00:00"));
    tp = new TimePeriodType(id, snull);
    tp.setBegin(new TimeInstantPropertyType(tb));
    tp.setEnd(new TimeInstantPropertyType(te));
    assertEquals(3600000, tp.getTime());
    tp = new TimePeriodType(id, snull);
    tp.setBegin(new TimeInstantPropertyType(tb));
    assertEquals(-1, tp.getTime());
    tp = new TimePeriodType(id, snull);
    tp.setEnd(new TimeInstantPropertyType(te));
    assertEquals(-1, tp.getTime());
    tp = new TimePeriodType(id, snull);
    assertEquals(-1, tp.getTime());
}
Also used : TimeInstantType(org.geotoolkit.gml.xml.v321.TimeInstantType) TimePeriodType(org.geotoolkit.gml.xml.v321.TimePeriodType) TimeInstantPropertyType(org.geotoolkit.gml.xml.v321.TimeInstantPropertyType) TimePositionType(org.geotoolkit.gml.xml.v321.TimePositionType)

Aggregations

TimeInstantPropertyType (net.opengis.gml.x32.TimeInstantPropertyType)2 TimeInstantPropertyType (org.geotoolkit.gml.xml.v311.TimeInstantPropertyType)1 TimeInstantType (org.geotoolkit.gml.xml.v311.TimeInstantType)1 TimePeriodType (org.geotoolkit.gml.xml.v311.TimePeriodType)1 TimePositionType (org.geotoolkit.gml.xml.v311.TimePositionType)1 TimeInstantPropertyType (org.geotoolkit.gml.xml.v321.TimeInstantPropertyType)1 TimeInstantType (org.geotoolkit.gml.xml.v321.TimeInstantType)1 TimePeriodType (org.geotoolkit.gml.xml.v321.TimePeriodType)1 TimePositionType (org.geotoolkit.gml.xml.v321.TimePositionType)1