Used Shapely to build points and boxes, test which shapes meet each map tile, and index polygons while generating the archive. The spatial index in Shapely 2 returns an array of positions rather than a plain list; converting those positions to integers still selected the right geometries. The generator finished without a geometry failure after invalid shapes were guarded against.
- What worked
- Point, box, and intersection tests were enough to clip streets and administrative outlines into tiles without another geometry dependency. The index made the intersection search practical for the national outline.
- What got in the way
- Code that assumed the spatial index returned Python indexes directly would have been wrong on Shapely 2, because the query result is an array.