# null means aBA, aDC are not used
## 5 Conclusions  
We demonstrated that some of the most powerful spatial analysis software solutions perform some geodetic calculations approximately. Two of these operations are the intersection of two geodesics and the minimum distance from a point to a geodesic. These operations are critical to implement a true geodetic spatial analysis engine, since many other more complex spatial processes are based on them, therefore, they must be calculated with high accuracy, that is close to machine precision (so that, in practice, they are insignificantly affected by numerical truncations). The deviations committed by these popular spatial analysis software are large, easily exceeding the necessary tolerances according to the spatial analysis objectives. Even for geodesics of a few kilometers the best studied solution gave us deviations of centimeters. For longer lines they showed deviations of meters. We presented two algorithms in Java and PostGIS that perform high accuracy calculations on the ellipsoid using double precision types, achieving an error lower than 100 nm in both operations. The implementation of this algorithm provides the following features:  
* The accuracy obtained is higher than using local projections even considering very short distances. * It allows a highly accurate spatial analysis even in large extensions of territory (national, continental or global). * Worrying about choosing the best-fit projection for analyzing the data becomes unnecessary, since we do not need to use any projection. * A good performance (considering the spatial analysis is on the ellipsoid) is achieved (20,000 geodesic intersections per second) due to a fast convergence process. The worst scenario took six iterations, if the final accuracy goal is \(\upmu\)m instead of nm we can reduce the number of iterations by one or two. The proposed algorithm is fast enough to allow the migration of flat computational geometry libraries (JTS, GDAL, etc.) to computational geometries libraries on the ellipsoid. This way, a full spatial analysis software solution on the ellipsoid could be offered for the first time. Consequently, we propose the following final recommendations for practical use when preparing a geodetic spatial analysis engine:
* Some of the most renowned spatial analysis software solutions rely on the use of auxiliary map projections to solve problems on the surface of the ellipsoid which may produce manifestly incorrect results. These auxiliary map projections must be abandoned altogether in favor of reliable algorithms for direct computation on the ellipsoid surface that produce accurate results irrespectively of the extension of the area of interest. * In recent times: algorithms that yield results of an accuracy close to machine precision have been developed. This is the case of [PERSON]'s implementation of the direct and inverse problems of geodesy [14] and Transverse Mercator formulas with an accuracy of a few nanometers [36], which are included in GeographicLib [13]. This is also the case of the algorithms for intersection of geodesics and minimum point-to-geodesic distance presented in this paper. Spatial analysis software solutions should incorporate these solutions in order to provide the user with the highest possible accuracy, that is, an accuracy close to machine precision. * When performing geometric calculations on the ellipsoid surface, such as determination of the intersection of geodesics or minimum point-to-geodesic distance, suitable tests for validating the solution (such as the ones used in this paper) should be applied to ensure the degree of accuracy of the solution obtained. Conceptualization, J.C.M.-L. and S.B. ; methodology, J.C.M.-L, S.B. and E.C. ; software, J.C.M.-L. and S.B. ; validation, J.C.M.-L. and S.B. ; formal analysis, E.C. ; resources, E.C. ; data curation, E.C. ; writing--original draft preparation, J.C.M.-L. and S.B. ; writing--review and editing, J.C.M.-L., S.B. and E.C. ; funding acquisition, J.C.M.-L., S.B. and E.C.