Terrain creation and externalization of functions obtain_data and _todict