# Selection of Grid Road Networks Based on Raster Data
## 3 Method for Multiscale Representation of High-Density Transportation Networks
### Road Superpixel Matching and Selection  
During this step, the global structure and local connectivity of road networks are taken into account based on graph theory and the shortest path. First, to preserve the connectivity of roads at different levels of detail, the intersection superpixels (\(IS_{S}\)) between roads with different levels or widths are first detected. Then, by matching these intersection superpixels at the lower levels, the minimal route between two superpixels is determined by leveraging the graph architecture derived from the inter-superpixel spatial association. Finally, according to the overlap degree between the shortest paths, road superpixels with global structure at the lower levels are selected. After multilevel division, we can divide the original raster road network into superpixels with multiple levels. Assuming that at two adjacent levels, set \(H\) contains all the road superpixels at the higher level, such as the dark-grey superpixels in Figure 3a, and set \(L\) contains all the road superpixels at the lower level, such as the light-grey superpixels in Figure 3a, the detailed steps for road superpixel matching and selection are as follows:  
Step 1: Detection of the main road direction in the area at the lower level. The main direction equals the angle of the longest line segments generated by the Hough line detection [40] method, which identifies lines by detecting intersections of potential line  
Figure 2: Multilevel division of raster road networks. (**a**) Original road network. (**b**) Initial superpixel segmentation. (**c**) Neighboring superpixels for further segmentation. (**d**) Final superpixel segmentation result. candidates. The angle ranges from 0\({}^{\lx@math@degree}\) to 180\({}^{\lx@math@degree}\), such as the angle of the line marked with bright color in Figure 3b. The Hough line detection is based on the Hough line transform, which can be used for the detection of straight lines on images. A straight line in different coordinate systems can be defined as follows:  
\[y=mx+b \tag{2}\]  
\[\rho=xcos\theta+ysin\theta \tag{3}\]  
where Equation (2) denotes a line in the Cartesian coordinate system with parameters m and b, and Equation (3) denotes a line in the Polar coordinate system with parameters \(\rho\) and \(\theta\). For Hough transforms, a straight line can be defined as follows:  
\[y=-\frac{cos\theta}{sin\theta}x+\frac{\rho}{sin\theta} \tag{4}\]  
Step 2: Detection of road intersection superpixels at the lower level. Assuming that \(C\) is a superpixel in a lower-level road area, when the superpixels adjacent to superpixel \(C\) contain a superpixel of the higher level, superpixel \(C\) should be marked as a road intersection superpixel. As shown in Figure 3c, the blue superpixels in the black rectangles are the detected road intersection superpixels;  
Step 3: Matching of road intersection superpixels based on the minimum angle and maximum distance rules. In this step, the minimum angle rule means that the angle between the main direction (or perpendicular direction) of the lower-level roads in the area and the direction of the line formed by the centers of mass of two matched road intersection superpixels should be lower than the given angle threshold (\(AT\)). The maximum distance rule means that the distance between the centers of mass of two matched road intersection superpixels should be maximum when the minimum angle rule is satisfied. When both the minimum angle and maximum distance rules are satisfied, matched road intersection superpixels can be generated. For example, in Figure 3d, the matched road intersection superpixels are connected by blue lines and the given angle threshold is \(AT=8^{\lx@math@degree}\).