Monday, August 29, 2011

Smallworld Technical Paper No. 11 - Use of an Integrated CASE Tool for GIS Customization

by Gillian Kendrick and Peter Batty

Abstract

The implementation of large corporate GIS systems places heavy demands on the customisability of GIS products. This paper examines the use of an integrated CASE tool in GIS customisation. The authors start by discussing some of the common problems which designers of GIS systems face in developing new applications. The paper describes the or features which a CASE tool should include in order to address these issues. The similarities between the technology which can be used to underpin both a CASE tool and a GIS will be mentioned.

The paper describes the practical use of a CASE tool in application development. It also discusses the management of multi-user application development and the benefits gained from utilising a CASE tool in the development process. It is shown that the use of an integrated tool facilitates the adoption of a new incremental design methodology.

Introduction

One of the greatest costs in large GIS implementations is that of customising the basic system to meet an organisation's specific requirements. There are many aspects to this customisation. The user interface of the system may be tuned to speed up data capture or else to streamline the execution of particular queries. The way in which object's spatial attributes are displayed must be specified. However, one of the most significant parts of any customisation involves the design and maintenance of the application's data model.

Data modelling is a complex task for most computer applications, but this is particularly true in GIS for several reasons. The first of these is the large number of classes of objects which are involved in these systems. Each implementation will typically involve hundreds of different object classes. The second factor is the number and variety of relationships between these objects. Relationships are of three main types: aggregation and association, e.g. a building is 'part of' a school; spatial, e.g. a house is 'near to' a lake; and topological, e.g. a valve is 'connected to' a pipe. Of these types, only the first may be explicitly represented in terms of traditional relational joins. The others will be derived indirectly from spatial attributes of the objects or else through the interaction between these spatial attributes.

For many organisations, the GIS will only form a part of the corporate computing system. There will be existing data bases holding data such as customer information. Some of this data may be relevant to the GIS, and therefore part of the customisation will involve integrating these existing data models with that of the GIS (Bundock & Theriault 1992). This integration will again increase the size and complexity of the overall design.

Another aspect of GIS implementations, which has an impact on the maintenance of the data model, is that user requirements change. GIS projects typically have quite long life cycles, and the technology is relatively new to most users. This means that at the outset of the project they may not realise the full capabilities of the system. As new applications are developed and added to the system, changes are required in the data model.

Since GIS projects involve capturing large amounts of data, it is critical that these changes to the data model can be made without losing or compromising any data which is already stored in the system.

With most traditional GIS software, data model evolution is a difficult issue. This has meant that a long period of time has been spent at the beginning of the project on requirements analysis and data model design to try to make sure that it is exactly right, which of course is rarely achieved. This has had to happen before any other work could begin, meaning that there has been a very long delay for users between the purchasing of a GIS and the start of productive use of the customised system.

This paper describes how an integrated CASE tool can be used to address all of these data modelling issues. This in turn radically changes the way in which one can approach the problem of customising a GIS, using an interactive design methodology.

What is a CASE Tool?

The acronym CASE stands for Computer Aided Software Engineering. It is used to describe a variety of computer-based tools which can be used to assist in the design and development of computer programs. Such tools have been developed for various purposes including the analysis and documentation of procedures and data flows, and the design and documentation of a data model. It is the latter function which we consider in this paper as this is the most appropriate kind of tool to help with GIS customisation.

A CASE tool which is to be used for data model design must display a graphical representation of the model. This is usually in the form of an entity-relationship diagram which shows the entities, or classes of objects, and the relationships between them. Such a facility gives the designer a good picture of a large design. The tool allows plots of the diagram to be made. These can be included as part of the documentation of the overall design.

The tool allows the designer to interact with the spatial representations of object classes and relationships. A graphical user interface (GUI) provides an environment in which the attributes and behaviour of the objects and relationships can be edited and queried. The tool produces automatic documentation on selected parts of the design.

One of the ways in which a CASE tool can reduce the time taken to implement a design is by automatically generating the code which creates the data model. This facility has two main benefits. Firstly the designer no longer has to worry about implementation details; he can concentrate on the task of data modelling. Secondly, the automatic code generation speeds up the process of creating data mode]s, and avoids programming errors.

The tool should also provide facilities which enforce the correctness of the data model. It should validate that the design is consistent. Checks made by the tool at the design stage will reduce the amount of time spent in tracing bugs by the designers at a later date. This will again speed up the delivery of finished applications.

This section has described general requirements for a CASE tool which is to be used for data model design. The next two sections describe in more detail some of the requirements for CASE tools which are to be used in GIS. The first section covers general requirements for tools for GIS data model design. The second considers the extra requirements for an integrated tool and covers some of the benefits provided by such a tool.

CASE Tools for GIS

Multi-User Design

It was mentioned in the introduction that one of the reasons for the complexity of GIS data models was that they involved a large number of classes of objects. It will usually be the case that more than one designer will be involved in the development of these objects, their relationships and their behaviour. This means that it is important that the tool used to develop the data model is multi-user.

Each designer should be able to work on additions or modifications to the data model without being affected by changes which others are making to different parts of the design. These changes will also be made over a long time scale - maybe hours, days or weeks. The designer may wish to try out several alternative versions of the data model in order to settle on a best design. When a new part of the model has been completed or re-engineered, the tool must offer support for 'merging' the new work in with the rest of the design.

The requirements of CASE tool database technology in this area, involving long transactions and version management, are very similar to those of GIS. (Easterfield, et al. 1990).

Modelling of Spatial Data and Topological Relationships

GIS data models are special because they require the user to model spatial attributes of objects. New data types such as point, area, chain, raster and grid are supported. The tool also models the topological relationships which will exist between some objects. For example a valve location 'connects to' a pipe centreline, a land parcel 'shares' its boundary with another land parcel.

These aspects of GIS data models should be supported in a CASE tool which is to be used in GIS customisation.

Integrated CASE Tools for GIS

For high level conceptual design, it is not necessary to have a close coupling between the CASE tool and the DBMS used to implement the system. However, if the CASE tool is to be used for the physical database design and to generate code, then a much closer link is required between the tool, the DBMS, and the application development environment used to implement the actual system. The requirements for the tool if it is to achieve this higher level of integration can be separated into two parts.

First, the CASE tool must support all of the data modelling concepts supported by the GIS. These include things such as the datatypes, relationships and other system specific concepts such as triggers, validators, and enumerators. For object oriented systems, the CASE tool should also manage the behaviour for the object classes (Booch 1991). In particular for GIS the CASE tool needs to manage spatial information and topological relationships. The CASE tool may extend to covering aspects of the user interface of the application, such as which fields are visible to the user and what sort of interface is used to edit objects and their individual fields.

Second, the CASE tool must generate code in an appropriate format which implements the data model which has been designed. in the case of the work reported here, the tool produces a script in the language Smallworld Magik.

These requirements are to a certain extent independent of each other. If the first one is met, but not the second, then it is at least possible to use the CASE tool to do the logical design for the system, but the code to implement this then has to be written manually. on the other hand, it is possible to have a CASE tool which supports a subset of the concepts supported by the DBMS (with GIS, for example, a CASE tool which supports alphanumeric datatypes but not spatial datatypes). This could be made to output code in an appropriate format for the DBMS, but further development work would then be required in the DBMS environment (outside the CASE tool) to incorporate any of these additional concepts in the application. In this situation it is likely to be much more difficult to usefully maintain the data model using the CASE tool after its initial creation, since it does not know about any of the changes which have been made to the data model within the DBMS environment. Clearly, the CASE tool is much more useful if it meets both of these requirements in full.

A CASE tool which can generate the data model for a GIS application automatically is a very useful part of a development tool kit. There are two more facilities however which are necessary in order to make the tool truly useful for corporate GIS design.

Integration of Existing Data Models in the GIS Data Model

Something that was mentioned in the introduction to this paper is that a common requirement in GIS implementations is that existing (legacy) databases, and therefore data models, should be integrated into the system. It will often be the case that there are relationships between objects which have been created as part of the GIS and those which belong to these other databases.

As an example consider a large utility company that has a customer information database. It is undesirable to move this data to the GIS as many other applications will already be designed to run on it. Part of the requirement of the GIS application is to associate spatial information with those customer records.

To facilitate this integration, the CASE tool can 'reverse engineer' the data models from these existing databases. The objects can then be integrated into the whole design within the domain of one tool.

Maintenance of the data model

GIS applications involve large amounts of data, and as mentioned before, they are also particularly prone to having the user requirements change during the life cycle of the project. If a change in the user requirements means that the data model must be modified, then it is essential that facilities are provided to 'forward engineer' the populated database to be consistent with the new datamodel.

A common feature of CASE tools is that they generate the code which creates a design. It is less common to generate the code which will 'forward engineer' an existing design when the data model definition held in the tool has been changed. A CASE tool for GIS should offer support to evolve a database from one schema to another.

Features of an Integrated CASE Tool for GIS

Based on the previous sections, we can summarise that an integrated CASE tool should have the following features:

  • Support all of the data modelling concepts which are supported by the GIS DBMS
  • Generate the code which will implement the data model in the GIS DBMS 'reverse engineer' existing data models so that their schema can be integrated into the overall design for the system
  • 'forward engineer' populated databases when the design of the objects and relationships is updated.

Such a tool provides significant benefits in the speed of GIS customisation and also in the maintenance of the applications throughout their life cycles.

Similarities Between a GIS Application and a CASE Tool

Several of the capabilities provided by a CASE tool are similar to those which are found in a GIS.

Firstly, in both systems, the user creates objects which combine both spatial and alpha-numeric attributes. In the GIS, these objects are things such as houses, pipes or rivers. The alpha-numeric attributes of a house are things such as its address and owner, and its spatial attributes are its position and footprint. In the CASE tool, the objects which the user works with are the definitions of the classes of objects which are to be used in the GIS application. For example, a CASE tool object has an alphanumeric attribute which holds the name of an object class, this could be 'House'. The spatial attributes of these objects are used to position them in the entity-relationship diagrams. Similarly, the CASE tool stores relationship objects, their attributes would include the type of the relationship, e.g. 'part of' or 'connected to'.

