本文整理了Java中org.apache.lucene.geo.GeoEncodingUtils.createDistancePredicate()
方法的一些代码示例,展示了GeoEncodingUtils.createDistancePredicate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeoEncodingUtils.createDistancePredicate()
方法的具体详情如下:
包路径:org.apache.lucene.geo.GeoEncodingUtils
类名称:GeoEncodingUtils
方法名:createDistancePredicate
[英]Create a predicate that checks whether points are within a distance of a given point. It works by computing the bounding box around the circle that is defined by the given points/distance and splitting it into between 1024 and 4096 smaller boxes (40960.75^2=2304 on average). Then for each sub box, it computes the relation between this box and the distance query. Finally at search time, it first computes the sub box that the point belongs to, most of the time, no distance computation will need to be performed since all points from the sub box will either be in or out of the circle.
[中]创建一个谓词,检查点是否在给定点的距离内。它的工作原理是计算给定点/距离定义的圆周围的边界框,并将其拆分为1024到4096个较小的框(平均40960.75^2=2304)。然后,对于每个子框,它计算该框与距离查询之间的关系。最后,在搜索时,它首先计算点所属的子框,大多数情况下,不需要执行距离计算,因为子框中的所有点都将位于圆内或圆外。
代码示例来源:origin: org.apache.lucene/lucene-core
return new ConstantScoreWeight(this, boost) {
private final GeoEncodingUtils.DistancePredicate distancePredicate = GeoEncodingUtils.createDistancePredicate(latitude, longitude, radiusMeters);
代码示例来源:origin: org.apache.lucene/lucene-core
final GeoEncodingUtils.DistancePredicate distancePredicate = GeoEncodingUtils.createDistancePredicate(latitude, longitude, radiusMeters);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
return new ConstantScoreWeight(this, boost) {
private final GeoEncodingUtils.DistancePredicate distancePredicate = GeoEncodingUtils.createDistancePredicate(latitude, longitude, radiusMeters);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
final GeoEncodingUtils.DistancePredicate distancePredicate = GeoEncodingUtils.createDistancePredicate(latitude, longitude, radiusMeters);
内容来源于网络,如有侵权,请联系作者删除!