Active matter shepherding and clustering in inhomogeneous environments.