CPSC 333: How do We Represent Latitude and Longitude?

Location: [CPSC 333] [Assignments] [More about Problem to Model for Assignment #1] Representation of Latitude and Longitude


Question:

How do We Represent Latitude and Longitude?

For example, should be use a representation ?xxx.x where ``xxx'' is a number, and ``?'' is 0 for North, 1 for East, 2 for South, and 3 for West?

Answer:

You should try to avoid using ``codes'' to represent data, and so on, at this point (in the specification of requirements). Otherwise you might be making up ``implementation details'' (like schemes to be used for data storage and manipulation) and making them look like users' ``requirements.''

The ``latitude'' of any location on the earth is a real number that is between 0 and 90, together with either the letter ``N'' (for North) or ``S'' (for South).

The ``longitude'' of any location on the earth is also a real number that is between 0 and 180, together with the letter ``E'' (for East) or ``W'' (for West).

The system should be able to represent these real numbers to within an accuracy of at least one digit after the decimal point.

This is the information about latitudes and longitudes that your specification should convey.


Department of Computer Science
University of Calgary

Office: (403) 220-5073
Fax: (403) 284-4707

eberly@cpsc.ucalgary.ca