Enhancing Quad Tree for Spatial Index Using Space Filling Curves

Spatial indexes, such as those based on the Quad Tree, are important in spatial databases for the effective implementation of queries with spatial constraints, especially when queries involve spatial links. The quaternary trees are a very interesting subject, given the fact that they give the ability to solve problems in a way that focuses only on the important areas with the highest density of information. Nevertheless, it is not without the disadvantages because the search process in the quad tree suffers from the problem of repetition when reaching the terminal node and return to the behavior of another way in the search and lead to the absorption of large amounts of time and storage. In this paper, the quad tree was improved by combining it with one of the space filling curve types, resulting in reduced storage space requirements and improved implementation time.


Introduction
Spatial indexing is based on physically grouping indexed items. For instance, it is possible to group countries based on their continent. With spatial indexing, there is even a possibility of providing VR (virtual reality) fly through (or over, or under) for helping the users in the maintenance of their search context as they expand or narrow the range of their search. Spatial indexing has a richness, which is capable of paralleling the indexing according to subjects or authors. The spatial indexing concept is quite powerful, that for managing records, records are detected according to how they are associated with a place. A considerable number of records is strongly associated with a place. Such as other indexing forms, geographic indexing may be joined with other forms of indexing [1]. Quad trees are very important, as they solve problems and focus on working in areas where spatial data are more intense than others.
In many places, the volume of work corresponds to the number of lumps combined (Such as tree structure nodes) shorten the actual number of pixels in the original Picture. This way, they can potentially reduce storage space requirements and enhancing the effectiveness of execution time. Data-base Management system is capable of easily handling data in the case where objects are 1-D in nature. Objects that are to be stored are of more than one dimension, to do this; it will be required to use space filling curves. There is a considerable number of space filling curves that were mentioned in literature. Throughout the early days space filling curves have been mainly viewed as a mathematical curiosity. Nevertheless, nowadays, space-filling curves are being implemented in a wide variety of fields, like, reduction of space dimension, grid computing load balancing, I/O-efficient calculations on massive matrices, design of small antennas, and creating spatial data indexes. In the presented research, the emphasis has been placed on applying spacefilling curves in creating query-efficient indexes of spatial data with the use of the Z-order curve [2]. The presented paper has been organized in the following: Section 2 provides related works. Section 3 describes about quad trees .section 4 gives a brief survey about Z-order curve. Section 5 Method for quad tree building, Section 5 experimental results. Section 7 includes a presentation of the conclusions and future researches

Related Work
This section presents the studies about the spatial index with several published researches related to the goals of this work: Sardadi extensive study was undertaken on the design of effective data structures to enable rapid spatial research. Commercial database suppliers such as Oracle have begun to implement this spatial indexing to meet the needs of large and diverse GIS. This paper focused on the choice of spatial indexing of the R and quad tree using the spatial Oracle database in the mobile GIS application. The use of quadratic spatial data indexing and R-tree in a single spatial database saved up to 42.5% [3]. Lim presented a method where, classification of packets is an important function for next-generation Internet routers to provide high quality of service. Then the priority area-based quad-tree (PAQT) packet classification algorithm combining priority search and recursive space decomposition is formally described using the framework. Extensive simulation results have demonstrated that PAQT algorithm performs quite well in comparison with other approaches of packet classification concerning the speed of search, the size of the memory, in addition to scalability [4]. Qasem used a Quad Tree to find the constant neighbor on time, four main neighbors are identified for every one of the quadrants. Those designated neighbors will permit accessing every neighbor on every side in the phase of recovery. This access is done at a fixed time for cardinal neighbors independent of their size. The proposed method required a 31% increase in quad tree memory, allowing an average of 69.7% at the time of arrival of neighbors as described by experimental results. The CN-Quad tree will provide opportunities for new improvements in image analysis and processing, robot routing and mobility planning [8]. Kumar based on the rapid motion estimation algorithm and the structure of the hybrid quad tree, these algorithms are suitable in the search for large, small and very small movements respectively, the resultant algorithm is much stronger for complicated sequences of movement, obtained smaller motion projection quality errors, and has consistent computational complexity in the video sequence [5]. Zhou presented a method where, the polygons that intersect with the axes of the quarters were stored in the five bulldozers to hold a different root level, and the polygons were separated into all axes of the quarters stored in the paper nodes. By storing embedding relationships between complicated polygons and their holes in an explicitly inserted table. Index operations (such as insertion, deletion and query) were performed and the improved indicator effectiveness was verified through the incremental land cover data update experiment. Experimental results showed that the sufficiency of incremental updating time has enhanced markedly, and that the enhancement is growing with the volume of data. Compared to other approaches [6].

Quad Tree Basics
Quad trees are quite a straight forward method of spatial indexing. In a Quad tree, every one of the nodes denotes a bounding box that covers part of the space that is being indexed, with the root node that covers the whole area. Every one of the nodes can either be a leaf node -where it contains one or more points of indexing, and does not include children, or it can be an internal node, where it has precisely 4 children, one for every one of the quadrants that have been obtained via dividing the area which is covered in half along the two axes. For querying a quad tree, beginning from the root, the first thing to do is examining every one of the child nodes, and checking whether it is intersecting the area which it is being queried for. In case where it does, recourse to that child node. In the case of encountering a leaf node, every entry should be examined in order to see whether it is intersecting with the area of the query, and if so, return it [6]. In Quad tree every one of the nodes includes <x, y, width, NE, NW, SE, SW> where x, y represents the location of top left corner of the square width is the side length. NE, NW, SE, SW point to sub square of the parent square, as shown in the Figure 1.

