I want to find the nearest point having latitude and longitude stored as Point in SpatiaLite. I read this and it has this example:
SELECT feature_name, feature_class, ST_Distance(Geometry, MakePoint(-70.250, 43.802)) AS Distance FROM XYGNIS WHERE distance < 0.1 AND ROWID IN (SELECT ROWID FROM SpatialIndex WHERE f_table_name = 'XYGNIS' AND search_frame = BuildCircleMbr(-70.250, 43.802, 0.1)) ORDER BY distance LIMIT 10
I cannot use it, however, since ST_Distance requiring compiling SpatiaLite with GEOS, which is in LGPL, which I cannot use. Is there a way I can do arithmetics to calculate distance and set that to a "variable" and then find the one with the minimal distance?