A Set of Integral Grid-Coding Algebraic Operations Based on GeoSOT-3D
Abstract
:1. Introduction
2. Algebraic Operation Framework for GeoSOT-3D
2.1. GeoSOT-3D Grid Model
- (1)
- Octal one-dimensional code. The code is coded with octal values (0, 1, 2, 3, 4, 5, 6, 7) up to 32 digits long. The length of the code identifies the layer of the grid. When writing the code, it starts with G; the codes for degrees, minutes, and seconds are separated by “-”, and the codes below seconds are separated by “.”. The form is Gddddddddd-mmmmmm-ssssss.uuuuuuuuuuu, where d, m, s, and u are octal numbers with values of 0, 1, 2, 3, 4, 5, 6, 7. The code of each layer of grid is based on the previous layer of the grid code, and the Z-order encoding direction is related to the same layer grid where the grid is located. The octal one-dimensional code is mainly used for index establishment and domain name identification.
- (2)
- Binary one-dimensional code (Figure 3a). The code is composed of 96-bit binary values (0,1), and each three-bit code represents an octal value, so the binary one-dimensional code corresponds exactly to the octal one-dimensional code. The binary one-dimensional code is mainly used for calculation, and is generally stored in the form of a structure. It is impossible to use a variable-length code to express the hierarchical layer of the section, such as an octal one-dimensional code. Therefore, the binary one-dimensional code generally needs the addition of a layer code with a length of 5-bit to represent the layer, and the total length of the code is 96 + 5 = 101 bits.
- (3)
- Binary three-dimensional code (Figure 3b). In the 96-bit binary one-dimensional code of GeoSOT-3D grid, every three-bit binary number represents the code of a grid in a layer. These three digits are disassembled and stored separately to form a GeoSOT-3D binary three-dimensional code. The GeoSOT-3D binary three-dimensional code has an obvious geographic meaning, and 32-bit binary values are used to represent altitude, latitude, and longitude. The first bit of the code indicates the interval in which the grid is located.
2.2. Algebraic Operation Framework Design
- Basic operations.
- Vector operations.
- Metric operations.
- Spatial calculation.
- Topological relationship operations.
- Set operations.
3. Algebraic Operations
3.1. Basic Operations
3.1.1. Bitwise Operations
- Bitwise andOperator:&
- Bitwise OROperator:|
- Bitwise XOROperator:^
- Inverted by bitOperator~
- Shift leftOperator:<<
- Shift rightOperator:>>
3.1.2. Get the Layer of Layer
3.1.3. Code Prefix Operation
3.1.4. Code Suffix Operation
3.2. Vector Operation
3.3. Metric Operation
3.3.1. Distance
3.3.2. Projection Area
3.3.3. Orientation
3.4. Spatial Calculation
3.4.1. Neighborhood Operation
- (1)
- Move a grid forward:
- (2)
- Move a grid in the negative direction:
3.4.2. Parent Grid Operation
3.4.3. Child Grid Operation
3.5. Topological Relationship Calculation
3.6. Set Operations
4. Experimental Results
4.1. Experimental Platform and Experiment Design
4.2. Comparison of Vector Operation Efficiency
4.3. Comparison of Metric Operation Efficiency
4.4. Comparison of Topological Operation Efficiency
- (1)
- For the overlay calculation of layers containing a single area object, the algebraic operation’s efficiency is slightly higher than that of the Weiler–Atherton algorithm. Under the experimental conditions in this article, the algebraic operation’s efficiency is increased by about 1.32 times. For the overlapping calculation of two surface objects, the most time-consuming part of the overlay algorithm lies in judgment of the nesting relationship between the two grid sets. This operation is the most basic kind of bit operation. It is related to the number of grids covered by each area object. In comparison, the Weiler–Atherton algorithm’s largest time consumption lies in the judgment of the intersection between two objects. The number of judgments is related to the number of line segments expressing the two surface objects: the number of intersection points.
- (2)
- For the overlay calculation of layers containing multiple area objects, the algebraic operation ‘s efficiency is much higher than that of the Weiler–Atherton algorithm. Under the experimental conditions of this article, the efficiency of the algebraic operation is improved by about 6.44 times. For the overlay calculation between two area object sets, the time consumption of the algebraic operation is related to the size of the overall coverage area of the grid set and the data accuracy. It is associated with the total number of associated grids. It has a weak correlation with the number of objects involved in the calculation. However, the time consumed by the Weiler–Atherton algorithm is related to the number of objects in the reference calculation. The more objects there are, the more intersection points there are that express the spatial information of the objects, and the more times the intersection relationship is judged and the longer this process takes.
4.5. Analysis Efficiency of Algebraic Operation
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Appendix A
void rot (int n, int* x, int* y, int rx, int ry){ |
if (ry == 0){ |
if (rx == 1){ |
*x = n − 1 − *x; |
*y = n − 1 − *y; |
} |
int t = *x; |
*x = *y; |
*y = t; |
} |
} |
void d2xy (int n, int d, int* x, int* y){ |
int rx, ry, s, t = d; |
*x = *y = 0; |
for (s = 1; s < n; s *= 2){ |
rx = 1 & (t / 2); |
ry = 1 & (t ^ rx); |
rot(s, x, y, rx, ry); |
*x += s * rx; |
*y += s * ry; |
t /= 4; |
} |
} |
unsigned int moveR(int n, unsigned code) { |
if (code % 2 == 0) |
return (code + 1); |
n -= 2; |
for (int i = 4; i < n; i = i * 4) { |
if ((code & i) == 0) |
return code & n|i; |
n −= i; |
} |
return 0; |
} |
Function 2: encode: |
Input: longitude, Latitude, Height, Layer Output: GeoSOT-3D Code |
Function 3: decode: |
Input: GeoSOT-3D Code Output: longitude, Latitude, Height, Layer |
Function 4: vector + |
Input: GeoSOT-3D Code1, GeoSOT-3D Code2 Output: GeoSOT-3D Code |
References
- Chen, S. Geo-spatial/temporal Analysis in Geo-processing. J. Remote Sens. 1997, 161–171. [Google Scholar] [CrossRef]
- Song, J.C.; Zhao, C.L.; Zhong, S.P.; Nielsen, T.A.S.; Prishchepov, A.V. Mapping spatio-temporal patterns and detecting the factors of traffic congestion with multi-source data fusion and mining techniques. Comput. Environ. Urban Syst. 2019, 77. [Google Scholar] [CrossRef]
- Xiong, X.; Qiao, S.J.; Li, Y.Y.; Han, N.; Yuan, G.; Zhang, Y.Q. A point-of-interest suggestion algorithm in Multi-source geo-social networks. Eng. Appl. Artif. Intell. 2020, 88. [Google Scholar] [CrossRef]
- Lin, Y.; Wang, H.; Zhang, S.; Li, J.; Gao, H. Efficient quality-driven source selection from massive data sources. J. Syst. Softw. 2016, 118, 221–233. [Google Scholar] [CrossRef]
- Song, S.; Cheng, C.; Pu, G.; An, F.; Luo, X. Global Remote Sensing Data Subdivision Organization Based on GeoSOT. Acta Geod. Cartogr. Sin. 2014, 43, 869–876. [Google Scholar]
- Cheng, C.; Tong, X.; Chen, B.; Zhai, W. A Subdivision Method to Unify the Existing Latitude and Longitude Grids. ISPRS Int. J. Geo-Inf. 2016, 5, 161. [Google Scholar] [CrossRef]
- Wang, R.; Ben, J.; Du, L.; Zhou, J.; Li, Z. Encoding and Operation for the Planar Aperture 4Hexagon Grid System. Acta Geod. Cartogr. Sin. 2018, 47, 1018–1025. [Google Scholar]
- Xiaochong, T.; Jin, B.E.N.; Zhiyuan, Q.I.N.; Yongsheng, Z. The Subdivision of Partial Grid Based on Discrete Global Grid Systems. Acta Geod. Cartogr. Sin. 2009, 38, 506–513. [Google Scholar]
- Xiaochong, T.; Jin, B.E.N.; Yongsheng, Z. The Subdivision of Global Multi-resolution Hexagonal Grid and the Rules of Address Coding. Acta Geod. Cartogr. Sin. 2007, 36, 428–435. [Google Scholar]
- Goodchild, M.F.; Shiren, Y. A hierarchical spatial data structure for global geographic information systems. CVGIP Graph. Models Image Process. 1992, 54, 31–44. [Google Scholar] [CrossRef] [Green Version]
- Li, S.; Cheng, C.; Pu, G. QRA-Grid: Quantitative Risk Analysis and Grid-based Pre-warning Model for Urban Natural Gas Pipeline. ISPRS Int. J. Geo-Inf. 2019, 8, 122. [Google Scholar] [CrossRef] [Green Version]
- Li, S.; Hou, K.; Cheng, C.; Li, S.; Chen, B. A Space-Interconnection Algorithm for Satellite Constellation Based on Spatial Grid Model. Remote Sens. 2020, 12, 2131. [Google Scholar] [CrossRef]
- Miao, S.; Cheng, C.; Zhai, W.; Ren, F.; Zhang, B.; Li, S.; Zhang, J.; Zhang, H. A Low-Altitude Flight Conflict Detection Algorithm Based on a Multilayer Grid Spatiotemporal Index. ISPRS Int. J. Geo-Inf. 2019, 8, 289. [Google Scholar] [CrossRef] [Green Version]
- Yang, M.; Cheng, C.; Chen, B. Mining Individual Similarity by Assessing Interactions with Personally Significant Places from GPS Trajectories. ISPRS Int. J. Geo-Inf. 2018, 7, 126. [Google Scholar] [CrossRef] [Green Version]
- Bradley, P.E.; Jahn, M.W. On the Behaviour of p-Adic Scaled Space Filling Curve Indices for High-Dimensional Data. Comput. J. 2020. [Google Scholar] [CrossRef]
- Laurini, R.; Thompson, D. Fundamentals of Spatial Information Systems; Academic press: Cambridge, MA, USA, 1992; Volume 37. [Google Scholar]
- Jin, A.; Cheng, C. Spatial Data Coding Method Based on Global Subdivision Grid. J. Geomat. Sci. Technol. 2013, 30, 284–287. [Google Scholar]
- Tong, X.; Ben, J.; Wang, Y.; Zhang, Y.; Pei, T. Efficient encoding and spatial operation scheme for aperture 4 hexagonal discrete global grid system. Int. J. Geogr. Inf. Sci. 2013, 27, 898–921. [Google Scholar] [CrossRef]
- Zhou, X.; Tang, D.; Hao, L.; Song, Y. Application of earth partition gird theory in image processing. Sci. Surv. Mapp. 2019, 44, 84–89. [Google Scholar]
- Li, S.; Pu, G.; Cheng, C.; Chen, B. Method for managing and querying geo-spatial data using a grid-code-array spatial index. Earth Sci. Inform. 2019, 12, 173–181. [Google Scholar] [CrossRef]
- Open Geospatial Consortium Topic 21: Discrete Global Grid Systems Abstract Specification. Available online: https://docs.opengeospatial.org/as/15-104r5/15-104r5.html (accessed on 18 July 2021).
- Chen, J.; Li, C.M.; Li, Z.L.; Gold, C. A Voronoi-based 9-intersection model for spatial relations. Int. J. Geogr. Inf. Sci. 2001, 15, 201–220. [Google Scholar] [CrossRef]
- Zhou, Y.; Wang, S.; Guan, Y. An Efficient Parallel Algorithm for Polygons Overlay Analysis. Appl. Sci. 2019, 9, 4857. [Google Scholar] [CrossRef] [Green Version]
- Moon, B.; Jagadish, H.V.; Faloutsos, C.; Saltz, J.H. Analysis of the clustering properties of the hilbert space-filling curve. IEEE Trans. Knowl. Data Eng. 2001, 13, 124–141. [Google Scholar] [CrossRef] [Green Version]
- Weiler, K.; Atherton, P. Hidden surface removal using polygon area sorting. ACM SIGGRAPH Comput. Graph. 1977, 11, 214–222. [Google Scholar] [CrossRef]
Method | First | Second | Third | Average |
---|---|---|---|---|
Convert Hilbert curve to (x,y)(ms) | 179 | 182 | 181 | 180 |
Displacement calculation under Z-order(ms) | 11 | 12 | 10 | 11 |
Method | First | Second | Third | Average |
---|---|---|---|---|
algebraic operation (ms) | 175 | 182 | 183 | 180 |
Weiler–Atherton algorithm (ms) | 232 | 237 | 243 | 237 |
Method | First | Second | Third | Average |
---|---|---|---|---|
algebraic operation (ms) | 752 | 753 | 748 | 751 |
Weiler–Atherton algorithm (ms) | 4807 | 4910 | 4781 | 4836 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Hou, K.; Cheng, C.; Chen, B.; Zhang, C.; He, L.; Meng, L.; Li, S. A Set of Integral Grid-Coding Algebraic Operations Based on GeoSOT-3D. ISPRS Int. J. Geo-Inf. 2021, 10, 489. https://doi.org/10.3390/ijgi10070489
Hou K, Cheng C, Chen B, Zhang C, He L, Meng L, Li S. A Set of Integral Grid-Coding Algebraic Operations Based on GeoSOT-3D. ISPRS International Journal of Geo-Information. 2021; 10(7):489. https://doi.org/10.3390/ijgi10070489
Chicago/Turabian StyleHou, Kaihua, Chengqi Cheng, Bo Chen, Chi Zhang, Liesong He, Li Meng, and Shuang Li. 2021. "A Set of Integral Grid-Coding Algebraic Operations Based on GeoSOT-3D" ISPRS International Journal of Geo-Information 10, no. 7: 489. https://doi.org/10.3390/ijgi10070489
APA StyleHou, K., Cheng, C., Chen, B., Zhang, C., He, L., Meng, L., & Li, S. (2021). A Set of Integral Grid-Coding Algebraic Operations Based on GeoSOT-3D. ISPRS International Journal of Geo-Information, 10(7), 489. https://doi.org/10.3390/ijgi10070489