public void put(Geometry geom, T item) {
    if (geom instanceof Polygon poly) {
      // need to externally synchronize inserts into the STRTree
      synchronized (this) {
        index.insert(poly.getEnvelopeInternal(), new GeomWithData<>(poly, item));
      }
    } else if (geom instanceof GeometryCollection geoms) {
      for (int i = 0; i < geoms.getNumGeometries(); i++) {
        put(geoms.getGeometryN(i), item);
      }
    }
  }
Indexes {@code item} for all polygons contained in {@code geom}.
planetiler-core/src/main/java/com/onthegomap/planetiler/geo/PolygonIndex.java