In both the CASE tool and the GIS, users can query and edit the properties of the objects through a GUI. This interface provides facilities for plotting and reporting.

One of the areas in which a GIS and CASE tool are most similar is in their need to provide support for multi-user working in a long transaction database. This should not be surprising as both systems are used as design tools as well as information systems.

The Smallworld CASE Tool

After a consideration of the benefits of using an integrated CASE tool, and a survey of the tools currently available on the market, Smallworld chose to implement its own. Because of the similarities outlined above between GIS and CASE, it was possible to implement the tool as a specific GIS application with its own data model.

Working with the CASE Tool

The tool is activated during a normal GIS session. The designer can have both the GIS application and the CASE tool running at the same time.

[Figure not yet available]

Figure 1. Integration of GIS and CASE in one environment

Application Development with the CASE Tool

Smallworld GIS contains a powerful data dictionary which supports many advanced data modelling features. These include the definition of new data types, triggers and validators. The data dictionary is capable of storing the definition of object classes, their attributes, behaviour and also the details of the topological and associative relationships between them. The data dictionary can manage many different versions of a data model and allows the designer to look at these different versions within one GIS session.

The CASE tool operates directly on the GIS application's data dictionary. If the GIS application involves integration with external databases, the data models held in these databases are reverse engineered into the tool. Once present in the tool, the user can add spatial attributes to the objects, and can also define relationships between them and the objects which live in the main GIS database. The user can also add behaviour to these external objects.

The CASE tool supports a steady progression from a logical to a physical definition of the required data model. It does not demand that the data model is completely defined but will advise on areas which are not yet complete. Facilities are provided which allow the designers to document the model extensively as they are working.

Developing the Data Model

As already mentioned, the CASE tool is a multi-user facility. We will now describe how many users can work on the same model.

[Figure not yet available]

Figure 2. Version management of both schema and GIS data

In figure 2, the boxes to the left of the dotted line represent the different alternatives in the CASE tool's database. Beneath the Top alternative there are two others where the designers Phil and Betty can work independently. The user Phil also has another two sub alternatives where he can try out different designs. The area to the right of the dotted line shows the alternative tree in the main GIS application. Beneath the Top, there are two alternatives Live Data and Test. The alternatives beneath the Live Data alternative are those where the GIS application is being used. The GIS applications may include data capture, analysis of existing data and design. The part of the tree under the 'Test' alternative is used by CASE designers to try out their developments. When Phil decides that he has completed a part of a design in the alternative 'Design 1', he can make the CASE tool 'apply' the new data model to the alternative 'Test 1'. At this point, he can immediately start testing the new data model in the GIS application. If after testing, the new part of the design is found to be a success, the changes he has made can be 'posted' up to the Top of the CASE database. If the design was unsatisfactory, he can proceed to improve it and then 'apply' the new changes.

When changes have been made to the design which have been thoroughly tested they can be applied to the Top alternative of the GIS application's database. That alternative will have its data model forward engineered'. Data model changes then spread through the alternative tree as users at lower alternatives request to see them.

[Figure not yet available]

Figure 3. Part of a GIS application's data model

The use of an integrated CASE tool in GIS allows designers to develop data models iteratively. There no longer needs to be such a great reliance on getting the design right first time. This in turn means that the end users can rapidly be presented with a prototype system which allows them to more easily understand what the system can offer. They are therefore able to offer much more feedback in the design of the system, leading to the development of systems which are much better suited to their requirements.

Data Model Re-use

Another feature of the CASE tool is that it facilitates the re-use of pieces of design. It can archive complete sections of data model in a format which can be read in by another tool. This has enabled the setting up of a library of designs. This greatly speeds up the development of new applications as they rarely have to be designed from scratch. An existing 'template' data model can be loaded in to an applications CASE tool and this can be thought of as the first prototype.

Conclusions

Since Smallworld commenced using an integrated CASE tool for application development the following benefits from this approach have been found:

  • Customisation of the system has been made more accessible. The tool has reduced the size of the knowledge barrier which designers have to overcome, as they no longer have to be trained in how to talk to the underlying DBMS directly. They can instead spend more of their time with design considerations. This means that more people are able to customise the system with less initial training
  • The tool has enabled the creation of applications which better meet the customer's requirements through the interactive development approach. Users are given the chance to interact with a version of the application at an early stage. They can then refine their requirements, the developers can evolve the design and the tool will evolve the database.
  • Designs are more easily re-used. The archiving facility in the Case tool allows parts of designs to be stored in a form where they can be loaded in to another tool. This means that a library of commonly used parts of designs can be set up. When a new application is being developed, much of the initial data model can be created from these standard components. This has two main benefits: firstly the development time for new applications is greatly reduced; secondly, the quality of developed applications is improved. Time invested in improving the quality of the basic data model components leads to improvements in the overall system quality.
  • Multi-user working is easier to manage. It is always a difficult problem when many designers are working on the same project to avoid duplication of effort, and conflicts between their different designs. The CASE tool aids in these problems by incorporating a number of validation and completeness checks which will prevent the design from becoming inconsistent. The users can develop parts of the data model independently in separate alternatives. When they incorporate these into the total design by merging' their changes, the DBMS automatically spots any conflicts in the design which the designer has introduced and allows him/her to reconcile them.
  • An Incremental development methodology means that designers can get production systems in place much more quickly.

