Restrict certain material to section of terrain

I want to make a city scene, how would I restrict the grass material so it can only go around the houses or whatever and not spill out into the street?

You can paint it on (or out) with the landscape tools.

How do I do that though?

This may help you: