use of org.geotoolkit.swe.xml.UomProperty in project geotoolkit by Geomatys.
the class OMUtils method getDataRecordTrajectory.
public static AbstractDataRecord getDataRecordTrajectory(final String version, final List<? extends Field> phenomenons) {
final List<AnyScalar> fields = new ArrayList<>();
fields.add(TIME_FIELD.get(version));
fields.add(LATITUDE_FIELD.get(version));
fields.add(LONGITUDE_FIELD.get(version));
for (Field phenomenon : phenomenons) {
final UomProperty uom = SOSXmlFactory.buildUomProperty(version, phenomenon.uom, null);
final Quantity cat = SOSXmlFactory.buildQuantity(version, phenomenon.name, uom, null);
fields.add(SOSXmlFactory.buildAnyScalar(version, null, phenomenon.name, cat));
}
return SOSXmlFactory.buildSimpleDatarecord(version, null, null, null, true, fields);
}
use of org.geotoolkit.swe.xml.UomProperty in project geotoolkit by Geomatys.
the class OMUtils method getDataRecordProfile.
public static AbstractDataRecord getDataRecordProfile(final String version, final List<? extends Field> phenomenons) {
final List<AnyScalar> fields = new ArrayList<>();
fields.add(PRESSION_FIELD.get(version));
for (Field phenomenon : phenomenons) {
final UomProperty uom = SOSXmlFactory.buildUomProperty(version, phenomenon.uom, null);
final Quantity cat = SOSXmlFactory.buildQuantity(version, phenomenon.name, uom, null);
fields.add(SOSXmlFactory.buildAnyScalar(version, null, phenomenon.name, cat));
}
return SOSXmlFactory.buildSimpleDatarecord(version, null, null, null, true, fields);
}
use of org.geotoolkit.swe.xml.UomProperty in project geotoolkit by Geomatys.
the class OMUtils method getDataRecordTimeSeries.
public static AbstractDataRecord getDataRecordTimeSeries(final String version, final List<? extends Field> phenomenons) {
final List<AnyScalar> fields = new ArrayList<>();
fields.add(TIME_FIELD.get(version));
for (Field phenomenon : phenomenons) {
final UomProperty uom = SOSXmlFactory.buildUomProperty(version, phenomenon.uom, null);
final Quantity cat = SOSXmlFactory.buildQuantity(version, phenomenon.name, uom, null);
fields.add(SOSXmlFactory.buildAnyScalar(version, null, phenomenon.name, cat));
}
return SOSXmlFactory.buildSimpleDatarecord(version, null, null, null, true, fields);
}
use of org.geotoolkit.swe.xml.UomProperty in project geotoolkit by Geomatys.
the class Field method getScalar.
/**
* Return an SWE object.
*
* @param version The SOS version of the object (and so the SWE version).
* @return
*/
public AnyScalar getScalar(final String version) {
final AbstractDataComponent compo;
if (FieldType.QUANTITY.equals(type)) {
final UomProperty uomCode = buildUomProperty(version, uom, null);
compo = buildQuantity(version, description, uomCode, null);
} else if (FieldType.TEXT.equals(type)) {
compo = buildText(version, description, null);
} else if (FieldType.TIME.equals(type)) {
compo = buildTime(version, description, null);
} else if (FieldType.BOOLEAN.equals(type)) {
compo = buildBoolean(version, description, null);
} else {
throw new IllegalArgumentException("Unexpected field Type:" + type);
}
return buildAnyScalar(version, null, name, compo);
}
Aggregations