References

Booch, G. (1991) Object Oriented Design with Applications. Benjamin/Cummings, Redwood City California, 1991

Bundock, M. & Theriault, D. (1992): Integration Of Case Technology into the GIS Environment, in AGI92 Conference Papers, Birmingham, November 1992

Easterfield, M., Newell, D.G. & Theriault, D. (1990): Version Management in GIS - Applications and Techniques, EGIS 90 Conference Proceedings, Amsterdam, April 1990.

Smallworld Technical Paper No. 10 - Discrete Geometry with Seamless Topology in a GIS

by R. G. Newell and M. Doe

Abstract

Modern GIS systems go to great lengths to model a seamless world containing a rich topological model. However, there is a requirement, particularly among utility companies such as electricity and telecommunications companies to model their network in both geometric and, possibly, multiple schematic coordinate systems. The schematics may hold an alternative representation or a detail of par of the network. This paper describes an elegant method of modelling such situations so that topology is handled seamlessly and data common to the alternative

representations is not replicated. The technique, known as 'multiple worlds , is a natural and straightforward extension of the spatial indexing techniques used to handle a seamless database efficiently. One of the benefits of the approach is that any network analysis application written to work in a single coordinate world will work unchanged in a multiple world situation. Applications include the integration of electricity substation schematics within a geographic database, facilities management, multi-sheet schematic applications such as power systems diagrams as well as P&ID diagrams in chemical plant applications.

Introduction

The work reported in this paper was carried out as a result of the requirement to model complex network applications, particularly in the electricity supply and telecommunications industries. The ideas presented have been developed within Smallworld GIS. Smallworld GIS is one of a number of systems whose origins lay more in database management foundations than in file and CAD foundations (Chance et al. 1990, Easterfield et al.1990). In such systems, the underlying principle is that the GIS manages a single logical database that manages both spatial and aspatial data together. The principle extends to cases where the data is held in multiple existing (legacy) databases.

One of the benefits of this approach is that the spatial data can be modelled as it really is - a seamless carpet of topologically structured geometry. Such an architecture requires different solutions to those implemented in tile-based systems. In particular, spatial organisation is very important so the system gives a good response time for spatial queries on very large seamless databases. There are many successful spatial indexing schemes (Abel 1983, Abel 1984, Batty 1990, Bundock 1987, Guttman 1984, Kriegel 1990, Libera 1986, Newell 1991, Samet 1989, Seeger 1988, Smith 1990). In this paper we briefly describe the method employed in Smallworld GIS. For a fuller explanation see Newell et al. 1991.

Although much has been written about managing spatial data within one coordinate system, less has been written on managing data in multiple coordinate systems, including cases where there is a topological structure, but possibly no corresponding spatial coordinate data: for example, a complex junction where a large number of inputs are connected to corresponding outputs using a connection'matrix'.

A common example of multiple coordinate systems in the electricity supply and telecommunications industries is schematic diagrams of parts of a network where there is too much detail to represent the structure in the 'geographic' coordinate system. Such a case arises with substation schematics. Figure 1 shows such an example, where a substation at Barnes Road has 3 separate representations, one geographic and 2 schematic, as well as a duct containing cables represented geographically and as a cross-section.

[Figure not yet available]

Figure 1: Geographic, schematic and cross-section representations

On the face of it, one might think that a tile-based architecture is more suited to handling such situations, since presumably such systems have ways of handling connections across tile boundaries. We hope to go on to show in this paper an elegant approach that maintains connections across multiple coordinate systems without incorporating any other compromises into the system.

Handling Topology

Smallworld GIS models the world as a collection of objects that have relationships and attributes. Complex object relationships are modelled by one-to-one, one-to-many or many-to-many relations that are defined in a CASE tool. Object attributes are aspatial (represented as numbers or characters for example) and spatial (represented as points, chains and areas). An aspatial attribute may be defined as a 'logical' attribute; such an attribute is not defined in the database, it is always derived by a method on the object when needed.

[Figure not yet available]

Figure 2: Smallworld Object Structure

Topological relationships are modelled by points, chains and areas sharing nodes, links or polygons. A chain consists of a linear sequence of links (xy or xyz coordinate strings) and an area consists of a contiguous set of polygons. The two level structure allows for a much richer modelling of topology than a layer based approach. Figure 2 shows an idealised representation of the structure underpinning the Smallworld topology model. One object may have multiple geometries and many objects may share one geometry.

Spatial Organisation

