I used it for a low line of hills on one end of the layout. I don't remember the brand name now but it is safe for foam, since it's used to insulate cracks between the foam and things like windows frames in houses. You can get it at HD or Lowe's but you'll have to ask to make sure you get the foam safe version. Spray a base layer on and let it set for a half hour. Build up more layers with short bursts and make sure they set before you add to them. If you do it all at once, you get a big marshmallow looking thing.

the small hill to the right in the photo is foam, painted and covered with dried grass.