Figure 15.8 The revised GIS class diagram
associated with only one record of the selected table. For example, the path
that links Rome to Brindisi is associated with the record whose ID is “ 1 ” and
name is “ Via Appia ”.
How should the object model and XML model be revised?
The class diagram in Figure 15.8 shows the three classes that record the
references to information in the GIS database. Class MapEntitySet has four
fields: the name of a database, the name of a table, the name of the attribute
that plays the role of table key and the name of the attribute that plays the
role of label. Similarly, class MapEntity has two fields that store the key
attribute's value of a specific table record and the value of the corresponding
label attribute. The three classes offer public methods to set and get the
values of their fields.
According to this object model, the associations between geographic
features and information extracted from the thematic databases are saved in
XML files as described in the example reported in Figure 15.9.
<GISMAP MAPNAME # "Roman History" FILENAME # ".\Rome.jpg"/>
<LAYER NAME # "Imperial Rome" COLOR # "Blue">
<SET TYPE # "LINK" DBNAME # "GIS.HistoricGeography"
DBTABLE # "Roads" DBKEY # "ID" DBLABEL # "Name" >
<ENTITY ID # "1" LABEL # "Via Appia" >
<POINT X # "286" Y # "236"/>
<POINT X # "269" Y # "252"/>
<POINT X # "263" Y # "260"/>
Figure 15.9 The revised XML file of a cartographic map