Skip to content

Commit 0a51d0e

Browse files
committed
Declare support of sparsehash based index deprecated
1 parent c7f136f commit 0a51d0e

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
170170
include_directories(${OSMIUM_INCLUDE_DIR})
171171

172172
if(WITH_PROJ)
173-
find_package(Osmium COMPONENTS io gdal geos proj sparsehash)
173+
find_package(Osmium COMPONENTS io gdal geos proj)
174174
else()
175-
find_package(Osmium COMPONENTS io gdal geos sparsehash)
175+
find_package(Osmium COMPONENTS io gdal geos)
176176
endif()
177177

178178
# The find_package put the directory where it found the libosmium includes

cmake/FindOsmium.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# geos - include if you want to use any of the GEOS functions
3434
# gdal - include if you want to use any of the OGR functions
3535
# proj - include if you want to use any of the Proj.4 functions
36-
# sparsehash - include if you use the sparsehash index
36+
# sparsehash - include if you use the sparsehash index (deprecated!)
3737
# lz4 - include support for LZ4 compression of PBF files
3838
#
3939
# You can check for success with something like this:
@@ -224,6 +224,7 @@ endif()
224224
#----------------------------------------------------------------------
225225
# Component 'sparsehash'
226226
if(Osmium_USE_SPARSEHASH)
227+
message(WARNING "Osmium: Use of Google SparseHash is deprecated. Please switch to a different index type.")
227228
find_path(SPARSEHASH_INCLUDE_DIR google/sparsetable)
228229

229230
list(APPEND OSMIUM_EXTRA_FIND_VARS SPARSEHASH_INCLUDE_DIR)

include/osmium/index/map/sparse_mem_table.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ DEALINGS IN THE SOFTWARE.
3838
#include <osmium/index/index.hpp>
3939
#include <osmium/index/map.hpp>
4040
#include <osmium/io/detail/read_write.hpp>
41+
#include <osmium/util/compatibility.hpp>
4142

4243
#include <google/sparsetable>
4344

@@ -63,9 +64,12 @@ namespace osmium {
6364
* country extracts).
6465
*
6566
* This will only work on 64 bit machines.
67+
*
68+
* @deprecated
69+
* Use one of the other indexes instead.
6670
*/
6771
template <typename TId, typename TValue>
68-
class SparseMemTable : public osmium::index::map::Map<TId, TValue> {
72+
class OSMIUM_DEPRECATED SparseMemTable : public osmium::index::map::Map<TId, TValue> {
6973

7074
TId m_grow_size;
7175

0 commit comments

Comments
 (0)