示例#1
0
  private byte buildRenderTagWayNodeCompressionByte(
      EnumSet<WayEnum> tags, int wayNodeCompressionType) {

    byte infoByte = 0;
    short counter = 0;
    if (tags != null) {
      for (WayEnum wayEnum : tags) {
        if (wayEnum.associatedWithValidZoomlevel()) counter++;
      }
      infoByte = (byte) (counter << 5);
    }

    if (wayNodeCompressionType == 0) {
      infoByte |= BITMAP_WAYNODECOMPRESSION_4_BYTE;
    }
    if (wayNodeCompressionType == 1) {
      infoByte |= BITMAP_WAYNODECOMPRESSION_3_BYTE;
    }
    if (wayNodeCompressionType == 2) {
      infoByte |= BITMAP_WAYNODECOMPRESSION_2_BYTE;
    }
    if (wayNodeCompressionType == 3) {
      infoByte |= BITMAP_WAYNODECOMPRESSION_1_BYTE;
    }

    return infoByte;
  }