Added boundary segment functionality to TerrainLayer