1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2016 Daniel Baston
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************
14  *
15  * Last port: index/strtree/ItemDistance.java (JTS-1.14)
16  *
17  **********************************************************************/
18 
19 #ifndef GEOS_INDEX_STRTREE_ITEMDISTANCE_H
20 #define GEOS_INDEX_STRTREE_ITEMDISTANCE_H
21 
22 #include <geos/index/strtree/ItemBoundable.h>
23 
24 namespace geos {
25 namespace index {
26 namespace strtree {
27 
28 /** \brief
29  * A function method which computes the distance between two [ItemBoundables](\ref ItemBoundable)
30  * in an STRtree. Used for Nearest Neighbour searches.
31  *
32  * \author Martin Davis
33  */
34 class GEOS_DLL ItemDistance {
35 public:
36     /** \brief
37      * Computes the distance between two items.
38      *
39      * @param item1
40      * @param item2
41      * @return the distance between the items
42      *
43      * @throws IllegalArgumentException if the metric is not applicable to the arguments
44      */
45     virtual double distance(const ItemBoundable* item1, const ItemBoundable* item2) = 0;
46 };
47 }
48 }
49 }
50 
51 #endif //GEOS_ITEMDISTANCE_H
52