public static GeometryType fromWKB(byte[] wkb) {
    var bb = ByteBuffer.wrap(wkb);
    byte byteOrder = bb.get();
    int geomType = bb.order(byteOrder == 1 ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN).getInt();
    return switch (geomType) {
      case 1, 4 -> GeometryType.POINT;
      case 2, 5 -> GeometryType.LINE;
      case 3, 6 -> GeometryType.POLYGON;
      default -> GeometryType.UNKNOWN;
    };
  }
Returns the type of a WKB-encoded geometry without needing to deserialize the whole thing.
planetiler-core/src/main/java/com/onthegomap/planetiler/geo/GeometryType.java