- Timestamp:
- Dec 12, 2018, 11:09:18 AM (8 years ago)
- Location:
- trunk/Ohana/src/libdvo
- Files:
-
- 3 edited
-
include/dvo.h (modified) (1 diff)
-
src/BoundaryTree.c (modified) (5 diffs)
-
src/TessellationTable.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/include/dvo.h
r40463 r40583 442 442 int **cell; // zone,band -> proj cell sequence 443 443 int **projID; // zone,band -> proj cell ID 444 int **skycellID; // zone,band -> starting skycell ID 444 445 char ***name; // projection cell name 445 446 -
trunk/Ohana/src/libdvo/src/BoundaryTree.c
r39480 r40583 27 27 FREE (tree->cell[i]); 28 28 FREE (tree->projID[i]); 29 FREE (tree->skycellID[i]); 29 30 FREE (tree->name[i]); 30 31 } … … 38 39 FREE (tree->cell); 39 40 FREE (tree->projID); 41 FREE (tree->skycellID); 40 42 FREE (tree->name); 41 43 … … 155 157 ALLOCATE (tree->cell, int *, tree->Nzone); 156 158 ALLOCATE (tree->projID, int *, tree->Nzone); 159 ALLOCATE (tree->skycellID, int *, tree->Nzone); 157 160 ALLOCATE (tree->name, char **, tree->Nzone); 158 161 for (i = 0; i < tree->Nzone; i++) { … … 165 168 ALLOCATE (tree->cell[i], int, tree->Nband[i]); 166 169 ALLOCATE (tree->projID[i], int, tree->Nband[i]); 170 ALLOCATE (tree->skycellID[i], int, tree->Nband[i]); 167 171 ALLOCATE (tree->name[i], char *, tree->Nband[i]); 168 172 for (j = 0; j < tree->Nband[i]; j++) { … … 208 212 memcpy(tree->name[nz][nb], &name[i*BOUNDARY_TREE_NAME_LENGTH], BOUNDARY_TREE_NAME_LENGTH); 209 213 // XXX parse out the ID from the name (skycell.NNNN) 210 tree->projID[nz][nb] = atoi(&tree->name[nz][nb][8]); 214 char *endptr = NULL; 215 tree->projID[nz][nb] = strtol(&tree->name[nz][nb][8], &endptr, 10); 216 if (endptr[0] == '.') { 217 // we have elements after the projID, which should be the skycell ID 218 endptr ++; 219 tree->skycellID[nz][nb] = strtol(endptr, NULL, 10); 220 } else { 221 tree->skycellID[nz][nb] = -1; 222 } 211 223 } 212 224 -
trunk/Ohana/src/libdvo/src/TessellationTable.c
r39480 r40583 579 579 *tessID = myTess; 580 580 *projID = tess[myTess].tree->projID[zone][band]; 581 *skycellID = N; 581 if (tess[myTess].tree->skycellID[zone][band] == -1) { 582 *skycellID = N; 583 } else { 584 *skycellID = tess[myTess].tree->skycellID[zone][band] + N; 585 } 582 586 583 587 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.
