eu.europa.ec.eurostat.jgiscotools.algo.base.distance.FeatureDistance Maven / Gradle / Ivy
package eu.europa.ec.eurostat.jgiscotools.algo.base.distance;
import org.locationtech.jts.geom.Geometry;
import eu.europa.ec.eurostat.jgiscotools.feature.Feature;
/**
* Distance for simple features.
*
* @author julien Gaffuri
*
*/
public class FeatureDistance implements Distance {
public FeatureDistance(){}
public double get(Feature f1, Feature f2) {
Geometry g1 = f1.getGeometry();
Geometry g2 = f2.getGeometry();
return g1.distance(g2);
}
}