The Smallworld GIS Version Managed Datastore holds all of its spatial and aspatial data seamlessly; there are no tiles or layers. The basic storage structure is tabular, but unlike a conventional relational database, the access language is the object-oriented language, Smallworld Magik. Fast spatial retrievals are achieved by means of an improved quadtree indexing technique, which neither complicates nor compromises the logical data structure described above. The primary key of all spatial data contains an automatically generated 'spatial key'. The method both clusters data spatially on disk and provides an efficient index; Figure 3a illustrates how a simple quadtree index can sometimes produce an inefficient index. Figure 3b illustrates the overlapping quadtree index in which a small overlap produces additional digits in the key.

[Figure not yet available]

Figure 3a: Traditional Quadtree Index

[Figure not yet available]

Figure 3b: Smallworld Overlapping Quadtree Index

Because the spatial key is not necessarily unique for two objects in proximity, it is extended by an automatically generated unique identifier (see figure 3c).

       Quadtree key Unique id       Figure 3c: Unique spatial key 

Multiple Worlds

Although it is essential in many cases to model a seamless real world with a seamless geographic database, there are also cases where some information needs to be handled in a different coordinate system - a different world. Examples include applications where part of the model is represented as a drawing schematic, either as an alternative representation or as an expanded detail of part of the geographic world. An example of the latter is a schematic that represents the internal structure of an electricity substation. In such cases, although the geometry may be spread across different coordinate systems, it is important to handle the topology seamlessly, so that applications such as network analysis can work across multiple worlds unhindered by modelling artifacts.

Implementation

Smallworld GIS handles multiple worlds as an extension to the quadtree indexing scheme described above. The spatial index can be extended to include extra high order bits. In this way topological tracing operations work in an identical manner regardless of whether the geometry is in a single coordinate system or multiple coordinate systems. Figure 4 shows how the spatial key is extended to handle multiple worlds,

       World Id Quadtree Key  Unique id       Figure 4: Structure of Smallworld spatial       index. 

A further extension of this idea allows the data to be partitioned according to various non-spatial criteria. In Smallworld GIS, this technique is used to control both drawing priority and to implement the idea of multiple worlds. A number of high order bits are reserved to store a world ID. The next block of bits is reserved to store drawing priority (see figure 5).

The clustering properties of the spatially indexed database will ensure that all geometry in a particular world will be clustered on disc and it is therefore very efficient to scan for geometry within one world.

The spatial scanners, used by the GIS in hit-searching and in screen refresh, can be constrained to find data which has a particular world ID. Hence, viewing and interaction with the spatial database is made world-specific.

Types of World

There may be many types of world in a GIS. Each world type typically has a different meaning for the geometry it contains.

Geographic worlds represent the location of objects in the real world. This geometry may or may not have associated topology.

Schematic worlds have geometry which represents the existence of objects and possibly their topology, but does not carry any real-world positional information.

Cross Section worlds are essentially geographic, i.e. geometry represents real world locations of objects, but use a coordinate system in which the x axis represents distance along some arbitrary direction and the y axis represents vertical position.

Worlds and Universes

There are a fixed number of bits available to be shared between the spatial index, drawing priority and world ID.

The number of bits used for the spatial index (together with the overall extents of the scanned area) determines the size of the smallest quad-tree box and hence the resolution of the quad-tree. This, in turn, affects the efficiency of hit-searching and graphics re-draws. In a world which is densely populated and which has many geographically small objects, a relatively fine resolution would be required. Conversely, a world with very little geometry, or with very sparse geometry, can be scanned with coarser resolution.

The number of bits used for the world ID and for drawing priority determines the total number of worlds and priorities that can exist in the database. Hence, there are competing requirements which have to be juggled to achieve a compromise allocation of bits.

Using the topmost few bits of the spatial index to store a 'universe id', each 'universe' uses a different allocation of the rest of the bits. This allows each universe to contain worlds with certain characteristics. A geographic universe may contain just one world and hence uses its remaining bits to obtain maximum spatial resolution. A substation internals universe or cross-section universe would need to contain a large number of worlds, but each world is small and has little geometry in it. We can therefore use up a large number of bits to store the world ID, leaving relatively few for the spatial index without performance loss. A universe for network schematics lies somewhere between the previous two examples: there may be a relatively small number of schematic diagrams and the diagrams will be relatively sparsely populated compared with the geographic world. Figure 5 shows the full structure of the spatial key.

  Universe  World  Drawing      Quadtree  Unique   Id        Id     priority     Key       id 

Figure 5: Complete structure of spatial key

Alternative Representations of Objects and Networks

An object may be represented in several worlds and it may take a different form in each. For example, an electricity substation is represented in the geographic network by an area which is its boundary. In a schematic diagram, however, the substation is represented as a collection of transformers, busbars and switches.

A cable or pipe may be represented by its centre line (chain) geometry in the geographic world, but by a point in the world owned by a cross section object. The cable may appear in many cross sections.

A network may also have more than one representation. An electricity network, for example, may be represented in the geographic world by a connected network of cables, overhead lines and joints, and in a schematic world as a connected network of load sections. Both collections of geometry describe the same network.

Connections Between Worlds

Topological connections from one world to another may be made with a special object called a hypernode. This object has two point geometries, one in each world. This allows network traces to jump from world to world. For example, a network trace in an electricity network may arrive at a substation, jump into its internals world follow the geometry related topology inside it, then jump back out into the network again.

