Connections between grid and land

Complete many functions. But haven't been debuged yet.