Fix build warnings
This fixes a number of warnings. I'm setting this to Draft due to some test failures I need to investigate.
Together with the warnings fix in !236 (merged), the only remaining warnings are deprecated functions and missing mesh and raster source support in the xml surface.
Edited by Adrian Johnson