Fix #10999 (reshape tool throws GEOS exceptions)

Exceptions fixed earlier by @mkuhn in 37f1a1
Numerical problems found by @arnaud-morvan, corrected by @jef-n