The Panama Canal opened for business 100 years ago this month. By 2005, 5% of the world's seagoing traffic crossed it, including 70% of the cargo heading in and out of the United States. It remains, even today, a technological and logistical marvel.
This time-lapse video from ZipCams illustrates that by showing a day of traffic (April Fool's Day, 2012) through the Miraflores Locks. You can watch live camera footage of those locks here.
-via Gizmodo
As to how they surveyed it, they set up a geodetic network based on triangulation. There were several surveying teams (US and French) which went to the area to survey it, establishing triangles across the isthmus. Perhaps the greatest example of this kind of work in the 1800s is the Great Trigonometrical Survey of India, of which there are several books if the topic interests you.
Somehow they had to know that before they started digging their trench, otherwise, once they broke through to the water, the ocean on one side would have immediately poured into it and overflowed the ocean on the other side.