
open(path, 'r', layer=None)

if path exists and is a datasource, we try to find a layer. If layer=0, we get the first layer (index 0). Else, we
try to get the specified layer.

open(path, 'w', layer=None)

if path exists and is a datasource, we try to create a new layer in the datasource.

If layer is None, we overwrite the first layer, deleting it if present and creating a new one.

if layer is not None, we overwrite the existing layer. As above.

if path is not a datasource, we create a new one and a layer.

