Towards a generalized map algebra: principles and data types Gilberto Câmara Danilo Palomo Ricardo Cartaxo Olga Oliveira Map Algebra A simple example: “How to identify all areas without vegetation with slope greater than 15% as high risk ”. slope U vegetatio n Is an algebraic framework for performing operations on data stored in a geographical information system (GIS). Allows the user to model different problems and to obtain new information from the existing data set. 2 Tomlin’s Map Algebra [1990] Data type A Map in raster representation Operations Local Focal Zonal gz gl gf z(p) n(p) n(p) = touch Source: Tomlin (1990) z(p) = inside spatial 3 New applications “Calculate the deforestation along the rivers and roads” 4 Questions “What is the theoretical foundation for map algebra?” “Could this theoretical foundation provide support for more generic map algebra?” “How can we define an extended map algebra suitable for both raster and vector representations?” 5 Response We take the existing spatial predicates as a basis for defining a more generic map algebra. Motivation To allow the user to model a greater number of different problems and to obtain a greater number of new information from the existing data set. 6 Outline Introduction and motivation The generalized map algebra Compare with the Tomlin’s proposal Examples Conclusions 7 The generalized map algebra Data type A map in raster or vector representation Function Signature getregions map list_region contains map region bool overlaps map region bool insert map region retrieve map region attr_domain new map add map region map remove map region map attr_domain map The map data type 8 Axioms (getregions (m)) == G (the extent of the map) contains (m, r) == true iff r G insert(m,r,val) == error iff contains (m,r) == false retrieve (m,r) == error iff contains (m,r) == false retrieve (insert (m, r, val), r) == value add (m,r) == error iff ((contains (m, r) == true) or (overlaps (m,r) == true)) remove (m,r) == error iff (contains (m,r) == false) remove ((add (m, r), r) == add ((remove (m, r), r) 9 Nonspatial operation Are the equivalent to Tomlin’s local operations 10 Nonspatial operators Instances m1, m2 : map r : region value: attr_domain list_attr_domain func1: func_single maplist: list_map reglist : list_region valuelist: funcn: func_multiple Function Signature single map func_single map map multiple maplist func_multiple map map select map attr_domain comp map map Operators Single argument mathematical functions: log, exp, sin, ... Single argument logical function: not. Multiargument functions: sum, product, or, ... 11 Spatial predicates Topological predicates Source: adapted from Egenhofer and Herring [1991] Directional predicates Source: Winter & Frank [2000] 12 Spatial selection function selection spatial predicate data reference 13 Application of spatial selection functions selection predicate touch inside disjoint west data reference 14 Spatial operation outputmap output composition selection spatial predicate data reference 15 Spatial operators Instances m1, refmap, m2 : map v_list: list_attr_domain pred: spat_pred r1, r2 : region func: func_multiple Function Signature spatial map map pred func_multiple map map Operators Multiargument functions: sum, product, or, ... 16 Outline Motivation The generalized map algebra Comparison with the Tomlin’s proposal Examples Conclusions 17 Comparison with Tomlin’s map algebra Focal operation Zonal operation No equivalence composition composition composition inside disjoint / equal west / north / ... touch output and reference 18 Outline Motivation The generalized map algebra Comparison with the Tomlin’s proposal Examples Conclusions 19 Example of spatial operation Find the local sum of regions in a deforestation map 230 sum 1980 := touch defor lsum lsum := sum (defor touch lsum lsum) lsum); 20 Example of spatial operation Find the sum of deforestation in the native reservations 470 inside reserves sum := defor deforRes reserves); deforRes := := sum (defor sum inside (defor reserves inside reserves) 21 Example of spatial operation Calculate the mean of the deforestation along the road 195 intersects road mean defor := defRoad defRoad := mean (defor intersects road road); roadDesm road) 22 Outline Motivation The generalized map algebra Comparison with the Tomlin’s proposal Examples Conclusions 23 Conclusions Our map algebra enables operations that are not directly expressible by Tomlin`s proposal. One of the important result is to show that Tomlin’s Map Algebra can be seen as an application of spatial predicates to coverages. Further generalizations of the proposed algebra are possible by involving the full set of spatial predicates. The next step in our work is to design, implement and validate a language that supports the proposed map algebra for spatial databases. 24