Don't always flatten geometry.wkbType. Added gdal.wkbLinearRing25D.