Search in sources :

Example 1 with SweVector

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));
}
Also used : SweQuantity(org.n52.shetland.ogc.swe.simpleType.SweQuantity)

Example 2 with SweVector

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;
}
Also used : SweVector(org.n52.shetland.ogc.swe.SweVector)

Example 3 with SweVector

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);
}
Also used : SweVector(org.n52.shetland.ogc.swe.SweVector) SweEnvelope(org.n52.shetland.ogc.swe.SweEnvelope) SweTimeRange(org.n52.shetland.ogc.swe.simpleType.SweTimeRange)

Example 4 with SweVector

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;
}
Also used : SweVector(org.n52.shetland.ogc.swe.SweVector)

Aggregations

SweVector (org.n52.shetland.ogc.swe.SweVector)3 SweEnvelope (org.n52.shetland.ogc.swe.SweEnvelope)1 SweQuantity (org.n52.shetland.ogc.swe.simpleType.SweQuantity)1 SweTimeRange (org.n52.shetland.ogc.swe.simpleType.SweTimeRange)1