use of org.n52.shetland.ogc.swe.SweVector in project arctic-sea by 52North.
the class SweEnvelope method createSweVector.
private static SweVector createSweVector(double x, double y, String uom) {
SweQuantity xCoord = new SweQuantity().setAxisID(SweConstants.X_AXIS).setValue(x).setUom(uom);
SweQuantity yCoord = new SweQuantity().setAxisID(SweConstants.Y_AXIS).setValue(y).setUom(uom);
return new SweVector(new SweCoordinate<>(SweCoordinateNames.EASTING, xCoord), new SweCoordinate<>(SweCoordinateNames.NORTHING, yCoord));
}
use of org.n52.shetland.ogc.swe.SweVector in project arctic-sea by 52North.
the class SmlPosition method getVector.
public SweVector getVector() {
if (!isSetVector() && isSetPosition()) {
SweVector v = (SweVector) copyValueTo(new SweVector(getPosition()));
v.setReferenceFrame(getReferenceFrame());
if (isSetName()) {
v.setName(getName());
}
return v;
}
return this.vector;
}
use of org.n52.shetland.ogc.swe.SweVector in project arctic-sea by 52North.
the class SweCommonDecoderV101 method parseEnvelope.
private SweAbstractDataComponent parseEnvelope(EnvelopeType envelopeType) throws DecodingException {
String referenceFrame = null;
SweVector lowerCorner = null;
SweVector upperCorner = null;
SweTimeRange time = null;
if (envelopeType.isSetReferenceFrame()) {
referenceFrame = envelopeType.getReferenceFrame();
}
if (envelopeType.getLowerCorner() != null) {
lowerCorner = parseVectorProperty(envelopeType.getLowerCorner());
}
if (envelopeType.getUpperCorner() != null) {
upperCorner = parseVectorProperty(envelopeType.getUpperCorner());
}
if (envelopeType.isSetTime()) {
time = parseTimeRange(envelopeType.getTime().getTimeRange());
}
// FIXME get the northing first value for the reference frame
boolean northingFirst = false;
return new SweEnvelope(referenceFrame, upperCorner, lowerCorner, time, northingFirst);
}
use of org.n52.shetland.ogc.swe.SweVector in project arctic-sea by 52North.
the class SweCommonDecoderV20 method parseVector.
private SweAbstractDataComponent parseVector(VectorType vector) throws DecodingException {
final SweVector sweVector = new SweVector();
if (vector.isSetLocalFrame()) {
sweVector.setLocalFrame(vector.getLocalFrame());
}
sweVector.setReferenceFrame(vector.getReferenceFrame());
sweVector.setCoordinates(parseCoordinates(vector.getCoordinateArray()));
return sweVector;
}
Aggregations