Understanding urban–rural linkages from an ecological perspective