[Git][debian-gis-team/spatialindex][upstream] New upstream version 2.0.0~b2

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Tue May 28 20:21:39 BST 2024



Bas Couwenberg pushed to branch upstream at Debian GIS Project / spatialindex


Commits:
0a9a8d3a by Bas Couwenberg at 2024-05-28T21:04:21+02:00
New upstream version 2.0.0~b2
- - - - -


14 changed files:

- CMakeLists.txt
- src/CMakeLists.txt
- src/mvrtree/Index.cc
- src/mvrtree/MVRTree.cc
- src/mvrtree/PointerPoolNode.h
- src/rtree/BulkLoader.cc
- src/rtree/PointerPoolNode.h
- src/rtree/RTree.cc
- src/spatialindex/MovingRegion.cc
- src/spatialindex/Region.cc
- src/tprtree/Index.cc
- src/tprtree/Node.cc
- src/tprtree/PointerPoolNode.h
- src/tprtree/TPRTree.cc


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -16,6 +16,7 @@ project(spatialindex
   HOMEPAGE_URL "https://github.com/libspatialindex/libspatialindex"
 )
 
+
 set(SIDX_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
 set(SIDX_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
 set(SIDX_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
@@ -26,6 +27,14 @@ set(SIDX_LIB_SOVERSION "7")
 
 include(GNUInstallDirs)
 
+
+IF(NOT CMAKE_BUILD_TYPE)
+    SET(CMAKE_BUILD_TYPE Release CACHE STRING
+        "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel"
+        FORCE)
+ENDIF()
+
+
 message(STATUS
   "Configuring CMake ${CMAKE_VERSION} to build spatialindex ${PROJECT_VERSION}")
 


=====================================
src/CMakeLists.txt
=====================================
@@ -201,12 +201,22 @@ target_compile_options(spatialindex
 target_compile_options(spatialindex_c
   PRIVATE ${SIDX_COMMON_CXX_FLAGS})
 
-set_target_properties( spatialindex PROPERTIES 
-    RUNTIME_OUTPUT_DIRECTORY 
+target_compile_definitions(spatialindex
+    PRIVATE
+        $<$<CONFIG:Debug>:SIDX_DEBUG>
+)
+
+target_compile_definitions(spatialindex_c
+    PRIVATE
+        $<$<CONFIG:Debug>:SIDX_DEBUG>
+)
+
+set_target_properties( spatialindex PROPERTIES
+    RUNTIME_OUTPUT_DIRECTORY
     ${CMAKE_BINARY_DIR}/bin)
 
-set_target_properties( spatialindex_c PROPERTIES 
-    RUNTIME_OUTPUT_DIRECTORY 
+set_target_properties( spatialindex_c PROPERTIES
+    RUNTIME_OUTPUT_DIRECTORY
     ${CMAKE_BINARY_DIR}/bin)
 
 


=====================================
src/mvrtree/Index.cc
=====================================
@@ -5,7 +5,7 @@
  * Copyright (c) 2002, Marios Hadjieleftheriou
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -180,7 +180,7 @@ uint32_t Index::findLeastEnlargement(const TimeRegion& r) const
 		}
 	}
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 	if (best == std::numeric_limits<uint32_t>::max())
 	{
 		std::ostringstream s;
@@ -237,7 +237,7 @@ uint32_t Index::findLeastOverlap(const TimeRegion& r) const
 		++cLiveEntries;
 	}
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 	if (cLiveEntries == 0)
 	{
 		std::ostringstream s;


=====================================
src/mvrtree/MVRTree.cc
=====================================
@@ -1337,7 +1337,7 @@ std::ostream& SpatialIndex::MVRTree::operator<<(std::ostream& os, const MVRTree&
 	os << t.m_stats;
 	os << t.printRootInfo();
 
-	#ifndef NDEBUG
+	#ifdef SIDX_DEBUG
 	os 	<< "Leaf pool hits: " << t.m_leafPool.m_hits << std::endl
 		<< "Leaf pool misses: " << t.m_leafPool.m_misses << std::endl
 		<< "Index pool hits: " << t.m_indexPool.m_hits << std::endl


=====================================
src/mvrtree/PointerPoolNode.h
=====================================
@@ -5,7 +5,7 @@
  * Copyright (c) 2002, Marios Hadjieleftheriou
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -36,7 +36,7 @@ namespace Tools
 	public:
 		explicit PointerPool(uint32_t capacity) : m_capacity(capacity)
 		{
-			#ifndef NDEBUG
+			#ifdef SIDX_DEBUG
 			m_hits = 0;
 			m_misses = 0;
 			m_pointerCount = 0;
@@ -50,13 +50,13 @@ namespace Tools
 			while (! m_pool.empty())
 			{
 				SpatialIndex::MVRTree::Node* x = m_pool.top(); m_pool.pop();
-				#ifndef NDEBUG
+				#ifdef SIDX_DEBUG
 				--m_pointerCount;
 				#endif
 				delete x;
 			}
 
-			#ifndef NDEBUG
+			#ifdef SIDX_DEBUG
 			std::cerr << "Lost pointers: " << m_pointerCount << std::endl;
 			#endif
 		}
@@ -66,13 +66,13 @@ namespace Tools
 			if (! m_pool.empty())
 			{
 				SpatialIndex::MVRTree::Node* p = m_pool.top(); m_pool.pop();
-				#ifndef NDEBUG
+				#ifdef SIDX_DEBUG
 				++m_hits;
 				#endif
 
 				return PoolPointer<SpatialIndex::MVRTree::Node>(p, this);
 			}
-			#ifndef NDEBUG
+			#ifdef SIDX_DEBUG
 			else
 			{
 				// fixme: well sort of...
@@ -107,7 +107,7 @@ namespace Tools
 				}
 				else
 				{
-					#ifndef NDEBUG
+					#ifdef SIDX_DEBUG
 					--m_pointerCount;
 					#endif
 					delete p;
@@ -128,7 +128,7 @@ namespace Tools
 		uint32_t m_capacity;
 		std::stack<SpatialIndex::MVRTree::Node*> m_pool;
 
-	#ifndef NDEBUG
+	#ifdef SIDX_DEBUG
 	public:
 		uint64_t m_hits;
 		uint64_t m_misses;


=====================================
src/rtree/BulkLoader.cc
=====================================
@@ -333,7 +333,7 @@ void BulkLoader::bulkLoadUsingSTR(
 	NodePtr n = pTree->readNode(pTree->m_rootID);
 	pTree->deleteNode(n.get());
 
-	#ifndef NDEBUG
+	#ifdef SIDX_DEBUG
 	std::cerr << "RTree::BulkLoader: Sorting data." << std::endl;
 	#endif
 
@@ -360,7 +360,7 @@ void BulkLoader::bulkLoadUsingSTR(
 
 	while (true)
 	{
-		#ifndef NDEBUG
+		#ifdef SIDX_DEBUG
 		std::cerr << "RTree::BulkLoader: Building level " << level << std::endl;
 		#endif
 


=====================================
src/rtree/PointerPoolNode.h
=====================================
@@ -5,7 +5,7 @@
  * Copyright (c) 2002, Marios Hadjieleftheriou
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -38,7 +38,7 @@ namespace Tools
 	public:
 		explicit PointerPool(uint32_t capacity) : m_capacity(capacity)
 		{
-			#ifndef NDEBUG
+			#ifdef SIDX_DEBUG
 			m_hits = 0;
 			m_misses = 0;
 			m_pointerCount = 0;
@@ -52,13 +52,13 @@ namespace Tools
 			while (! m_pool.empty())
 			{
 				RTree::Node* x = m_pool.top(); m_pool.pop();
-				#ifndef NDEBUG
+				#ifdef SIDX_DEBUG
 				--m_pointerCount;
 				#endif
 				delete x;
 			}
 
-			#ifndef NDEBUG
+			#ifdef SIDX_DEBUG
 			std::cerr << "Lost pointers: " << m_pointerCount << std::endl;
 			#endif
 		}
@@ -68,13 +68,13 @@ namespace Tools
 			if (! m_pool.empty())
 			{
 				RTree::Node* p = m_pool.top(); m_pool.pop();
-				#ifndef NDEBUG
+				#ifdef SIDX_DEBUG
 				++m_hits;
 				#endif
 
 				return PoolPointer<RTree::Node>(p, this);
 			}
-			#ifndef NDEBUG
+			#ifdef SIDX_DEBUG
 			else
 			{
 				// fixme: well sort of...
@@ -112,7 +112,7 @@ namespace Tools
 				}
 				else
 				{
-					#ifndef NDEBUG
+					#ifdef SIDX_DEBUG
 					--m_pointerCount;
 					#endif
 					delete p;
@@ -133,7 +133,7 @@ namespace Tools
 		uint32_t m_capacity;
 		std::stack<RTree::Node*> m_pool;
 
-	#ifndef NDEBUG
+	#ifdef SIDX_DEBUG
 	public:
 		uint64_t m_hits;
 		uint64_t m_misses;


=====================================
src/rtree/RTree.cc
=====================================
@@ -1334,7 +1334,7 @@ SpatialIndex::id_type SpatialIndex::RTree::RTree::writeNode(Node* n)
 		n->m_identifier = page;
 		++(m_stats.m_u32Nodes);
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 		try
 		{
 			m_stats.m_nodesInLevel[n->m_level] = m_stats.m_nodesInLevel.at(n->m_level) + 1;
@@ -1563,7 +1563,7 @@ std::ostream& SpatialIndex::RTree::operator<<(std::ostream& os, const RTree& t)
 		os	<< "Utilization: " << 100 * t.m_stats.getNumberOfData() / (t.m_stats.getNumberOfNodesInLevel(0) * t.m_leafCapacity) << "%" << std::endl
 			<< t.m_stats;
 
-	#ifndef NDEBUG
+	#ifdef SIDX_DEBUG
 	os	<< "Leaf pool hits: " << t.m_leafPool.m_hits << std::endl
 		<< "Leaf pool misses: " << t.m_leafPool.m_misses << std::endl
 		<< "Index pool hits: " << t.m_indexPool.m_hits << std::endl


=====================================
src/spatialindex/MovingRegion.cc
=====================================
@@ -183,7 +183,7 @@ void MovingRegion::initialize(
 
 	if (m_endTime <= m_startTime) throw Tools::IllegalArgumentException("MovingRegion: Cannot support degenerate time intervals.");
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 	for (uint32_t cDim = 0; cDim < m_dimension; ++cDim)
 	{
 		if (pLow[cDim] > pHigh[cDim]) throw Tools::IllegalArgumentException("MovingRegion: Low point has larger coordinates than High point.");
@@ -982,14 +982,14 @@ double MovingRegion::getIntersectingAreaInTime(const IInterval& ivI, const Movin
 
 	// add up the total area of the intersecting pieces.
 	double area = 0.0;
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 	double _t = -std::numeric_limits<double>::max();
 #endif
 
 	while (! pq.empty())
 	{
 		c = pq.top(); pq.pop();
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 		assert(_t <= c.m_t);
 		_t = c.m_t;
 #endif


=====================================
src/spatialindex/Region.cc
=====================================
@@ -5,7 +5,7 @@
  * Copyright (c) 2004, Marios Hadjieleftheriou
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -61,7 +61,7 @@ void Region::initialize(const double* pLow, const double* pHigh, uint32_t dimens
 	m_pLow = nullptr;
 	m_dimension = dimension;
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
     for (uint32_t cDim = 0; cDim < m_dimension; ++cDim)
     {
      if ((pLow[cDim] > pHigh[cDim]))
@@ -295,7 +295,7 @@ bool Region::touchesRegion(const Region& r) const
 		throw Tools::IllegalArgumentException(
 			"Region::touchesRegion: Regions have different number of dimensions."
 		);
-	
+
 	for (uint32_t i = 0; i < m_dimension; ++i)
 	{
 		if (
@@ -361,11 +361,11 @@ bool Region::intersectsLineSegment(const LineSegment& in) const
     // Points/LineSegment for the segment
     Point p1 = Point(in.m_pStartPoint, 2);
     Point p2 = Point(in.m_pEndPoint, 2);
-    
+
 
     //Check whether either or both the endpoints are within the region OR
     //whether any of the bounding segments of the Region intersect the segment
-    return (containsPoint(p1) || containsPoint(p2) || 
+    return (containsPoint(p1) || containsPoint(p2) ||
             in.intersectsShape(LineSegment(ll, ul)) || in.intersectsShape(LineSegment(ul, ur)) ||
             in.intersectsShape(LineSegment(ur, lr)) || in.intersectsShape(LineSegment(lr, ll)));
 


=====================================
src/tprtree/Index.cc
=====================================
@@ -5,7 +5,7 @@
  * Copyright (c) 2002, Marios Hadjieleftheriou
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -321,7 +321,7 @@ void Index::adjustTree(Node* n, std::stack<id_type>& pathBuffer)
 		}
 	//}
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 	for (uint32_t cChild = 0; cChild < m_children; ++cChild)
 	{
 		assert(m_nodeMBR.containsRegionAfterTime(m_pTree->m_currentTime, *(m_ptrMBR[cChild])) == true);
@@ -382,7 +382,7 @@ void Index::adjustTree(Node* n1, Node* n2, std::stack<id_type>& pathBuffer, uint
 		}
 	//}
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 	for (uint32_t cChild = 0; cChild < m_children; ++cChild)
 	{
 		assert(m_nodeMBR.containsRegionAfterTime(m_pTree->m_currentTime, *(m_ptrMBR[cChild])) == true);


=====================================
src/tprtree/Node.cc
=====================================
@@ -5,7 +5,7 @@
  * Copyright (c) 2002, Marios Hadjieleftheriou
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -376,7 +376,7 @@ bool Node::insertEntry(uint32_t dataLength, uint8_t* pData, MovingRegion& mbr, i
 		}
 	}
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 	for (uint32_t cChild = 0; cChild < m_children; ++cChild)
 	{
 		assert(m_nodeMBR.containsRegionAfterTime(m_nodeMBR.m_startTime, *(m_ptrMBR[cChild])));
@@ -434,7 +434,7 @@ void Node::deleteEntry(uint32_t index)
 			m_nodeMBR.m_pHigh[cDim] += 2.0 * std::numeric_limits<double>::epsilon();
 		}
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 		for (uint32_t cChild = 0; cChild < m_children; ++cChild)
 		{
 			assert(m_nodeMBR.containsRegionAfterTime(m_pTree->m_currentTime, *(m_ptrMBR[cChild])) == true);
@@ -460,9 +460,9 @@ bool Node::insertData(uint32_t dataLength, uint8_t* pData, MovingRegion& mbr, id
 
 		return bNeedToAdjust;
 	}
-	else if (false && 
-		     m_pTree->m_treeVariant == TPRV_RSTAR && 
-			 !pathBuffer.empty() && 
+	else if (false &&
+		     m_pTree->m_treeVariant == TPRV_RSTAR &&
+			 !pathBuffer.empty() &&
 			 overflowTable[m_level] == 0)
 	{
 		overflowTable[m_level] = 1;
@@ -559,7 +559,7 @@ bool Node::insertData(uint32_t dataLength, uint8_t* pData, MovingRegion& mbr, id
 			m_nodeMBR.m_pHigh[cDim] += 2.0 * std::numeric_limits<double>::epsilon();
 		}
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 		for (uint32_t cChild = 0; cChild < m_children; ++cChild)
 		{
 			assert(m_nodeMBR.containsRegionAfterTime(m_nodeMBR.m_startTime, *(m_ptrMBR[cChild])));
@@ -604,7 +604,7 @@ bool Node::insertData(uint32_t dataLength, uint8_t* pData, MovingRegion& mbr, id
 			n->m_identifier = -1;
 			nn->m_identifier = -1;
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 			for (uint32_t cChild = 0; cChild < n->m_children; ++cChild)
 			{
 				assert(n->m_nodeMBR.containsRegionAfterTime(n->m_nodeMBR.m_startTime, *(n->m_ptrMBR[cChild])) == true);
@@ -647,7 +647,7 @@ bool Node::insertData(uint32_t dataLength, uint8_t* pData, MovingRegion& mbr, id
 			n->m_identifier = m_identifier;
 			nn->m_identifier = -1;
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 			for (uint32_t cChild = 0; cChild < n->m_children; ++cChild)
 			{
 				assert(n->m_nodeMBR.containsRegionAfterTime(n->m_nodeMBR.m_startTime, *(n->m_ptrMBR[cChild])) == true);


=====================================
src/tprtree/PointerPoolNode.h
=====================================
@@ -5,7 +5,7 @@
  * Copyright (c) 2002, Marios Hadjieleftheriou
  *
  * All rights reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -37,7 +37,7 @@ namespace Tools
 	public:
 		explicit PointerPool(uint32_t capacity) : m_capacity(capacity)
 		{
-			#ifndef NDEBUG
+			#ifdef SIDX_DEBUG
 			m_hits = 0;
 			m_misses = 0;
 			m_pointerCount = 0;
@@ -51,13 +51,13 @@ namespace Tools
 			while (! m_pool.empty())
 			{
 				TPRTree::Node* x = m_pool.top(); m_pool.pop();
-				#ifndef NDEBUG
+				#ifdef SIDX_DEBUG
 				--m_pointerCount;
 				#endif
 				delete x;
 			}
 
-			#ifndef NDEBUG
+			#ifdef SIDX_DEBUG
 			std::cerr << "Lost pointers: " << m_pointerCount << std::endl;
 			#endif
 		}
@@ -67,13 +67,13 @@ namespace Tools
 			if (! m_pool.empty())
 			{
 				TPRTree::Node* p = m_pool.top(); m_pool.pop();
-				#ifndef NDEBUG
+				#ifdef SIDX_DEBUG
 				++m_hits;
 				#endif
 
 				return PoolPointer<TPRTree::Node>(p, this);
 			}
-			#ifndef NDEBUG
+			#ifdef SIDX_DEBUG
 			else
 			{
 				// fixme: well sort of...
@@ -108,7 +108,7 @@ namespace Tools
 				}
 				else
 				{
-					#ifndef NDEBUG
+					#ifdef SIDX_DEBUG
 					--m_pointerCount;
 					#endif
 					delete p;
@@ -129,7 +129,7 @@ namespace Tools
 		uint32_t m_capacity;
 		std::stack<TPRTree::Node*> m_pool;
 
-	#ifndef NDEBUG
+	#ifdef SIDX_DEBUG
 	public:
 		uint64_t m_hits;
 		uint64_t m_misses;


=====================================
src/tprtree/TPRTree.cc
=====================================
@@ -1098,7 +1098,7 @@ SpatialIndex::id_type SpatialIndex::TPRTree::TPRTree::writeNode(Node* n)
 		n->m_identifier = page;
 		++(m_stats.m_nodes);
 
-#ifndef NDEBUG
+#ifdef SIDX_DEBUG
 		try
 		{
 			m_stats.m_nodesInLevel[n->m_level] = m_stats.m_nodesInLevel.at(n->m_level) + 1;
@@ -1264,7 +1264,7 @@ std::ostream& SpatialIndex::TPRTree::operator<<(std::ostream& os, const TPRTree&
 		os	<< "Utilization: " << 100 * t.m_stats.getNumberOfData() / (t.m_stats.getNumberOfNodesInLevel(0) * t.m_leafCapacity) << "%" << std::endl
 			<< t.m_stats;
 
-	#ifndef NDEBUG
+	#ifdef SIDX_DEBUG
 	os	<< "Leaf pool hits: " << t.m_leafPool.m_hits << std::endl
 		<< "Leaf pool misses: " << t.m_leafPool.m_misses << std::endl
 		<< "Index pool hits: " << t.m_indexPool.m_hits << std::endl



View it on GitLab: https://salsa.debian.org/debian-gis-team/spatialindex/-/commit/0a9a8d3a5b4d6e3dc299cf259e5073f9682afc1c

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/debian-gis-team/spatialindex/-/commit/0a9a8d3a5b4d6e3dc299cf259e5073f9682afc1c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240528/1c0176fd/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list