本文整理汇总了Java中net.opengis.swe.v20.DataType类的典型用法代码示例。如果您正苦于以下问题:Java DataType类的具体用法?Java DataType怎么用?Java DataType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataType类属于net.opengis.swe.v20包,在下文中一共展示了DataType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
@Override
protected void init()
{
SWEHelper fac = new SWEHelper();
// SWE Common data structure
dataStruct = fac.newDataRecord(3);
dataStruct.setName(getName());
dataStruct.addComponent("time", fac.newTimeStampIsoUTC());
dataStruct.addComponent("numSats", fac.newCount(SWEHelper.getPropertyUri("GNSS/FixNumSats"), "Number of Satellites", "Number of satellites used in the position fix"));
dataStruct.addComponent("hdop", fac.newQuantity(SWEHelper.getPropertyUri("GNSS/HDOP"), "HDOP", null, "1", DataType.FLOAT));
dataStruct.addComponent("vdop", fac.newQuantity(SWEHelper.getPropertyUri("GNSS/VDOP"), "VDOP", null, "1", DataType.FLOAT));
dataStruct.addComponent("herr", fac.newQuantity(SWEHelper.getPropertyUri("GNSS/HPrecision"), "Horizontal Precision", null, "m", DataType.FLOAT));
dataStruct.addComponent("verr", fac.newQuantity(SWEHelper.getPropertyUri("GNSS/VPrecision"), "Vertical Precision", null, "m", DataType.FLOAT));
dataEncoding = fac.newTextEncoding(",", "\n");
}
示例2: CamPtzGeoPointingOutput
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
public CamPtzGeoPointingOutput(CamPtzGeoPointingProcess parentProcess)
{
this.parentProcess = parentProcess;
// create output structure
SWEHelper fac = new SWEHelper();
DataRecord rec = fac.newDataRecord();
rec.setName(getName());
rec.addField("time", fac.newTimeStampIsoUTC());
rec.addField("pan", fac.newQuantity(SWEHelper.getPropertyUri("Pan"), "Pan", null, "deg", DataType.FLOAT));
rec.addField("tilt", fac.newQuantity(SWEHelper.getPropertyUri("Tilt"), "Tilt", null, "deg", DataType.FLOAT));
rec.addField("zoom", fac.newCount(SWEHelper.getPropertyUri("AxisZoomFactor"), "Zoom Factor", null, DataType.SHORT));
this.outputDef = rec;
this.outputEncoding = fac.newTextEncoding();
// obtain an event handler for this output
String moduleID = parentProcess.getLocalID();
String topic = getName();
this.eventHandler = EventBus.getInstance().registerProducer(moduleID, topic);
}
示例3: getStringValue
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
/**
* Retrieve string representation of value of component
* This will convert to an ISO string for appropriate time components
* @param component
* @return string representation of component value
*/
public final String getStringValue(ScalarComponent component)
{
if (!component.hasData())
return null;
DataBlock data = component.getData();
DataType dataType = data.getDataType();
String val;
// case of time component
String uom = null;
if (component instanceof Time)
uom = ((Time)component).getUom().getHref();
if (uom != null && uom.equals(Time.ISO_TIME_UNIT))
val = getDoubleOrTimeAsString(data.getDoubleValue(), true);
else if (dataType == DataType.DOUBLE || dataType == DataType.FLOAT)
val = getDoubleOrTimeAsString(data.getDoubleValue(), false);
else
val = data.getStringValue();
return val;
}
示例4: newTime
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
/**
* Creates a new time component
* @param definition URI pointing to semantic definition of component in a dictionary
* @param label short human readable label identifying the component (shown in UI)
* @param description textual description of this component (can be long) or null
* @param uom code or URI for this time stamp unit of measure (can be {@link SWEConstants.})
* @param timeRef URI of time reference system
* @param dataType data type to use for this component (if null, {@link DataType#DOUBLE} will be used)
* @return the new Time component object
*/
public Time newTime(String definition, String label, String description, String uom, String timeRef, DataType dataType)
{
Time t = newTime(dataType == null ? DataType.DOUBLE : dataType);
t.setDefinition(definition);
t.setLabel(label);
t.setDescription(description);
t.setReferenceFrame(timeRef);
if (uom.startsWith(SWEConstants.URN_PREFIX) || uom.startsWith(SWEConstants.HTTP_PREFIX))
t.getUom().setHref(uom);
else
t.getUom().setCode(uom);
return t;
}
示例5: newVector
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
/**
* Creates a 3D vector component with the specified CRS and axes
* @param def definition of the whole vector
* @param crs reference frame of the vector
* @param names array containing name of each individual vector element
* @param labels array containing label of each individual vector element
* @param uoms array containing unit of measure of each individual vector element
* @param axes array containing axis name of each individual vector element
* @return the new Vector component object
*/
public Vector newVector(String def, String crs, String[] names, String[] labels, String[] uoms, String[] axes)
{
Vector loc = newVector();
loc.setDefinition(def);
loc.setReferenceFrame(crs == null ? SWEConstants.NIL_UNKNOWN : crs);
Quantity c;
for (int i = 0; i < names.length; i++)
{
c = newQuantity(DataType.DOUBLE);
if (labels != null)
c.setLabel(labels[i]);
if (uoms != null)
c.getUom().setCode(uoms[i]);
if (axes != null)
c.setAxisID(axes[i]);
loc.addComponent(names[i], c);
}
return loc;
}
示例6: newRgbImage
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
/**
* Creates a fixed size 2D-array component representing an RGB image
* @param width
* @param height
* @param dataType
* @return the new DataArray component object
*/
public DataArray newRgbImage(int width, int height, DataType dataType)
{
DataArray imgArray = newDataArray(height);
imgArray.setDefinition(SWEConstants.DEF_IMAGE);
DataArray imgRow = newDataArray(width);
DataRecord imgPixel = newDataRecord(3);
if (dataType.isIntegralType())
{
imgPixel.addComponent("red", newCount(dataType));
imgPixel.addComponent("green", newCount(dataType));
imgPixel.addComponent("blue", newCount(dataType));
}
else
{
imgPixel.addComponent("red", newQuantity(dataType));
imgPixel.addComponent("green", newQuantity(dataType));
imgPixel.addComponent("blue", newQuantity(dataType));
}
imgRow.addComponent("pixel", imgPixel);
imgArray.setElementType("row", imgRow);
return imgArray;
}
示例7: init
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
@Override
protected void init()
{
int[] imgSize = getVideoSize();
SWEFactory fac = new SWEFactory();
// video output structure
videoDataStruct = fac.newDataRecord(2);
videoDataStruct.setName(getName());
Time time = fac.newTime();
time.getUom().setHref(Time.ISO_TIME_UNIT);
time.setDefinition(SWEConstants.DEF_SAMPLING_TIME);
videoDataStruct.addComponent("time", time);
DataArray img = fac.newDataArray(imgSize[1]);
img.setDefinition("http://sensorml.com/ont/swe/property/VideoFrame");
videoDataStruct.addComponent("videoFrame", img);
DataArray imgRow = fac.newDataArray(imgSize[0]);
img.addComponent("row", imgRow);
DataRecord imgPixel = fac.newDataRecord(3);
imgPixel.addComponent("red", new CountImpl(DataType.BYTE));
imgPixel.addComponent("green", new CountImpl(DataType.BYTE));
imgPixel.addComponent("blue", new CountImpl(DataType.BYTE));
imgRow.addComponent("pixel", imgPixel);
// video encoding
encoding = fac.newBinaryEncoding();
encoding.setByteEncoding(ByteEncoding.RAW);
encoding.setByteOrder(ByteOrder.BIG_ENDIAN);
BinaryBlock blockEnc = fac.newBinaryBlock();
blockEnc.setRef("/");
blockEnc.setCompression("H264");
encoding.addMemberAsBlock(blockEnc);
}
示例8: init
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
@Override
protected void init()
{
SWEHelper fac = new SWEHelper();
// build SWE Common record structure
imuData = fac.newDataRecord(4);
imuData.setName(getName());
imuData.setDefinition("http://sensorml.com/ont/swe/property/ImuData");
String localRefFrame = parentSensor.getCurrentDescription().getUniqueIdentifier() + "#" + MtiSensor.CRS_ID;
// time stamp
imuData.addComponent("time", fac.newTimeStampIsoUTC());
// raw inertial measurements
Vector angRate = fac.newAngularVelocityVector(
SWEHelper.getPropertyUri("AngularRate"),
localRefFrame,
"deg/s");
angRate.setDataType(DataType.FLOAT);
imuData.addComponent("angRate", angRate);
Vector accel = fac.newAccelerationVector(
SWEHelper.getPropertyUri("Acceleration"),
localRefFrame,
"m/s2");
accel.setDataType(DataType.FLOAT);
imuData.addComponent("accel", accel);
// integrated measurements
Vector quat = fac.newQuatOrientationENU(
SWEHelper.getPropertyUri("Orientation"));
quat.setDataType(DataType.FLOAT);
imuData.addComponent("attitude", quat);
// also generate encoding definition as text block
dataEncoding = fac.newTextEncoding(",", "\n");
}
示例9: TLEOutput
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
public TLEOutput(TLEPredictorProcess parentProcess)
{
this.parentProcess = parentProcess;
// create output structure
SWEHelper fac = new SWEHelper();
DataRecord rec = fac.newDataRecord();
rec.setName(getName());
rec.setDefinition(SWEHelper.getPropertyUri("TLEData"));
rec.addField("time", fac.newTimeStampIsoUTC());
rec.addField("satID", fac.newCount(SWEHelper.getPropertyUri("TLESatID"), "Satellite ID", null));
rec.addField("bstar", fac.newQuantity(SWEHelper.getPropertyUri("TLEBstar"), "B* Drag Coefficient", null, "m-1", DataType.DOUBLE));
rec.addField("inclination", fac.newQuantity(SWEHelper.getPropertyUri("TLEInclination"), "Inclination", null, "deg", DataType.DOUBLE));
rec.addField("rightAscension", fac.newQuantity(SWEHelper.getPropertyUri("TLERightAscension"), "Right Ascension", null, "deg", DataType.DOUBLE));
rec.addField("eccentricity", fac.newQuantity(SWEHelper.getPropertyUri("TLEEccentricity"), "Eccentricity", null, "1", DataType.DOUBLE));
rec.addField("argOfPerigee", fac.newQuantity(SWEHelper.getPropertyUri("TLEArgOfPerigee"), "Argument of Perigee", null, "deg", DataType.DOUBLE));
rec.addField("meanAnomaly", fac.newQuantity(SWEHelper.getPropertyUri("TLEMeanAnomaly"), "Mean Anomaly", null, "deg", DataType.DOUBLE));
rec.addField("meanMotion", fac.newQuantity(SWEHelper.getPropertyUri("TLEMeanMotion"), "Mean Motion", null, "deg/s", DataType.DOUBLE));
rec.addField("revNumber", fac.newCount(SWEHelper.getPropertyUri("TLERevNumber"), "Revolution Number", null));
this.outputDef = rec;
this.outputEncoding = fac.newTextEncoding();
// obtain an event handler for this output
String moduleID = parentProcess.getLocalID();
String topic = getName();
this.eventHandler = EventBus.getInstance().registerProducer(moduleID, topic);
}
示例10: init
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
@Override
public void init()
{
// SWE Common data structure
SWEFactory fac = new SWEFactory();
dataStruct = fac.newDataRecord(2);
dataStruct.setName(getName());
Time c1 = fac.newTime();
c1.getUom().setHref(Time.ISO_TIME_UNIT);
c1.setDefinition(SWEConstants.DEF_SAMPLING_TIME);
c1.setReferenceFrame(TIME_REF);
dataStruct.addComponent("time", c1);
Vector vec = fac.newVector();
vec.setDefinition(ANG_RATE_DEF);
((Vector)vec).setReferenceFrame(ANG_RATE_CRS);
dataStruct.addComponent("omega", vec);
Quantity c;
c = fac.newQuantity(DataType.FLOAT);
c.getUom().setCode(ANG_RATE_UOM);
c.setDefinition(ANG_RATE_DEF);
c.setAxisID("x");
vec.addComponent("gx",c);
c = fac.newQuantity(DataType.FLOAT);
c.getUom().setCode(ANG_RATE_UOM);
c.setDefinition(ANG_RATE_DEF);
c.setAxisID("y");
vec.addComponent("gy", c);
c = fac.newQuantity(DataType.FLOAT);
c.getUom().setCode(ANG_RATE_UOM);
c.setDefinition(ANG_RATE_DEF);
c.setAxisID("z");
vec.addComponent("gz", c);
super.init();
}
示例11: init
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
@Override
public void init()
{
// SWE Common data structure
SWEFactory fac = new SWEFactory();
dataStruct = fac.newDataRecord(2);
dataStruct.setName(getName());
Time c1 = fac.newTime();
c1.getUom().setHref(Time.ISO_TIME_UNIT);
c1.setDefinition(SWEConstants.DEF_SAMPLING_TIME);
c1.setReferenceFrame(TIME_REF);
dataStruct.addComponent("time", c1);
Vector vec = fac.newVector();
vec.setDefinition(ACCEL_DEF);
((Vector)vec).setReferenceFrame(ACCEL_CRS);
dataStruct.addComponent("accel", vec);
Quantity c;
c = fac.newQuantity(DataType.FLOAT);
c.getUom().setCode(ACCEL_UOM);
c.setDefinition(ACCEL_DEF);
c.setAxisID("x");
vec.addComponent("ax",c);
c = fac.newQuantity(DataType.FLOAT);
c.getUom().setCode(ACCEL_UOM);
c.setDefinition(ACCEL_DEF);
c.setAxisID("y");
vec.addComponent("ay", c);
c = fac.newQuantity(DataType.FLOAT);
c.getUom().setCode(ACCEL_UOM);
c.setDefinition(ACCEL_DEF);
c.setAxisID("z");
vec.addComponent("az", c);
super.init();
}
示例12: init
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
@Override
protected void init() throws SensorException
{
V4LCameraParams camParams = parentSensor.camParams;
// init frame grabber
try
{
frameGrabber = parentSensor.videoDevice.getRGBFrameGrabber(camParams.imgWidth, camParams.imgHeight, 0, V4L4JConstants.STANDARD_WEBCAM);
//frameGrabber.setFrameInterval(1, camParams.frameRate);
// adjust params to what was actually set up by V4L
camParams.imgWidth = frameGrabber.getWidth();
camParams.imgHeight = frameGrabber.getHeight();
camParams.frameRate = frameGrabber.getFrameInterval().denominator / frameGrabber.getFrameInterval().numerator;
camParams.imgFormat = frameGrabber.getImageFormat().getName();
frameGrabber.setCaptureCallback(this);
if (camParams.doCapture)
frameGrabber.startCapture();
}
catch (V4L4JException e)
{
throw new SensorException("Error while initializing frame grabber", e);
}
// build output structure
camDataStruct = new DataArrayImpl(camParams.imgHeight);
camDataStruct.setName(getName());
camDataStruct.setDefinition("http://sensorml.com/ont/swe/property/VideoFrame");
DataArray imgRow = new DataArrayImpl(camParams.imgWidth);
((DataArray)camDataStruct).addComponent("row", imgRow);
DataRecord imgPixel = new DataRecordImpl(3);
imgPixel.addComponent("red", new CountImpl(DataType.BYTE));
imgPixel.addComponent("green", new CountImpl(DataType.BYTE));
imgPixel.addComponent("blue", new CountImpl(DataType.BYTE));
imgRow.addComponent("pixel", imgPixel);
}
示例13: getRecommendedEncoding
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
@Override
public DataEncoding getRecommendedEncoding()
{
BinaryEncoding dataEnc = new BinaryEncodingImpl();
dataEnc.setByteEncoding(ByteEncoding.RAW);
dataEnc.setByteOrder(ByteOrder.BIG_ENDIAN);
dataEnc.addMemberAsComponent(new BinaryComponentImpl("row/pixel/red", DataType.BYTE));
dataEnc.addMemberAsComponent(new BinaryComponentImpl("row/pixel/green", DataType.BYTE));
dataEnc.addMemberAsComponent(new BinaryComponentImpl("row/pixel/blue", DataType.BYTE));
return dataEnc;
}
示例14: getDataType
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
@Override
public DataType getDataType()
{
if (uncompressedData != null)
return uncompressedData.getDataType();
return DataType.MIXED;
}
示例15: newImuOutput
import net.opengis.swe.v20.DataType; //导入依赖的package包/类
public DataRecord newImuOutput(String name, String localFrame, ImuFields... imuFields)
{
List<ImuFields> fields = Arrays.asList(imuFields);
DataRecord imuData = newDataRecord(3);
imuData.setName(name);
imuData.setDefinition(getPropertyUri("ImuData"));
// time stamp
imuData.addComponent("time", newTimeStampIsoUTC());
// angular rate vector
if (fields.contains(ImuFields.GYRO))
{
Vector angRate = newAngularVelocityVector(null, localFrame, "deg/s");
angRate.setDataType(DataType.FLOAT);
imuData.addComponent("angRate", angRate);
}
// acceleration vector
if (fields.contains(ImuFields.ACCEL))
{
Vector accel = newAccelerationVector(null, localFrame, "m/s2");
accel.setDataType(DataType.FLOAT);
imuData.addComponent("accel", accel);
}
// magnetic field vector
if (fields.contains(ImuFields.MAG))
{
Vector mag = newAngularVelocityVector(null, localFrame, "deg/s");
mag.setDataType(DataType.FLOAT);
imuData.addComponent("magField", mag);
}
return imuData;
}