在没有GEOS的情况下找到SpatiaLite中最近的点

时间:2012-09-15 16:16:23

标签: sql nearest-neighbor spatialite

我想在SpatiaLite中找到最近点的纬度和经度存储为Point。我读了this,它有这个例子:

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

我不能使用它,因为ST_Distance要求将SpatiaLite与GEOS一起编译,这是LGPL,我无法使用。有没有办法让算术计算距离并将其设置为“变量”,然后找到距离最小的那个?

0 个答案:

没有答案