City and Road Sample Data

This sample data set contains information on 110 towns and cities in Eastern North America and 181 major roads connecting them. Of course you can use your own data, but this may save time and I've already checked it for correctness and consistency.


The file cities.txt contains one line of text for each location. Each line contains four data items, and they are space-separated. The items are:
  1. Name of Town (spaces in the name have been replaced by dashes, and the two letter state or provice abbreviation has been appended to the end, e.g. New-York-NY).
  2. Latitude in degrees, as a floating point number. e.g. 40.669800.
  3. Longitude in degrees, as a floating point number, e.g. 073.943849.
    Wherever possible latitude and longitude are from the offical U.S. census gazetteer, and are extremely accurate, but describe a rather arbitrary point somehere inside the town.
  4. Population, as an integer. e.g. 7322564.
    For Canadian locations these figures are from the 2001 census, for U.S. cities they are from the 1990 census, except for a few locations which are not official cities but just road junctions with names. Populations include the surrounding urban area, not just the official city population.


The file roads.txt contains one line of text for each road segment. Some roads (e.g. I-95) are very long and appear in a large number of segments. Each segment connects exactly two towns or cities. Each line contains four data items, and they are space-separated. The items are:
  1. Name of road. e.g. I78. Names may not be unique: different segments of the same road usually have the sme name.
  2. Length in miles, as an integer. e.g. 10. I had to get the lengths by looking at a map, so couldn't manage any better accuracy.
  3. Name of city at one end of the road. e.g. Newark-NJ.
  4. Name of city at the other end of the road. e.g. New-York-NY.
    In every case, the names of the cities given in road descriptions are exact matches for the name of a city in the city data file.