A Gemstone GIS
A Gemstone GIS
A Gemstone GIS
Abstract: Object oriented databases have been portrayed as being the solution for complex applications such as
Geographical Information Systems. Traditional database systems, such as relational, are not adequate for the
rich data types typically required from such systems. This paper discusses an application using object-
oriented database technology, detailing the schema used, problems encountered and benefits perceived.
44 ICEIS 2000
For GIS, spatial data is a key feature and can be commercial object-oriented database
regarded as more important than aspatial data, management system with a Smalltalk interface.
since this differentiates GIS from vanilla The format of the data suggested a design for
information systems [Maguire & Dangermound the initial object-oriented schema. Each dataset
1991]. A good system, however, will contain an contains three types of data: Points, which are
integrated database combining both the spatial three dimensional points representing features
and aspatial entities. In particular, the data such as spot heights or lighthouses; Lines,
model and data language should permit the use which are a set of three dimensional points,
of spatial and aspatial relationships. each line representing a segment of the feature,
such as a road or river and Areas, which are a
2.2 What Object-Orientation Offers set of three dimensional points, where the start
and end points are the same, such as lakes or
An OODB must first provide the features and urban areas.
functionality that we traditionally expect from a
For example, point data:
DBMS. Database features are typically not
found in the current breed of object-oriented 1POINT 156 1
programming languages, such as Smalltalk. 348033.75407000 318661.908200000 . 00000000
OODBs behave like object-oriented languages,
however the objects are persistent, that is, they line data:
remain after the program has terminated 1LINE 230 2
[Garvey and Jackson 1989]. Object-oriented 342380.00000000 21300.0000000000 . 00000000
languages offer richer data structures, which is 342320.00000000 321620.000000000 . 00000000
important for applications with complex data
such as GIS and an environment where systems area data:
can be developed rapidly through reuse. 1AREA 164 6
350000.00000000 314460.00000000 .00000000
Most commercial OODBs have either a C++, 350220.00000000 315160.00000000 .00000000
Smalltalk, or recently, Java interface. A C++ 350060.00000000 315220.00000000 .00000000
interface has the drawback that once the data 350000.00000000 315080.00000000 .00000000
structures have been set-up, it is difficult to add 349820.00000000 314520.00000000 .00000000
350000.00000000 314460.00000000 .00000000
new ones dynamically. This has important
ramifications for aspatial data in a GIS. A user
Simply adding the map data as it stands to the
may wish to add new structures at a later point
GIS is not sufficient. A point on the map may
to hold aspatial data and this would involve
appear in a number of lines or areas. This
recompiling the schema. Smalltalk on the other
occurs when more than one object can be found
hand allows classes to be created dynamically.
at a map reference. If the map consists of just
This has the disadvantage that the code is not
collections of points, lines and areas then
compiled, so will run slower.
answering the query “What objects are at point
X” will be a complex task. To deal with this
adequately each new point added to the GIS is
3. PROBLEM OUTLINE
added to a collection, which contains a point
representing every place in the map where there
The problem area studied was the
is at least one feature. Curiously this is a case
representation of typical information found on a
where the relational concept of a unique key is
map, for example, roads, rivers, urban areas,
of more help than the O-O concept of object
etc. The data source used was the Bartholomew
identifiers.
(BART) datasets exported from Genamap in a
simple portable format. The platform for A user of a GIS will wish to investigate the
implementing the GIS initially was GemStone relationships between different objects. In
[Butterworth, Otis and Stein 1991], which is a Smalltalk and GemStone, relationships are
Given the data identified above, there are Finally a Map class is used to tie the points,
basically three strands to the schema: Point lines, areas and network together from a
details, Map Features and Feature Code particular map set. The network class is used
definitions. for network analysis calculations.
Point is fundamental to the whole schema.
Smalltalk has a predefined class called Point, 5. GemStone SMALLTALK
which has much of the required functionality INTERFACE
already defined. Point, however, only applies to
two-dimensional data, some datasets may Servio’s GemStone and the ParcPlace
require the capability to support three- VisualWork's Smalltalk Interface have been
dimensional data, so a new ThreeDPoint class used to implement the GIS.
was introduced as a subclass of Point, with an
Within the GemStone Smalltalk Interface
extra instance variable z.
(GSI), there are two different worlds: Smalltalk
The discussion in section 3 highlighted a need and GemStone. The GIS application could be
for every point on the map to be related to all developed in either or both environments.
the features that can be found at that point. For Smalltalk provided a rich set of classes so the
example, at a given point there could be a river, front-end was developed using this. GemStone
bridge, traffic lights, etc. An extra class was used to store the data and provide the
GISPoint inherits from ThreeDPoint with an standard database functions required.
additional instance variable mapFeatures, which
holds the set of map features that are at that 5.1 Model-View-Controller Architecture
geographical location.
Figure 1 shows the structure, using ROME (a Interactive applications in Smalltalk are built
tool for object-oriented modelling [Barclay and using an architecture that identifies a model, a
Savage 1997]). The collection classes are view and a controller. This known as the
Model-View-Controller (MVC) paradigm
explicitly modelled in this representation,
because they exhibit behaviour which differs [Krasner and Pope 1988] and is the key to the
rapid development of graphical applications.
46 ICEIS 2000
MVC separates a graphical application into two the GemStone non-graphical front-end, Topaz.
parts: abstract application (or model) and the Loading large datasets into GemStone takes a
interface. This means the application and long time, for example, 340 hours for a 6MB
interface can be developed separately. dataset representing the north west of England.
Once loaded, starting the system is also slow,
5.2 Data Storage using GemStone approximately twenty minutes for the map of
the north west of England (cold start). A cold
Smalltalk on its own is sufficient for a small start when drawing a map is significantly
single-user system, as the data could be stored slower than when the data has been loaded into
in an image file. To realise the benefits of a memory. At the start of the project the
DBMS the Smalltalk environment must be performance of the system was acceptable,
linked to GemStone. adding more complex structures has revealed
GemStone gives more efficient access when it that the system is not scalable.
knows the data types of the instance variables Different experiments with using either the
(attributes). In contrast Smalltalk is a typeless objects or symbols as the key for lookups on the
language, which means it does not have to network tables has not improved performance.
know what the data types are. This leads to
some maintenance problems if any GemStone
classes are regenerated from the Smalltalk 6. ASPATIAL DATA
environment as this loses the type constraints.
Spatial data by itself is not sufficient for most
In the system described in this paper, Smalltalk GIS users, they also want the ability to add
handles all the application code and GemStone attribute, or aspatial data. For example, a Local
stores the data. Therefore the classes and Authority might want to store details of
behaviour were created in the Smalltalk roadworks and link these to the actual roads on
environment and the matching classes (without a map. Such data may already be stored in a
behaviour) were defined in GemStone. The relational database, such as Oracle. It is not
option of using forwarders was chosen. Here envisaged that this system will provide a direct
the classes required for storing the data are kept link to an external database, instead existing
solely in the GemStone database, whilst a data could be exported in a standard format
dummy class is created in the Smalltalk such as XML and loaded into the GIS.
environment, acting as a link to the real data. If
The current system allows a user to build their
any messages are sent to the dummy class, they
own classes. This involves using the meta-class
are forwarded on to GemStone for processing.
classes, the important ones being Class,
This saves the overhead of transferring the
Behavior, ClassDescription found under the
datasets from one environment to another. The
Kernel-Classes class category. The meta-class
non-dataset classes used in the view and
classes are the classes used by the system for
controller were not affected.
creating classes, methods, etc.
5.3 Performance Standard accessing methods are created next for
storing and updating each of the instance
Initially the data was loaded into Smalltalk and variables (setters and getters). Anything
then committed to GemStone. With small additional to these would have to be added by
datasets the time to do this could be measured the user independently.
in minutes rather than hours. Problems with
speed started occurring when the structures for 7. CURRENT STATUS
the network analysis were added and large
datasets were used. The data could no longer be Currently, the GIS displays two windows: an
added via Smalltalk because it took too long to information window for invoking options and
commit, instead it was loaded overnight using the map window for drawing the required map.
48 ICEIS 2000