BEGIS - Brandeis Easy Geographical Information System ----------------------------------------------------- We organize data as a set of locations, each of which has the following attributes: INTEGER locid NOT NULL PRIMARY KEY: Location ID VARCHAR name NOT NULL UNIQUE: Brief name of the location, note that name might be something like "Reitman Hall", "Reitman First Hallway" VARCHAR desc NULL: Description of the location, e.g. what you'd use to describe it to someone you're giving directions to. (e.g. "the three-story brick building in North Quad, behind Cable", "the hallway") INTEGER bldgid NULL: Building ID, for cross-referencing with my.brandeis.edu/map/ INTEGER parentid NULL: ID of location that this is inside, for something like a hallway inside a building INTEGER prominence NULL: How prominent is this location? Higher for major landmarks. Will be very useful in selecting reference and verification points. Any reference point that you might want to use in giving locations should be a location. For instance, buildings with multiple exits on different sides and at different stories. It makes a difference whether you go out Reitman South Exit, which will take you into T Lot, or Reitman North Exit, which takes you into the middle of the quad. Note that this means that we'll probably have a lot of pissant little locations and will be revising things a lot as we discover new things that need to be made into locations. Any UI should reflect this. Maybe we'll also want to give locations an additional attribute, call it importance, that will let people control how detailed their directions are (so people who generally know where they're going can get directions like "Exit the building, go through Usdan, it's the big building straight ahead." whereas visitors can get directions like "Leave the building via the door at the northern end of the corridor, near room 101. Follow the path across the quad, down a small set of stairs. Soon you'll come to a road with a crosswalk across it and a bus stop on the other side; this is Peripheral Road. Across the road, you'll see a small group of buildings with a large open space in the middle. The building on the left is Usdan Student Center. Cross the road, and walk through the area in the center of the buildings. You should see three buildings, two in a group straight ahead of you and one a bit off to the left. The building directly in front of you, the right-most one in the group of two, is Schwartz." "The building on the left is Usdan Student Center" is an example of where the prominence attribute would be used. Hmm, that second set of directions is tricky, being able to generate that is probably something we'll want to keep in mind. Also, we have connections, which are used to describe links between locations. A connection between location A and location B has the following attributes: (By convention, loc1 will be the lower-numbered location.) INTEGER loc1 NOT NULL: ID of location A INTEGER loc2 NOT NULL: ID of location B INTEGER length NULL: Length of the connection. For instance, let's say that location 1 is Reitman 113, location 2 is Reitman First Bathroom, and location 3 is Reitman First Hallway. 113 is at one end of the hallway, the bathroom is in the middle. Some convention will be created for anything like a corridor where connections with it will need length, to pick what the length is in reference to. Let's say that our convention makes the side of the Reitman Hallway closest to peripheral road be where the origin is. Reitman 113 is near that end of the hall, so the length of connection (1,3) might be 5'. The bathroom is in the middle of the hallway, so let's say it's 20' from where we've set our origin. Thus, the distance between Reitman 113 and Reitman First Bathroom via Reitman First Hallway is |20'-5'|, or 15'. This will frequently be 0, for instance for the distance between Reitman Hall and Reitman South Exit. If this is NULL, there is not actually a connection between the two locations, but there is a relationship between them that you want be describe. e.g. you can't get directly from North Quad to Usdan Student Center, but in giving directions it is helpful to state that Usdan is directly across the road from North. VARCHAR reldesc NULL: Description of the relationship between the two locations, given as how you'd find loc2 standing at loc1. Look back at that extremely verbose set of directions given above. So, you'd have things like: reldesc("Reitman First Hallway", "Reitman Hall North Exit") = "at the northern end of the corridor, near room 101" reldesc("North Quad", "Usdan Student Center") = "across the road" Note that, given reldesc(a,b), finding reldesc(b,a) will probably be a difficult problem. UNIQUE (loc1,loc2) Alright, so given what we have so far, what would be the tricky bits in attempting to generate that long example? Forming nice pretty English sentences will be interesting, of course. It looks like we'll need to give each location a category, e.g. one categories for paths, another for doors, another for stairways. We might also need to do things like make a two-floor stairway have three locations: top, bottom, and "the stairway", so that we know what's connected to the top and what's connected to the bottom. That wouldn't be too much of a pain, it just means making a stairway with N egress points have N+1 locations. The bit "You should see three buildings, two in a group straight ahead of you and one a bit off to the left." is easier than it looks. That's just reldesc("Usdan Quad", "Schwartz"). Maybe we'll need a few different levels of reldesc, one terse and one verbose. An automated direction-giving system would likely end the directions with "Walk forward and enter [description of Schwartz].", which isn't really necessary in this particular case (since we've described the building in reldesc.) Well, that's a really tweaky thing, we'll worry about that later.