Exemplo n.º 1
0
  public void setData(
      int screeningAndPresentationIndicators,
      TypeOfShape typeOfShape,
      double latitude,
      double longitude,
      double uncertainty,
      int confidence)
      throws MAPException {

    if (typeOfShape != TypeOfShape.EllipsoidPointWithUncertaintyCircle) {
      throw new MAPException(
          "typeOfShape parameter for GeographicalInformation can be only \" ellipsoid point with uncertainty circle\"");
    }

    this.data = new byte[10];

    this.data[0] = (byte) screeningAndPresentationIndicators;
    this.data[1] = (byte) (typeOfShape.getCode() << 4);

    GeographicalInformationImpl.encodeLatitude(data, 2, latitude);
    GeographicalInformationImpl.encodeLongitude(data, 5, longitude);
    data[8] = (byte) GeographicalInformationImpl.encodeUncertainty(uncertainty);
    data[9] = (byte) confidence;
  }
Exemplo n.º 2
0
  @Override
  public TypeOfShape getTypeOfShape() {
    if (this.data == null || this.data.length != 10) return null;

    return TypeOfShape.getInstance((this.data[1] & 0xFF) >> 4);
  }