Z-ordering Space Filling Curves
For the sake of mapping multidimensional objects of data to one-dimensional objects, a number of space filling curves were developed. The majority of those curves are continuous self-similar fractal curves. There are two types of curves that are commonly accepted as approaches for spacing filling for the existing multidimensional applications, which are: Z-Ordering Curve and Hilbert Curve, as shown in the Figure 2 [7]. As it can be deducted from its name, this curve has been presented by D. Hilbert in 19-th century. The inner-most black line in Figure 3(a) is a 1st order Hilbert curve, the central black line is a 2nd order Hilbert curve, and the grey line is a 3rd order Hilbert curve. It shows the way a Hilbert curve is capable of recursively exploring a space. By those lines, the rectangles or particles in this two-dimensional space may be traced in a linear manner. Which offers the possibility of mapping two-dimensional objects to one-dimensional objects. Advanced algorithms are available for calculating the Hilbert order that are important for performing operations like search, delete and insert. This Curve, in combination with an R-tree data structure is commonly utilized in multidimensional applications, as shown in the Figure 3 [7]. Morten has proposed Z-ordering curve in the year of 1966. A point's z-value in a multidimensional space is simply computed via interleaving the binary representations of the values of its coordinates, as shown in the Figure 4. As soon as the data is sorted to this ordering, any 1-D data structure may be utilized like B-trees, binary search trees, skip lists or (with low significant bits truncated) hash tables, as shown in the

Improved Method for Quad Tree
Z-order may be utilized to create a quad tree structure and associated data structures of higherdimensions. The order of how these four sub-regions are stored has a close connection to the curve filling the area. If a multidimensional application implements a Z-order curve, creating Quad tree in SE, SW, NE, and NW are going to be of a higher efficiency to access the data. Where the work is in two steps: The Quad-tree splits the rectangle area to four parts in a recursive way. All parts are equally sized, as shown in the Figure 1.
Step1: Divide the area to 4 quarters. Sub divides every one of the quadrants to 4 quadrants. Repeat this process so that every one of the quadrants has the lowest number of points. This shift is called the first shift.
Step 2: The Preserve Distance parameter is utilized to assign points in every one of the cells to a point in a distance of one dimension. This transformation is called the second shift.

Quad tree building & Z-order algorithm
Input: -Generate random points in a Specific region Output: -one-dimensional sequential points (p1, p2, p3… pn) 1. Converting the point to an are coordinate which is referred to as (p, q) Current node = root Found=false 3. Map (x, y) to Z-order space or Hilbert order referred to as P. 4. Production sequence of p1, p2… pn as shown in the Figure 6.
The data used for which q is applied is a structure with certain dimensions. Random points were generated within the blue color. The number of random points in each experiment was changed. A single point of red color was also included in fixed coordinates in that structure to be searched. Each time and for each of the normal and hybrid quad tree cases. , as shown in the Figure 7. After applying the regular quad tree on the above structure, give it a fixed number of minimum points to divide the quad tree into four quadrants which is k = 10, as shown in the Figure 8. When experimenting with the hybrid quad tree, quad tree with H-curves resulted in the Figure 9. Similarly, when experimenting with the hybrid quad tree, quad tree with Z-order resulted in the Figure 10. And when the mechanism of work quad tree on random points and then indicate the stage of integration with one of the types of space filling curves to convert those points sequentially from 2-dimension to 1-dimension , as shown in the Figure 11.

Performance Results
In the spatial indexing process, the hybrid structure of quadruple tree and Z-order maps may benefit from both recovery (time) and storage (size). The objects are divided and represented, determining the minimum number of points that divide the quarter division into quarters is k = 10, the work has been applied to random points generated, where each point coordinates (x, y) on the structure used. In the same way, when calculating the amount of time it takes, it will retrieve the red dot information that is (X: 110, Y: 110) which are searched each time for a different number of points. The time taken when applying a quadruple tree alone is much greater than applying the hybrid state of Zcurves with a quad tree and H curves with a quad tree, as shown in the Table 1. When the time results are represented by the graph below, we note that the time taken has greatly improved the hybrid state with the quad tree, as shown in the Figure 12. After quad tree is applied to the points, the required amount of storage was calculated in bytes and the hybrid structure of the quadrature and z-curves were applied. This has led to a significant reduction for storage required, where the sequence of points in the hybrid state has been. -Note that the hybrid structure is equal in terms of storage for its quad tree with z-curves and Hcurves for each number of points. The experiment was conducted each time as shown in the Table 2.
When the above storage results are represented by the graph, the difference is obvious. The black line represents a quadruple tree; the red line represents Z curves with a quad tree, while the blue line represents H curves with a quad tree,, as shown in the Figure 13.The index size of the quad tree data is reduced by the same amount for both the Hilbert curve and Z-order curve.

Conclusion
The majority of quad tree algorithm improvements depend on the speed of access and the amount of storage needed to represent the data and index them spatially, and most multidimensional applications focus on sequential reading. As storing and searching for objects will be performed very efficiently. In this paper, the quad tree algorithm is optimized by hybridizing with some types of space filling curves, which are Z-curve and H-curve. They arrange the points sequentially and transform them from 2-dimension to 1-dimension, so that the occurrence of the recurrence is eliminated in the normal quad tree search process. When a particular node is searched in quad tree and reaches To the terminal node in the tree, it returns to repeat the contract back to take another path, and it takes a lot of time and storage, The method was applied to randomly generated points using normal quad tree and quad tree hybrid and found a significant improvement in time and storage required.