3 |
* |
* |
4 |
* Project: Shapelib |
* Project: Shapelib |
5 |
* Purpose: Implementation of quadtree building and searching functions. |
* Purpose: Implementation of quadtree building and searching functions. |
6 |
* Author: Frank Warmerdam, [email protected] |
* Author: Frank Warmerdam, [email protected] |
7 |
* |
* |
8 |
****************************************************************************** |
****************************************************************************** |
9 |
* Copyright (c) 1999, Frank Warmerdam |
* Copyright (c) 1999, Frank Warmerdam |
34 |
****************************************************************************** |
****************************************************************************** |
35 |
* |
* |
36 |
* $Log$ |
* $Log$ |
37 |
* Revision 1.1 2003/08/19 21:29:25 jan |
* Revision 1.2 2003/10/02 15:15:16 bh |
38 |
* These files have been moved here from thuban/extensions/shapelib/ |
* Update to shapelib 1.2.10 |
39 |
* See there in the Attic for the older history. |
* |
40 |
* |
* Revision 1.9 2003/01/28 15:53:41 warmerda |
41 |
* Revision 1.2 2002/05/08 13:48:43 bh |
* Avoid build warnings. |
42 |
* * extensions/shapelib/shptree.c (compare_ints): Make arguments |
* |
43 |
* const void * as in the qsort prototype |
* Revision 1.8 2002/05/07 13:07:45 warmerda |
44 |
* (SHPTreeFindLikelyShapes): Remove some unused variables. |
* use qsort() - patch from Bernhard Herzog |
45 |
* |
* |
46 |
* Revision 1.1 2002/05/07 14:09:34 bh |
* Revision 1.7 2002/01/15 14:36:07 warmerda |
47 |
* * extensions/shapelib/shptree.c: Modified version of shptree.c of |
* updated email address |
|
* shapelib 1.2.9. The only real difference is the use of qsort |
|
|
* instead of a bubble sort implementation |
|
48 |
* |
* |
49 |
* Revision 1.6 2001/05/23 13:36:52 warmerda |
* Revision 1.6 2001/05/23 13:36:52 warmerda |
50 |
* added use of SHPAPI_CALL |
* added use of SHPAPI_CALL |
73 |
|
|
74 |
#include <math.h> |
#include <math.h> |
75 |
#include <assert.h> |
#include <assert.h> |
|
|
|
76 |
#include <stdlib.h> |
#include <stdlib.h> |
77 |
|
#include <string.h> |
78 |
|
|
79 |
#ifndef TRUE |
#ifndef TRUE |
80 |
# define TRUE 1 |
# define TRUE 1 |
598 |
|
|
599 |
/* helper for qsort */ |
/* helper for qsort */ |
600 |
static int |
static int |
601 |
compare_ints(const void * a, const void * b) |
compare_ints( const void * a, const void * b) |
602 |
{ |
{ |
603 |
return (*(int*)a) - (*(int*)b); |
return (*(int*)a) - (*(int*)b); |
604 |
} |
} |