| 74 | |
| 75 | |
| 76 | int main( int argc, char ** argv ) |
| 77 | |
| 78 | { |
| 79 | SHPTreeHandle qix; |
| 80 | |
| 81 | int i, j; |
| 82 | rectObj rect; |
| 83 | |
| 84 | int pos; |
| 85 | ms_bitarray bitmap = NULL; |
| 86 | |
| 87 | char mBigEndian; |
| 88 | treeNodeObj *node = NULL; |
| 89 | |
| 90 | |
| 91 | /* -------------------------------------------------------------------- */ |
| 92 | /* Display a usage message. */ |
| 93 | /* -------------------------------------------------------------------- */ |
| 94 | if( argc <= 1 ) |
| 95 | { |
| 96 | printf( "shptreetst shapefile {minx miny maxx maxy}\n" ); |
| 97 | exit( 1 ); |
| 98 | } |
| 99 | |
| 100 | i = 1; |
| 101 | if( *((unsigned char *) &i) == 1 ) |
| 102 | mBigEndian = 0; |
| 103 | else |
| 104 | mBigEndian = 1; |
| 105 | |
| 106 | |
| 107 | qix = msSHPDiskTreeOpen (AddFileSuffix(argv[1],".qix"), 0 /* no debug*/); |
| 108 | if( qix == NULL ) |
| 109 | { |
| 110 | printf("unable to open index file %s \n", argv[1]); |
| 111 | exit(-1); |
| 112 | } |
| 113 | |
| 114 | printf ("This %s %s index supports a shapefile with %d shapes, %d depth \n", |
| 115 | (qix->version ? "new": "old"), (qix->LSB_order? "LSB": "MSB"), (int) qix->nShapes, (int) qix->nDepth); |
| 116 | |
| 117 | /* -------------------------------------------------------------------- */ |
| 118 | /* Skim over the list of shapes, printing all the vertices. */ |
| 119 | /* -------------------------------------------------------------------- */ |
| 120 | |
| 121 | pos = ftell (qix->fp); |
| 122 | j = 0; |
| 123 | |
| 124 | while( pos && j < 20) |
| 125 | { |
| 126 | j ++; |
| 127 | /* fprintf (stderr,"box %d, at %d pos \n", j, (int) ftell(qix)); |
| 128 | */ |
| 129 | |
| 130 | node = readTreeNode (qix); |
| 131 | if (node ) |
| 132 | { |
| 133 | fprintf (stdout,"shapes %d, node %d, %f,%f,%f,%f \n",(int) node->numshapes,node->numsubnodes,node->rect.minx, node->rect.miny, node->rect.maxx, node->rect.maxy); |
nothing calls this directly
no test coverage detected