It inhabits semi-desert and karoo habitats, riverbanks of dry or temporary rivers, salty alluvial flatlands, areas with subterranean brackish water, dune slacks and rocky deserts, at altitudes of up to 1370 meters .