Spatial databases :with application to GIS