This chapter prophesies a time when Israel will be disobedient to Yahweh and he will have to punish them. This is meant to serve as a warning to the nation.
Possible meanings are 1) Yahweh is speaking to the inhabitants of heaven and earth or 2) Yahweh is speaking to the heavens and earth as if they are persons.