Converson between the vector and raster data structures usng Fuzzy Geographcal Enttes Cdála Fonte Department of Mathematcs Faculty of Scences and Technology Unversty of Combra, Apartado 38, 3 454 Combra, Portugal Tel.: + 35 239 795; Fax: + 35 239 832568 cfonte@mat.uc.pt Abstract The converson of geographcal enttes between the raster and vector data structures ntroduces errors n the enttes poston. The vector to raster converson results n a loss of nformaton, snce, when a Boolean classfcaton of each pxel s used, the enttes shape must follow the shape of the pxels. Thus, the nformaton about the poston of the enttes n the vector data structure s lost wth the converson. Ths loss can be mnmzed f, nstead of makng a Boolean classfcaton of the pxels, a fuzzy classfcaton s performed, buldng Fuzzy Geographcal Enttes. These enttes keep, for each pxel, the nformaton about the pxel area that was nsde the vector enttes and therefore only the nformaton about the poston of the enttes boundares nsde the pxels s lost. The Fuzzy Geographcal Enttes obtaned through the prevous converson may be converted back to the vector data structure. An algorthm was developed to reconstruct the boundares of the vector geographcal enttes usng the nformaton stored n the raster Fuzzy Geographcal Enttes. Snce the grades of membershp represent partal membershp of the pxels to the enttes, ths nformaton s valuable to reconstruct the enttes boundares n the vector data structure, generatng boundares of the obtaned vector enttes that are as close as possble to ther orgnal poston. Even though slght changes on the enttes shape and poston are expected after the re-converson to the vector data structure, when Fuzzy Geographcal Enttes are used, the enttes areas are always kept durng successve conversons between both structures. Moreover, f the converson and re-converson methods are successvely appled consderng the same pxel, sze, orgn and orentaton, the obtaned results are always dentcal, that s, the postonal errors ntroduce wll not propagate ndefntely. Keywords: vector to raster converson, raster to vector converson, fuzzy geographcal enttes, postonal error, error propagaton Introducton The geographcal nformaton may be stored usng the vector or the raster data structure. The use of ether structure depends on the methods used to collect the data and on the use that wll be gven the nformaton. Wthn ths paper only areal Geographcal Enttes (GEs) are consdered. In the vector data structure, the geographcal space s consdered contnuous and the prmtves used to represent the geographcal nformaton are ponts, lnes and areas. In the raster data structure, the geographcal space s dscrete and the prmtves used to represent the geographcal nformaton are cells (pxels), usually square, formng a tessellaton. Snce the pxels are homogeneous, that s, only one attrbute value can be assgned to each one, the shape 784
and poston of the GEs are condtoned to the shape, sze, orgn and orentaton of the cells formng the raster tessellaton. The converson between both data structures s sometmes necessary. The enttes shape and poston may be represented more accurately n the vector data structure than n the raster structure. The vector to raster converson corresponds to a dscretzaton of the geographcal space, and, snce a Boolean classfcaton s usually done, each pxel has to be classfed as belongng or not to the GE. When a grd correspondng to the pxels s overlad to the vector representaton, the boundares of the GEs wll cross some pxels, and therefore those pxels, known as mxed pxels, are partally outsde/nsde the entty. The oblgaton of assgnng to each mxed pxel full membershp or no membershp to the entty ntroduces errors n the GE poston and shape, whch depend on the crtera used to make the choce of weather the pxel s consdered to be nsde or outsde the GE. Examples of crtera used are: the pxel s consdered to belong to the entty or not dependng on the area occuped by the entty nsde t, or weather the entty occupes the pxel center (e.g. Burrough and MacDonnell, 998). The converson from the raster data structure to the vector data structure may be performed n two ways:. The segments contourng the geographcal entty correspond to the lmts of the cells n the raster structure. 2. The converson descrbed n the prevous pont may be smoothed to generate enttes wth a more real confguraton. The type of converson expressed n. s very smple and translates exactly the nformaton present n the raster structure, but the resultng enttes are represented wth a stepwse look, whch clearly does not correspond to ther real shape. The second approach results n enttes wth better look, but ther real poston, shape, and area s unknown, snce the smoothng methods don t use any nformaton about the real poston of the enttes, because that nformaton s not avalable n the raster structure. The problem assocated wth these conversons s that from the vector to the raster structure there s a loss of nformaton, and therefore, to convert the data back to the vector structure two choces are possble: or no more nformaton s added, and the result s a stepwse entty; or nformaton has to be created to smooth the entty boundary, but, snce no addtonal nformaton s avalable, t has to be created ndependently of the real characterstcs of the enttes. In ths paper, a method to mnmze the loss of nformaton when convertng GE from the vector to the raster structure s proposed, usng Fuzzy Geographcal Enttes (FGEs), as well as an algorthm to convert the obtaned fuzzy enttes back to the vector structure usng the supplementary nformaton stored. 2 Fuzzy Geographcal Enttes Defnton: A fuzzy geographcal entty (FGE) E s a geographcal entty whose poston n the geographcal space s defned by the fuzzy set E = { Regons belongng to geographcal entty E}, wth membershp functon µ E( p) [,] defned for every pont p n the space of nterest. The membershp value one represents full membershp. The membershp value zero represents no membershp, and the values n 785
between correspond to grades of membershp to E, decreasng from one to zero. (Fonte and Lodwck, 24) The degrees of membershp may have several semantc nterpretatons and may be computed consderng dfferent approaches (Fonte and Lodwck, 25). Ths allows the constructon of FGEs n many stuatons usng dfferent types of nformaton. For example, the degree of membershp of one element to a set may represent the uncertanty regardng the element s membershp to the set or partal membershp to t. 3 Converson between vector and raster data structures usng FGEs As explaned n secton, the problem assocated wth the consecutve converson between the vector and the raster data structures s that from the vector to the raster structure there s loss of nformaton and, wth the converson back to the vector structure, or a stepwse vector representaton s obtaned or a smoothng process s used, whch s ndependent from the real poston and shape of the entty, snce no further nformaton about ts poston s avalable. Moreover, f both processes are appled consecutvely transformatons are added each tme the converson s made, changng the entty s shape and poston. The consecutve converson between the vector and raster data structures generate the results 2 shown n Fgure. The area of the ntal GE s 38 m, and after the converson to the raster structure and ts re-converson to the vector structure, an area of 2 4 m was obtaned. a) b) Fgure a) The lghter vector GE was obtaned convertng the darker GE to the raster data structure and the resultng raster GE back to the vector structure. b) The lghter GE was obtaned convertng the darker GE between the vector and the raster data structures sx tmes. The phlosophy behnd the heren proposed work, t that, when convertng the GEs from the vector to the raster data structure, more nformaton about ther shape and poston should be kept, so that the errors ntroduced wth the converson are mnmzed. 786
3. Converson from vector GEs to raster FGEs The converson from the vector to the raster data structure wth a Boolean classfcaton assgns to each cell a value one or zero, meanng that the pxels belongs or not to the entty. If, nstead of makng a Boolean classfcaton of the pxels a fuzzy classfcaton s done, t s possble to assgn to each pxel a degree of membershp to the geographcal entty. In ths case, the grades of membershp of the pxels represent partal belongng (and not uncertanty), and translate the degree to whch the pxels belong to the entty. A semantc nterpretaton of the grades of membershp as degrees of smlarty s presented below, even though, n ths case, the computaton of the membershp functon s ntutve. The nterpretaton of degrees of membershp as degrees of smlarty s based on the concept of groupng elements nto sets characterzed by the propertes of one or several elements, consdered as deal, or by propertes representatve of the set. The degrees of membershp of the other elements to the set are computed evaluatng the smlarty of ther propertes to the propertes of the deal element or the propertes representatve of the set. The degree of smlarty between the elements or ther characterstcs may be evaluated consderng a dstance between each element of the set and the deal element, or a dstance between the characterstcs of the elements and the representatve characterstc (Blgç and Turksen, 999; Zmmermann and Zysno, 985). The dstances used to compute the degrees of membershp and the computaton of these degrees depend upon the applcaton. An example of applcaton of ths semantc nterpretaton may be found n Fonte and Lodwch, 25. The nterpretaton of the degrees of membershp as degrees of smlarty may be used to compute the degrees of membershp of the pxels to the raster FGE. The deal stuaton occurs when the pxels are completely occuped by the entty, that s, the pxels are nsde the GE. In ths case, the degree of membershp one s assgned to the pxels, whch form the core of the FGE. To compute the degree of membershp of the mxed pxels to the FGE t s necessary to evaluate the degree of smlarty between them and the deal pxels, whch s computed evaluatng a dstance between the characterstcs of the deal pxels and the mxed ones. In ths applcaton, the characterstc chosen to perform the comparson s the area occuped by the vector GE nsde each pxel. The quantfcaton of the smlarty between pxel p and the deal pxels s based on the dstance between the area occuped by the entty n the deal pxels, A Ideal, (whch corresponds to the total area of the pxels A Total, that s, AIdeal = ATotal ) and the A p (see Fgure 3). area occuped by the GE n pxel p, ( ) Occuped d A ( p ), A Occuped Ideal ( ) A Occuped Occuped p A Ideal Fgure 3 The dstance d AOccuped ( p ), A Ideal n pxel p, AOccuped ( p ), and the area of the deal pxels Ideal A s the dfference between the area occuped by the GE A. 787
That s, ( ) = ( ), = ( ) d p d AOccuped p AIdeal AIdeal AOccuped p () The grades of membershp of the mxed pxels p to the FGE are then computed as a functon of ths dstance, that s: ( p ) f d( p ) µ E = where, f ( ) =, f ( A ) = and d( p ) Ideal AIdeal. Consderng a lnear varaton between the grades of membershp and the dstance, functon f corresponds to a straght lne and the grades of membershp are computed as shown n Equaton 2 (see Fgure 4). µ µ E ( p ) f d( p ) E ( p ) Ideal ( ) AIdeal d p = = (2) A d A Ideal Fgure 4 Membershp functon of pxels p to the FGE E. Accordng to Equaton A d( p ) A ( p ) =, and therefore, from Equaton 2 Ideal Occuped Total ( p ) AOccuped µ E ( p) = (3) A Equaton 3 proves that the grades of membershp may be computed dvdng the area of the pxel occuped by the entty nsde each pxel by the area of the pxels, whch s the normalzed area of the pxel occuped by the GE. The GE shown n Fgure 5a) was converted to a raster FGE consderng the grd represented n Fgure 5b). The obtaned FGE s shown n Fgure 6. 788
Y Y a) X b) X Fgure 5 a) GE represented n the vector data structure. b) The vector GE overlad wth a grd of cells..2..2.3.6.8.6.8.6.3.4...6.5.3.3.7.7.2.3.2.2.4.6.5.3.7.8.6.8.8.8.8.5.8.3.6.9...5..4.3.4.2.8.6.3.4.6.7.7.7.5.4.5.5.6.5.7.9.2.7.6.5.7.9..4.3...2. Fgure 6 Raster FGE correspondng to the vector GE shown s Fgure 5. If the Rosenfeld operator to compute the area of FGEs (Fonte and Lodwck, 24) s used to compute de area of the FGE generated by the converson, the obtaned value s equal to the area of the orgnal entty represented n the vector data structure. In ths way, even though the nformaton regardng the locaton of the orgnal border of the entty s lost, the nformaton about ts area s kept, as well as the area occuped by the entty nsde each pxel. 3.2 Converson of raster FGEs to the vector data structure The converson of a raster FGE back to the vector data structure requres the dentfcaton of the segments formng the entty boudary. In the prevous secton, Equaton 3 was used to compute the grade of membershp of each pxel to the FGE. Now, the grades of membershp and the total area of the pxels are known and therefore AOccuped ( p ) = µ E ( p ) ATotal may be computed. The segments formng the boundary are found, such that the area occuped by the 789
entty nsde each pxel s correct. An algorthm was developed consderng the followng steps:. Identfy the ponts and segments belongng to the boundary of the entty. Whenever there are neghbor pxels wth grades of membershp zero and one, the common pont or segment belongs to the entty boundary (see Fgure 7)..6.7.9.. Fgure 7 Example of ponts and segments belongng to the border of the GE. If the grades of membershp are consdered wth only one or two decmal places these ponts are easy to fnd, snce the roundng of the grades of membershp wll turn some of them nto zero and one. If no pont s found, the pxel wth the smallest grade of membershp wth two contnuous neghbors wth membershp equal to zero s chosen and two ponts are dentfed such that a rectangular trangle s formed wth equal cathetus, such that the area occuped by the GE nsde the pxel s correct (see Fgure 8)..7..8 Fgure 8 Example of ponts consdered to belong to the border of the GE. 2. Choose one of the ponts found n the prevous step. 3. Identfy n whch drecton (to each pxel) the boundary wll head, consderng that the fronter s followed s the clockwse drecton. Once the drecton to follow the boundary s chosen, whenever the locaton of a pont of the boundary over a pxel border s known, t s possble to know whch pxel the boundary wll cross. For example, n Fgure 9a), b) and c), the border wll have to cross the central pxels and head respectvely to the pxels wth µ E =.7, µ E =.3 and µ E =.5. a) b) c).4 P.7.9.6.3 P. P.6.8.5 Fgure 9 The arrows represent the drecton taken by the entty boundary when leavng pont P, f the boundary s followed n the clockwse drecton. 79
4. Identty the next pont of the fronter. The poston of the next pont s determned such that the area of the pxel beng crossed equals A p = µ p A. ( ) ( ) Occuped E Total If one of the ponts found n step one, besdes pont P, s on the fronter of the pxel beng crossed, pont Q, two cases may occur: the grade of membershp of the crossed pxel s.5, and n that case Q s the next pont of the boundary; f the grade of membershp s dfferent from.5, an ntermedate pont I has to be found, located on the dagonal of the pxel (see Fgure ). a) b).7 Q.7 Q I.5.3 P P.. Fgure In a) the next pont of the boundary s Q. In b), to occupy only the area of the pxel A p t s necessary to consder an ntermedate pont I between P and Q. correspondng to ( ) Occuped If the prevous stuaton does not verfy, t s necessary to dentfy to whch pxel the boundary should head to determne over whch pxel edge the next pont Q wll be P = { p, p2, p3, p4} located. If s the set of the four neghbors of the pxel to be < µ E ( p) < crossed, the chosen pxel wll be the one satsfyng and µ ( p ) = mn{ µ ( p )} E c p E P. The coordnates of pont Q are computed respectng the area occuped by the entty nsde the pxel. Intermedate ponts may be consdered whenever necessary. a) b).4 P.5.7.9.6.3.4 P Q Q. c) P.6.8 Q.5.8.2 Fgure The next pont Q of the boundary s dentfed, respectng the area occuped by the entty nsde the crossed pxel. 5. The pont or ponts determned n the prevous step are now used to determne another pont R usng smlar rules, and the process s repeated untl the frst pont s reached and the entty closed. 79
a) b).5 R.7.9 P Q..4 P.6.3.4 Q R c) P.6.8 Q.5 R.8.2 Fgure 2 Pont R of the boundary s dentfed respectng the area occuped by the entty nsde the crossed pxel. The GE obtaned after the converson of the FGE represented n Fgure 6 to the vector data structure n shown n Fgure 3, overlad wth the orgnal vector GE. The area of the obtaned GE s equal to the area of the ntal vector entty, and only small varatons n the entty poston are found. In ths case, only one ntermedate pont was used nsde each pxel, but more ponts can be consdered f eventual spkes are to be avoded. Fgure 3 The vector GE obtaned from the re-converson of the FGE back to the vector data structure s represented n grey, overlad wth the orgnal vector GE (n black). 4 Conclusons The conversons between the vector and raster data structures are useful for many applcatons, therefore t s useful to mnmze the errors and uncertanty ntroduced n the geographcal poston of the enttes durng the converson between both data structures. The converson from the vector to the raster data structure results n a loss of nformaton, snce, when a Boolean classfcaton of each pxel s consdered, the enttes boundares must follow the shape of the pxels. Thus, nformaton about the poston of the enttes n the vector data structure, whch was orgnally avalable, s lost wth the converson. A method to 792
mnmze ths loss s presented, whch conssts n, nstead of makng a Boolean classfcaton of the pxels, performng a fuzzy classfcaton, buldng Fuzzy Geographcal Enttes. These enttes keep, for each pxel, the nformaton about the pxel area that was nsde the vector enttes and therefore the total area of the GE s also kept. Wth ths approach only the nformaton about the poston of the enttes boundares nsde the pxels s lost. The obtaned Fuzzy Geographcal Enttes may be used for analyss and may be reconverted back to the vector data structure. The converson of GEs from the raster to the vector data structure results n GEs wth stepwse aspect. To overcome ths dsadvantage, the boundares of the obtaned entty can be smoothed, but, snce no further nformaton s avalable about the poston of the entty, ths smoothng s smply a geometrc operaton, transformng once agan the shape, poston and geometrc characterstcs of the entty, such as ts area. On the other hand, the converson of raster FGEs to the vector data structure allows a more accurate result, snce there s more nformaton avalable to determne the poston of the segments formng the entty boundary. An algorthm was developed to reconstruct the boundares of the vector geographcal enttes from the nformaton stored n the raster FGEs. Snce the grades of membershp represent partal membershp of the pxels to the enttes, ths nformaton s valuable to reconstruct the enttes boundares n the vector data structure, so that the boundares of the obtaned vector enttes are as close as possble to ther orgnal poston. Even though slght changes on the enttes boundares are expected after the re-converson to the vector data structure, when Fuzzy Geographcal Enttes are used, the enttes areas are kept. If successve conversons between both structures are done consderng the same pxel sze, orgn and orentaton, the same results are obtaned, snce the areas occuped by the entty nsde the pxels are always the same, that s, the postonal errors ntroduced wll not propagate ndefntely. References Blgç T, Türkşen I, 2, Measurement of Membershp functons: Theoretcal and emprcal work. In: Fundamentals of Fuzzy Sets, Dubos D, Prade H (Eds) The Handbook of Fuzzy Sets Seres, Kluwer Acad. Publ., 95-23. Fonte, C. and Lodwck, W, 24, Areas of fuzzy geographcal enttes. Internatonal Journal of Geographcal Informaton Scence, 8 (2), pp. 27-5. Fonte, C. and Lodwck, W, 25, Modellng the Fuzzy Spatal Extent of Geographcal Enttes. In Fuzzy Modellng wth Spatal Informaton for Geographc Problems, F. E. Petry, V. B. Robnson and M. A. Cobb (Eds.), pp. 2-42, Berln: Sprnger-Verlag. Zmmermann, H. and Zysno, P., 985, Quantfyng vagueness n decson models. European Journal of Operatonal Research, Vol. 22, pp.48-58. 793