[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Question: non-xywrite...?



Here's how I'd do it.

Make a database. You should have one table for residents (each with an
identifying number) and for residences (ditto). The table for
residences should also have a column for the location expressed as x,y
coordinates (the map of the village should be plotted on a grid to
figure them out). You'll also need a table associating the residents
and the residences. Then any program that can draw should be able to
use the x,y coordinates of anything you want to put on the map (any
feature that's not a residence should be stored in another table. And
any computer language will be able to figure out the distances from
the x,y coordinates (plain old cartesian geometry).

Suggestion for tables:
-- KEY --
* = primary key (column which allows any row to be uniquely
identified: important!)
TABLE NAME
Table column

-------
RESIDENTS
Resident_ID *     integer
Family_name      string (varchar)
First_name       string (varchar)
Birth_date       date
Other_data (etc.)   (as appropriate)

HOMES
Home_ID *       integer
Address        string (varchar)
Location_x       number (float)
Location_y       number (float)
Date_of_construction  date
Other_data (etc.)   (as appropriate)

RESIDENT_HOME
Res_Home_ID *     intger
Resident_ID      foreign key: Residents.Resident_ID
Home_ID        foreign key: Homes.Home_ID
Start_of_residence   date
(or whatever else you want to store as info here)

If that's all greek to you, let me know and I'll try to find some
websites on basic database design.

e