Package elki.distance.geo
Class DimensionSelectingLatLngDistance
- java.lang.Object
-
- elki.distance.geo.DimensionSelectingLatLngDistance
-
- All Implemented Interfaces:
Distance<NumberVector>,NumberVectorDistance<NumberVector>,PrimitiveDistance<NumberVector>,SpatialPrimitiveDistance<NumberVector>
@Reference(authors="Erich Schubert, Arthur Zimek, Hans-Peter Kriegel", title="Geodetic Distance Queries on R-Trees for Indexing Geographic Data", booktitle="Int. Symp. Advances in Spatial and Temporal Databases (SSTD\'2013)", url="https://doi.org/10.1007/978-3-642-40235-7_9", bibkey="DBLP:conf/ssd/SchubertZK13") public class DimensionSelectingLatLngDistance extends java.lang.Object implements SpatialPrimitiveDistance<NumberVector>, NumberVectorDistance<NumberVector>
Distance function for 2D vectors in Latitude, Longitude form.The input data must be in degrees (not radians), and the output distance will be in meters (see
EarthModel.distanceDeg(double, double, double, double)).This implementation allows index accelerated queries using R*-trees (by providing a point-to-rectangle minimum distance).
Reference:
Erich Schubert, Arthur Zimek, Hans-Peter Kriegel
Geodetic Distance Queries on R-Trees for Indexing Geographic Data
Int. Symp. Advances in Spatial and Temporal Databases (SSTD'2013)- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDimensionSelectingLatLngDistance.ParParameterization class.
-
Field Summary
Fields Modifier and Type Field Description (package private) intdimlatLatitude dimension.(package private) intdimlngLongitude dimension.(package private) EarthModelmodelEarth model used.
-
Constructor Summary
Constructors Constructor Description DimensionSelectingLatLngDistance(int dimlat, int dimlng, EarthModel model)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledistance(NumberVector o1, NumberVector o2)Computes the distance between two given DatabaseObjects according to this distance function.booleanequals(java.lang.Object obj)SimpleTypeInformation<? super NumberVector>getInputTypeRestriction()Get the input data type of the function.inthashCode()booleanisMetric()Is this distance function metric (satisfy the triangle inequality)doubleminDist(SpatialComparable mbr1, SpatialComparable mbr2)Computes the distance between the two given MBRs according to this distance function.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isSquared, isSymmetric
-
Methods inherited from interface elki.distance.SpatialPrimitiveDistance
instantiate
-
-
-
-
Field Detail
-
dimlat
final int dimlat
Latitude dimension.
-
dimlng
final int dimlng
Longitude dimension.
-
model
final EarthModel model
Earth model used.
-
-
Constructor Detail
-
DimensionSelectingLatLngDistance
public DimensionSelectingLatLngDistance(int dimlat, int dimlng, EarthModel model)Constructor.- Parameters:
dimlat- Dimension storing the latitudedimlng- Dimension storing the longitudemodel- Earth model
-
-
Method Detail
-
distance
public double distance(NumberVector o1, NumberVector o2)
Description copied from interface:PrimitiveDistanceComputes the distance between two given DatabaseObjects according to this distance function.- Specified by:
distancein interfaceNumberVectorDistance<NumberVector>- Specified by:
distancein interfacePrimitiveDistance<NumberVector>- Parameters:
o1- first DatabaseObjecto2- second DatabaseObject- Returns:
- the distance between two given DatabaseObjects according to this distance function
-
minDist
public double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
Description copied from interface:SpatialPrimitiveDistanceComputes the distance between the two given MBRs according to this distance function.- Specified by:
minDistin interfaceSpatialPrimitiveDistance<NumberVector>- Parameters:
mbr1- the first MBR objectmbr2- the second MBR object- Returns:
- the distance between the two given MBRs according to this distance function
-
getInputTypeRestriction
public SimpleTypeInformation<? super NumberVector> getInputTypeRestriction()
Description copied from interface:DistanceGet the input data type of the function.- Specified by:
getInputTypeRestrictionin interfaceDistance<NumberVector>- Specified by:
getInputTypeRestrictionin interfacePrimitiveDistance<NumberVector>- Returns:
- Type restriction
-
isMetric
public boolean isMetric()
Description copied from interface:DistanceIs this distance function metric (satisfy the triangle inequality)- Specified by:
isMetricin interfaceDistance<NumberVector>- Returns:
truewhen metric.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-