# Improving a Street-Based Geocoding Algorithm Using Machine Learning Techniques
## 3 Geocoding Algorithm Using Machine Learning Techniques
### Address Locating  
The U.S. Census Bureau performs address locating with address ranges [47]. As illustrated in Figure 5, each record in the address database includes two address ranges for the left and right sides of the road. The left side has odd-numbered addresses, and the right side has even-numbered addresses. For example, geocoding the address with the building number '105' means we must first identify how this building number was assigned. In some territories, such as in the United States, the Bureau assigns this number from the address number range of the start and end nodes located at the centerline of the roads intersecting the concerned road segment. The building number arises from interpolation. Since the numbering begins at the centerlines, not within the segment itself, the widths of these perpendicular roads containing the start node, or start width, and the end node, or end width, must be taken into consideration. Therefore, to geocode this building's address, its location is approximated on the left side (odd-numbered addresses) of the road 'Park Avenue' using a linear interpolation method. In order to adjust the aforementioned road's length, the road types of the adjacent roads (i.e., road containing the start node and the one containing the end node) are taken into consideration. Figure 5 (Left) illustrates this case. In some cases, such as in Korea, the start and end nodes are aligned with two end sides of a road segment instead of intersection points (right side of Figure 5). With this, it is apparent that the segment is cut off by half of the length of connected roads on both sides, shortening the total actual segment distance by twice of this _end_offset_ value. Since 10 m shows the highest accuracy of geocoding among 5, 10, and 15 m (not presented here), this study used this value for the _end_offset_. From the address database, the values for the \(X\) and \(Y\) coordinates for the start and end of the road segments, \(x_{from}\), \(y_{from}\), \(x_{to}\), \(y_{to}\), were obtained, and these values were used for the bearing angle \(\theta\)o. Using the _end offset_ value and \(\theta\)o, we calculated the \(X\) and \(Y\) coordinates, \(x_{start}\), \(y_{start}\), \(x_{end}\), \(y_{end}\), of the shortened segment, after cut-off. Since the segment cut-off only signifies the width of the road perpendicular to the road segment in concern, the \(x_{start}\) and \(y_{start}\) corresponding to the beginning of the shortened segment, is still not in the middle of the sub-segment corresponding to the first building number, for example, '101' in Figure 5 on the right side. Hence, after interpolating for the location of building number '103' along  
Figure 5: Address locating that assigns building numbers proportionally along roads (**Left**) or considering end offsets (**Right**). the segment, the midpoint was calculated using the quantity _mid_offset_. This midpoint is the position on the segment directly in front of the building's center. In both types of addresses, the geocoded point's final location (\(x\), \(y\)) is inside a building or a parcel. This final point is calculated along a pre-defined perpendicular offset, _perp offset_ in Algorithm 4, away from the road. The offset can be a fixed value, like 5 m, 10 m, or a combination of different values considering road types, having an azimuth Az with a value 90\({}^{\circ}\) away from 60 clockwise, if the building is on the right, or counterclockwise if the building is on the left. In this study, the offset is a combination of different values considering road types. Since the width of the road can vary according to different road types, we expect the combination offset to work well to move addresses on a building or a parcel correctly. Within the context of roads in Korea, the wide road type has a width of 30 m. Similarly, we assigned a width of the narrow roads with less than four lanes to 6 m, and the others to 20 m. Figure 6 illustrates this process and the procedure that follows details this.