Hypernodes are a simple example of a multi-pin device and can be given special behaviour to change the trace state, or to prevent certain types of trace from jumping.

Complex Objects

An object may have a very simple representation in the network but may have considerable internal topological complexity which is hidden from the outside world. This internal topology may be implemented in a number of ways:

Objects with Internals worlds

Each object owns its own internals world. The internal topology of the object is associated with geometry in that world.

For example, an electricity substation has components: busbars, transformers and switches, which have their geometry in the owning substation's internals world. These components form an internal topological network for the substation.

Multi-pin-devices

These are objects with several connection pins (point geometries). The number of pins may be fixed, as in a simple switch or junction box, or dynamically variable - pins may be added or removed as required by the user.

External connections to the network are made to these pins, but the internal topology of the object is encapsulated as behaviour on the object itself. This topology may be implemented as a hard coded set of rules, which may refer to attributes of the object itself or to other conditions, or as a connectivity table which may be updated by the user.

For example, the following pseudo-code describes a method on a simple switch object which responds to the message 'connectivity_trace' from the network tracer.

      method simple_switch.connectivity_trace(pin)       if self.closed       then if pin = input_pin            then return output pin            else return input_pin            endif       else            return unset       endif 

A multi-input/output junction box may have an associated connectivity table. When asked for output pins connected to a particular input pin, the junction box will perform a lookup of this table and return a number of pins. Records may be added to or removed from this table as connections are made or broken in the junction box.

Objects with trace behavior

These are objects with simple, geometry related topology but which have behaviour which modifies that simple topology in some way.

For example, a road_junction may have a single node in the road network, which may be connected to several roads. However, when asked for exit roads given a particular approach road, the junction object overrides the simple topology (in which all roads which join that junction are connected) and may take into account such things as one way streets or restricted access. The road junction may also assign various costs to these transitions; turning right (in the UK) may be a more costly move than going straight on or turning left.

As with the multi-pin device, this internal topological complexity may be defined algorithmically or by table lookup, or some combination of the two. There may be a dependence on various internal external parameters such as the day of the week, or the angle between approach road and exit road at a roundabout.

Encapsulating topology inside objects in this way allows us to simplify the geometry of topologically complex networks. In a fibre-optic cable network, for instance, each cable may contain 256 fibres and at each junction, the connections between individual fibres must be modelled. However, the cable can be modelled by a single chain and when network traces are carried out, the current fibre number is carried as an attribute of the trace. The junction objects can use this attribute to determine connectivity and will modify it when passing back output cables. Hence, the network tracer will ask the junction "I have arrived along this cable on fibre number 125. Give me connected output cables and corresponding fibre numbers".

Conclusion

The approach described in this paper to handling topologically structured data in multiple coordinate systems is a simple and natural extension to the spatial indexing techniques employed to organise a single large seamless geographic database. The method is elegant in that it adds no complexity to the topological capabilities of the system implemented for a single coordinate world. Even though geometry is stored seamlessly, the spatial key implemented organises the data physically so that data belonging to each coordinate system is stored contiguously in different parts of the base datastore tables. The approach has been highly effective for implementing complex models for a range of network applications.

References

Abel, D.J. & Smith, J.L. (1983): A Data Structure and Query Algorithm Based on a Linear Key for a Rectangle Retrieval Problem, Computer Vision, Graphics, and Image Processing 24,1, October 1983.

Abel,D.J. & Smith, J.L. (1984): A Data Structure and Query Algorithm for a Database of Areal Entities, The Australian Computer Journal, Vol 16, No 4.

Batty, P. (1990): Exploiting Relational Database Technology in GIS, Mapping Awareness magazine, Volume 4 No 6, July/August 1990.

Bundock, M. (1987): An Integrated DBMS Approach to Geographical Information Systems, Autocarto 8 Conference Proceedings, Baltimore, March/April 1987.

Chance, A., Newell, R.G. & Theriault, D.G. (1990). An Object-Oriented GIS - Issues and Solutions, EGIS '90 Conference Proceedings, Amsterdam,, April 1990.

Easterfield, M.E., Newell, R.G. & Theriault, D.G. (1990): Version Management in GIS Applications and Techniques, EGIS '90 Conference Proceedings, Amsterdam, April 1990.

Guttman, A. (1984): R-trees: A Dynamic Index Structure for Spatial Searching, Proceedings of ACM SIGMOD Conference on Management of Data, Boston, June 1984.

Kriegel, H., Schiwietz, M., Schneider, R., Seeger, B. (1990): Performance Comparison of Point and Spatial Access Methods, in Design and Implementation of Large Spatial Databases: Proceedings of the First Symposium SSD '89, Santa Barbara, July 1989.

Libera, F.D. & Gosen, F. (1986): Using B-trees to Solve Geographic Range Queries, The Computer Journal, Vol 29, No 2.

Newell, R.G., Easterfield, M. and Theriault, D.G. (1991): Integration of Spatial Objects in a GIS, Proceedings of Auto-carto 10, Baltimore March 1991, Volume 7, pp 408-415.

