Generalized Relational Algebra: Modeling Spatial Queries in Constraint Databases