# An Approach for a Spatial Data Attribute Similarity Measure Based on Granular Computing Closeness
## 3 Granular Computing Measure
\(\widetilde{P}=\{P_{1},P_{1},\cdots,P_{m}\}\widetilde{P}\in U,\forall\varphi_ {i}\in\psi(i=1,2,\cdots,r)\) is a vector object collection in universe \(U\), The degree to which \(m_{\widetilde{P}}^{j}(\varphi_{i})\) belongs to a set is defined as [33]:  
\[\mu_{\widetilde{P}}^{j}(\varphi_{i})=\frac{\left|m_{\widetilde{P}}^{j}( \varphi_{j})\cap\widetilde{P}\right|}{\widetilde{P}}\;(i=1,2,\;\cdots,r;j=1,2, \;\cdots,h) \tag{5}\]obviously, \(0\leq\mu_{p}^{j}(\varphi_{i})\leq 1\), \(\sum\limits_{j=1}^{h}\mu_{p}^{j}(\varphi_{i})=1\). Taking Figure 2 as an example, the membership degree is the ratio of the granular set formed by each land type under different index values to the number of land types. For example, if there are 20 land units in S1, when the atomic formula is GDP = G1 and there are six granular sets, then the atomic formula GDP = G1 forms a membership of the granular set of 0.3 (see Table 1). In the calculations of actual problems, the closeness calculation method based on the membership function has a distance method, a maximum and minimum method and an algebra and minimum method. The distance method is used in this study, and the distance between sets \(\widetilde{P}\) and \(\widetilde{Q}\) is defined as [33]:  
\[d(\widetilde{P},\widetilde{Q})=(\sum\limits_{j=1}^{h}\sum\limits_{i=1}^{r} \left|u_{p}^{j}(\varphi_{i})-u_{Q}^{j}(\varphi_{i})\right|^{\lambda})^{\frac{ 1}{\lambda}}\ \ \ \ \ n(\widetilde{P},\widetilde{Q})=1-\frac{1}{(r\times h)}(\sum \limits_{j=1}^{h}\sum\limits_{i=1}^{r}\left|u_{p}^{j}(\varphi_{i})-u_{Q}^{j}( \varphi_{i})\right|^{\lambda})^{\frac{1}{\lambda}} \tag{6}\]  
where \(r\) is the number of types of entities, \(h\) is the number of levels of different indexes, \(\lambda\) is a formula for calculating distances, \(\lambda=1\) is the closeness based on the Hamming distance and \(\lambda=2\) is the closeness based on the Euclidean distance; \(\lambda=1\) is used in this paper. Thus, according to Equation (6) for Figure 2, the similarity calculations of the following processes are performed separately. \[d(s1,s2)=|0.3-0.21|+|0.6-0.6|+|0.1-0.19|+|0.2-0.16|+|0.55-0.67|+|0.25-0.18|=0.41\]  
\[n(s1,s2)=1-0.41/6=0.932\]  
\[d(s1,s3)=|0.3-0.26|+|0.6-0.52|+|0.1-0.22|+|0.2-0.13|+|0.55-0.65|+|0.25-0.22|=0.44\]  
\[(\varphi,m(\varphi))\oplus(\varphi^{\prime},m(\varphi^{\prime}))= \left(\varphi\vee\varphi^{\prime},m(\varphi)\cup m(\varphi^{\prime})\right) \ ; \tag{1}\]0  
\[(\varphi,m(\varphi))\oplus(\varphi^{\prime},m(\varphi^{\prime}))= \left(\varphi\vee\varphi^{\prime},m(\varphi)\cup m(\varphi^{\prime})\right) \ ; \tag{1}\]1  
\[(\varphi,m(\varphi))\oplus(\varphi^{\prime},m(\varphi^{\prime}))= \left(\varphi\vee\varphi^{\prime},m(\varphi)\cup m(\varphi^{\prime})\right) \ ; \tag{1}\]2 \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & & \multicolumn{3}{c}{\(\phi\)**1**} & \multicolumn{3}{c}{\(\phi\)**2**} \\ \cline{3-8}  & & **G1** & **G2** & **G3** & **P1** & **P2** & **P3** \\ \hline \multirow{2}{*}{**S1**} & \(m_{p}^{j}(\varphi i)\) & 6 & 12 & 2 & 4 & 11 & 5 \\  & \(\mu_{p}^{l}(\varphi i)\) & 0.30 & 0.60 & 0.10 & 0.20 & 0.55 & 0.25 \\ \hline \multirow{2}{*}{**S2**} & \(m_{p}^{j}(\varphi i)\) & 12 & 34 & 11 & 9 & 38 & 10 \\  & \(\mu_{p}^{l}(\varphi i)\) & 0.21 & 0.60 & 0.19 & 0.16 & 0.67 & 0.18 \\ \hline \multirow{2}{*}{**S3**} & \(m_{p}^{j}(\varphi i)\) & 6 & 12 & 5 & 3 & 15 & 5 \\  & \(\mu_{p}^{l}(\varphi i)\) & 0.26 & 0.52 & 0.22 & 0.13 & 0.65 & 0.22 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Three spatial entity attribute membership degree comparison table. Therefore, \(n(s2,s3)>n(s1,s2)>n(s1,s3)\), and this shows that the distance between S2 and S3 is the smallest and the closeness is the largest (i.e., the similarity between GDP and population density is the largest between the two land types). The distance between S1 and S3 is the largest and the closeness is the smallest; that is, the similarity between GDP and population density indexes is the smallest between the two land types.