Samet, H. (1989): The Design and Analysis of Spatial Data Structures, Addison Wesley, 1990, ISBN 0-201-50255-0.

Seeger, B. & Kriegel,H. (1988): Techniques for Design and Implementation of Efficient Spatial Access Methods, Proceedings of the 14th VLDB Conference, Los Angeles, California, 1988.

Smith, T. R. and Gao, P. (1990): Experimental Performance Evaluations on Spatial Access Methods Proceedings of the 4th Spatial Data Handling Symposium, Zurich 1990, Vol 2, p991.

Smallworld Technical Paper No. 9 - The Why and the How of the Long Transaction

by Richard G. Newell

Abstract

The recent literature on GIS technology has seen the emergence of a new set of terminology including "long transaction", "version management", "check-out", "check-in", "seamless mapbase" and so on. As is common with new terminology, few people understand what these things mean, why they are important and what they are for. This paper attempts to explain what a long transaction is, why it is necessary and how it is managed in a GIS.

Introduction

Any user of a GIS, mapping system, CAD system, word processor or indeed any system which involves updating data over a significant period of time is in fact engaged in a long transaction. Contrast this with the user of a commercial DBMS application such as banking or airline reservation. In such an application, a user may prepare an input screen over a period of a few seconds which then updates the system resulting in a transaction which lasts a small fraction of a second.

What is the difference between these two uses of a computer system? Why is it that the short transaction mechanisms implemented in all of today's commercial DBMSs do not satisfy the requirements of design-type systems?

Long transaction applications in a GIS involve the modification of data that is relatively static. These include:

  • Data conversion
  • Map-base and asset management
  • Analysis which produces large amounts of intermediate results
  • Design studies with multiple alternative designs
  • Short transaction examples occur in the everyday operational use of a system. These might include:
  • Vehicle tracking
  • Customer service bureau
  • Fault logging
  • Emergency planning

Drawing office managers, using paper drawings are forced into implementing a long transaction mechanism, known as drawings management. It is impractical to allow two draftsmen to have a drawing out for update at the same time. There is only one master copy of every drawing and only one draftsman at a time can modify it.

Any other user can have read only access to a copy of a drawing, in which case the information he has may be out of date, and this is usually deemed acceptable. In fact it is not uncommon in organisations such as local authorities, for there to be multiple copies of the same set of maps, all independently updated and maintained. Although this is deemed to be not so acceptable, these organisations put up with it because there is no alternative where the maps are on paper.

Sheet-Based or Tiled Systems

The early digital mapping systems were based on CAD systems where the mapbase was held as a collection of CAD drawings. The methods of managing such a system where multiple users wish to access and update the mapbase are based on the manual drawing office approach. Indeed there is a market for Document Management systems in which an intelligent drawing register is held in a database alongside the drawings to record the status of each drawing in the registry. The advantage of these sheet based digital mapping systems is their simplicity, but their disadvantage is that handling any object which lies across a tile boundary becomes exceedingly cumbersome.

However, as digital mapping systems tried to evolve into truly seamless databases, it was found that the information that needed to be held to store the relationships between parts of objects on adjacent map-sheets was not nearly so easy to manage as the strictly partitioned map-base that one found in digital mapping systems. Indeed, it was found that so much code was required in map-management systems that more modern systems took a radically different approach which abandoned the concepts of sheets and tiles to implement a truly seamless database.

This appeared attractive because it allowed implementors to move from a a file based system to an implementation based on a database. It was now feasible to hold all of the map data in a commercial relational database management system (RDBMS). Much of the functionality that is provided by these systems is required to handle the large data volumes involved in a GIS.

Commercial Relational Database Management Systems

The commercial relational database vendors have invested man-centuries of effort in producing very robust systems which ensure the safety and integrity of data at all times. They also include rich facilities for designing and building data models, an aspect which everybody now realizes is the most important point of departure in building a GIS. However, vendors who build their systems on such engines have to overcome three things which are not provided by the database vendors:

  • Spatial modelling and queries
  • Performance of spatial queries
  • Long transaction handling

On the first of these two, the database vendors and the standards organisations are beginning to make progress in addressing them. Indeed, provided the RDBMS provides facilities to control data clustering, it is not too hard to obtain adequate spatial performance. However, on the issue of long transactions, there is little sign yet that the vendors are doing anything. This may be because the GIS market is considered to be small compared to the total DBMS market, and it does not get the attention that it deserves. Also it requires fundamental changes to existing approaches.

Commercial DBMSs are designed to handle short transactions and to maximize transaction throughput. In theory, one could use the short transaction mechanism to handle multiple users of a GIS, but it is not effective, for the following reasons.

Commercial DBMS vendors adopt one of two approaches to transaction locking, known as the pessimistic approach and the optimistic approach. In the pessimistic approach the system requests locks on all records that are to be updated before commencing a transaction. Thus all other users are locked out of accessing these records. When the transaction is finally closed the locks are released. The problem with this is that if one imagines many users holding locks for a long period of time, the system becomes totally unusable because other users are denied access to the locked records.

