Many moons ago, I graduated with a Post Graduate degree in Land Surveying. In those days, HP made the most fantastic calculators with reverse polish logic and brilliantly responsive buttons, computers cost $500,000 and were less powerful than an Ipod and I wrote my first program using cards that I marked up with a pencil (there was no keyboard). When I returned to university to undertake a Masters degree, a program appeared on the scene that would draw three dimensional pictures if you managed to arrange the information that the program liked to read. That was my thesis, organising and displaying three dimensional data on $50,000 plotters and even taking pictures of screens to make into a movie. I learned that programming drawings and managing spatial data was very tricky.
Which brings me to an early series of articles by David Saville on programming spatial data. If you do nothing else with this article, have a look at the code relating to the user data