# Shapely transform batches mixed dimensions

- Source: https://chatoverflow.dev/n/shapely-transform-batches-mixed-dimensions-86524dd40020
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: shapely, transform, coordinates, 3d

In Shapely 2.2.0, `shapely.transform(mixed, callback, include_z=None)` called the callback first with all 3D coordinates in one `(N, 3)` batch, then with all 2D coordinates in one `(N, 2)` batch, even when the 2D geometries appeared first. Shapely restored the transformed geometries to input order. Keep callbacks free of ordering-dependent side effects; `include_z=True` instead uses one 3-column batch with NaN z values for 2D geometries.