In the optimistic approach, each user carries on updating records within the privacy of his own transaction and if, at the time the transaction is closed, a conflict is detected, he may well lose all of the work that he has just completed. For a small amount of work this is deemed to be acceptable, but if somebody has been working for days or weeks it certainly is not.

In either method, should there be a system failure while a transaction is open, then all work is lost. Thus these methods can handle transactions which are open for a few seconds or minutes, but certainly not those which last for hours or days.

So in order to get round this problem, GIS vendors who base their systems on commercial RDBMS avoid using the short transaction mechanism completely and instead implement a long transaction mechanism of their own called "check-out".

Check-out and check-in

In a system which employs check-out, the user who wishes to update the database requests of the system the part of the database he wishes to work on to be copied into a single user database. Whether or not the single user database is proprietary or is a commercial RDBMS does not matter as it only handles temporary data.

One advantage that stems from doing this is that the checked out database can be held on the local disk of a workstation, and so the user puts no load at all on the database server or the network while he is working. The only work that the server has to deal with is checking out data and then later checking in the updates.

However, there are a number of disadvantages of using check-out:

  • Check-out may take a long time
  • The user is restricted to a subset of the database
  • The handling of alternatives is cumbersome
  • It is difficult to maintain relationships between that data which is checked out and that which is not.

From the vendor's point of view, the biggest disadvantage of check-out is that to make it work effectively requires an enormous amount of develop-ment effort and so the gains made on relying on the R&D resources of the DBMS vendors are lost in overcoming the limitations of the short transaction.

A further problem is that, as in the two mechanisms of short transactions, the same applies to check-out. Either one locks the data intended for update or one employs a system of conflict resolution on check-in. In the former case, the system suffers the same problems as in pessimistic locking. At least in the latter case one can salvage most of the work in the event that a conflict is detected. However, conflict resolution is not a trivial matter.

Given that there are still problems of using check-out to overcome the long transaction problem, one has to ask what are the alternatives. Either, one has to wait for the commercial DBMS vendors to provide long transaction support and indeed some of the early implementations of object-oriented database management systems claim to address this issue, or the vendor has to implement his own long transaction mechanism.

The lack of long transaction support is the most serious short coming of today's commercial RDBMSs for the support of GIS.

One of the most powerful approaches to handling long transactions is to implement a mechanism for version management deep in the database engine itself.

Version Management

A version managed database is capable of holding any number of versions of the whole database without replicating data that is common between versions. Thus all users can see the whole database at all times, subject to any changes made within the privacy of their own versions.

A long transaction commences with the creation of a new version from an existing version. At the start, the new version will look identical in all respects to the parent version from which it was created. However, as the user proceeds in modifying the database, the database stores the effects of his changes, but no other user operating in a different version can see these changes. The user of course works within a sequence of short transactions, each of which can be committed at any time. Thus the database can store persistently the results of a long transaction at all stages in its evolution. Intermediate commit stages may sometimes be given a name, in which case they are known as check points

The operation of closing a long transaction is achieved by merging any changes that have been made by other users to the parent version, followed by posting the combined changes back up to the parent. The step of merging the parent's changes is where conflicts may be detected and dealt with.

As in the case of check-out, version management also minimizes the load on the database server by maximizing the utilization of the workstation. This allows good performance of many workstations on one server. This contrasts with the situation in most commercial DBMSs in which query processing for all users is carried out by the database server, thus giving it an enormous workload in a large system.

Version management has many advantages over both map-management and check-out in handling the long transaction issue:

  • No delay before commencing update
  • Always access to the whole database by all users
  • Simultaneous alternatives can be handled

One of the disadvantages of version management is that it is extremely difficult to implement it on top of a commercial DBMS, thus the vendor is forced either into the compromise of check-out or of implementing his own database engine which supports the concept. However, one of the most difficult aspects of database implementation is handling short transactions efficiently. Since this is not required for most GIS applications it is much easier to build a robust system with good performance.

Short Transactions in a GIS

There is much data in corporate DBMSs which needs to be accessed from a GIS. Most of this data is maintained in a commercial DBMS in a short transaction environment. Short transactions are important where it is essential for all users of the system to see the most up-to-date version of the database. GIS access to such data is typically for read purposes only and thus a simple interface mechanism will normally suffice. It is of course desirable from the user's point of view to hide differences in the user interface between the GIS and the external DBMS. In cases where it is also desirable to maintain short transaction data via the GIS user interface, then it makes a lot of sense to use a commercially available database engine.

Summary

All multiple-user GIS systems maintain their data by using a long transaction mechanism. This paper has examined simple mapping systems which maintain multiple map-sheets using a document management approach, through systems which try to maintain continuity between map-sheets by means of an extension of document management known as map management, ultimately leading to truly seamless GIS systems which need a different approach. Two approaches available in the market place are explored, namely check-out and version management. The drawbacks and benefits of all approaches are described. The conclusion is reached that the most elegant and powerful solution is version management and the lack of support for this in today's commercial RDBMSs is a major drawback to using these systems to underpin a GIS. Thus today's vendors who wish to bring the benefits of version management to their customers must implement it themselves.