Spatial Databases with application to GIS