Leveraging your database to manage spatial data
Jason Weinberger MapInfo Corporation 1 Global View, Troy, NY 12180 Abstract Relational Database Management Systems have become the backbone of today’s commercial and government IT infrastructure. Databases allow government to offer citizens self-service tools and empower e-government. Traditionally databases are able to store textual and numeric data. This data can include everything from property values to school district information to dog licenses. Virtually any information that government uses in an operational setting can be stored and accessed through the use of the leading commercial database products. Until recently databases could not do anything with spatial data. Today, several database vendors have begun to offer spatial capabilities to their products either as add on components or included with the initial database purchase. Many GIS vendors also offer spatial database tools. Adding spatial capabilities to the RDBMS gives users a new wealth of functionality that was never previously available. Spatial databases can be used to facilitate e-government to determine if a citizen’s election district and direct the citizen to the appropriate polling place. It can be used for a call before you dig application to track easements. It can also be used to store and track street networks and property boundaries. What can be done without a spatial database? Using virtually any database that support open standards such as ODBC and JDBC can be used to store point data. For instance an address can be assigned a latitude and longitude value, which can then be stored as two columns inside of the database. Most GIS products are able to interpolate these columns as spatial points and users can extract this data and manipulate it inside of their GIS software. Additional GIS tools are required in order to utilize this data. The database does not recognize these points as having spatial value. The database is only able to recognize these points as numeric values. Without spatial capabilities the database cannot do anything beyond serving as a data store for point information. It cannot manipulate the data without additional GIS tools. It cannot store data such as lines and polygons, which often represent things such as roads and election districts. Without a spatially enabled database the capabilities available to the user are quite limited. What are the core components of a spatial database? Although different vendors approach spatially enabling the database in different ways, there are several key components that must be present in order to fully leverage the power of the database to manage spatial data. There are three main components that should be present as part of the spatial relational database management system. These components include a spatial data type, a spatial indexing scheme and spatial operators. Spatial Data Type The spatial data type allows the database to recognize points, lines and polygons as spatial objects inside of the database. The database natively has the ability to recognize data types such as floats, integers and chars. A new type must be added in order for the database to comprehend spatial objects. The Open GIS Consortium (OGC) has defined a structure for a spatial data type. This type has been defined as an ST_Spatial type. The ST_Spatial type is comprised of point, line and area types that can be combined to represent virtually any spatial object.
Spatial Indexing The second component of the spatial database is the spatial index. Virtually all databases include indexing schemes to enable quick lookup and retrieval of the data. These schemes are designed to work with the native data types. The nature of spatial information is quite different from traditional non-spatial data. In an effort to enable users to quickly retrieve spatial data from their database most vendors add a spatial index. There are several different indexing schemes that are well suited for spatial data. Recently there has been a move from B-trees or quad trees to R-trees as the preferred indexing mechanism of spatial database and tools vendors. The primary difference between these indexing schemes is the way that the data is partitioned. The diagram below helps to illustrate these various indexing schemes. ![]() Spatial Operators Spatial data types and spatial indexing allow data to be stored and retrieved from the relational database. However, this is useless unless you have a way to manipulate the data. Data manipulation occurs through the use of spatial operators. Spatial operators fall into several categories,which include spatial functions, predicates, measurement, constructor and observer functions. All of these functions are defined by the OGC, but they are extensible and some vendors offer more capabilities than others. All of these functions can be accessed using standard SQL commands. Spatial Functions Spatial functions allow users to perform operations such as creating a buffer around an object. Spatial functions take an input, perform an operation on that input, which in turn results in a new geometry. Spatial Predicates Spatial predicates allow users to query the database to return a true or false answer. An example of a spatial function is “does voter a fall in election district x?” Spatial Measurements Spatial measurements do what it sounds like they do. A spatial measurement can return the area or length of a given geometry. Constructor Functions Constructors allow users to create new spatial objects using SQL commands. By inputting X,Y coordinates a point can be created. A series of points can be inputted to create a line or polygon. Observer Functions Observer functions can be used to determine the information about a given geometry. An observer function would be used to derive the X coordinate of a point or the starting point of the line. Conclusion There is a tremendous amount of value that can be derived from spatially enabling an RDBMS. A spatially enabled database allows the integration of GIS systems with the database systems that serve the rest of the organization. This synergy allows GIS to be utilized throughout the organization rather than being restricted to isolated pockets. Leveraging your RDBMS to manage spatial data gives users access to the most up to date data allowing better decisions to be made. | ||
|
|