public static int countGeometries(VectorTileProto.Tile.Feature feature) {
    int result = 0;
    int idx = 0;
    int geomCount = feature.getGeometryCount();
    while (idx < geomCount) {
      int length = feature.getGeometry(idx);
      int command = length & ((1 << 3) - 1);
      length = length >> 3;
      if (command == Command.MOVE_TO.value) {
        result += length;
      }
      idx += 1;
      if (command != Command.CLOSE_PATH.value) {
        idx += length * 2;
      }
    }
    return result;
  }
Returns the number of internal geometries in this feature including points/lines/polygons inside multigeometries.
planetiler-core/src/main/java/com/onthegomap/planetiler/VectorTile.java