Displace objects to surface
One easy way is to use a displace modifier with a heightmap. Then use 'UV mapping.' If you use a field of shapes, and set the UV for the top of each cylinder to zero size, then it will be flat on top.

Example blend: