org.khelekore.prtree.MinDistComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of georewrite Show documentation
Show all versions of georewrite Show documentation
重写geoserver发送到h2的sql,以实现自定义数据源
package org.khelekore.prtree;
import java.util.Comparator;
/** A comparator that uses the MINDIST metrics to sort Nodes
* @param the data stored in the nodes
* @param the actual node
*/
class MinDistComparator> implements Comparator {
public final MBRConverter converter;
public final PointND p;
public MinDistComparator (MBRConverter converter, PointND p) {
this.converter = converter;
this.p = p;
}
public int compare (S t1, S t2) {
MBR mbr1 = t1.getMBR (converter);
MBR mbr2 = t2.getMBR (converter);
return Double.compare (MinDist.get (mbr1, p),
MinDist.get (mbr2, p));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy