* msOGRLayerGetItems() * * Load item (i.e. field) names in a char array. If we are working * with a tiled layer, ensure a tile is loaded and use it for the items. * It is implicitly assumed that the schemas will match on all tiles. **********************************************************************/
| 2419 | * It is implicitly assumed that the schemas will match on all tiles. |
| 2420 | **********************************************************************/ |
| 2421 | int msOGRLayerGetItems(layerObj *layer) |
| 2422 | { |
| 2423 | #ifdef USE_OGR |
| 2424 | msOGRFileInfo *psInfo =(msOGRFileInfo*)layer->layerinfo; |
| 2425 | |
| 2426 | if (psInfo == NULL || psInfo->hLayer == NULL) |
| 2427 | { |
| 2428 | msSetError(MS_MISCERR, "Assertion failed: OGR layer not opened!!!", |
| 2429 | "msOGRLayerGetItems()"); |
| 2430 | return(MS_FAILURE); |
| 2431 | } |
| 2432 | |
| 2433 | if( layer->tileindex != NULL ) |
| 2434 | { |
| 2435 | if( psInfo->poCurTile == NULL |
| 2436 | && msOGRFileReadTile( layer, psInfo ) != MS_SUCCESS ) |
| 2437 | return MS_FAILURE; |
| 2438 | |
| 2439 | psInfo = psInfo->poCurTile; |
| 2440 | } |
| 2441 | |
| 2442 | layer->numitems = 0; |
| 2443 | layer->items = msOGRFileGetItems(layer, psInfo); |
| 2444 | if( layer->items == NULL ) |
| 2445 | return MS_FAILURE; |
| 2446 | |
| 2447 | while( layer->items[layer->numitems] != NULL ) |
| 2448 | layer->numitems++; |
| 2449 | |
| 2450 | return msOGRLayerInitItemInfo(layer); |
| 2451 | |
| 2452 | #else |
| 2453 | /* ------------------------------------------------------------------ |
| 2454 | * OGR Support not included... |
| 2455 | * ------------------------------------------------------------------ */ |
| 2456 | |
| 2457 | msSetError(MS_MISCERR, "OGR support is not available.", |
| 2458 | "msOGRLayerGetItems()"); |
| 2459 | return(MS_FAILURE); |
| 2460 | |
| 2461 | #endif /* USE_OGR */ |
| 2462 | } |
| 2463 | |
| 2464 | /********************************************************************** |
| 2465 | * msOGRLayerInitItemInfo() |
no test coverage detected