Fix serialisation of Geometry, add Z and SRID if necessary