| 2649 | } |
| 2650 | |
| 2651 | int msSHPLayerGetItems(layerObj *layer) |
| 2652 | { |
| 2653 | shapefileObj *shpfile; |
| 2654 | const char *value; |
| 2655 | |
| 2656 | shpfile = layer->layerinfo; |
| 2657 | |
| 2658 | if(!shpfile) { |
| 2659 | msSetError(MS_SHPERR, "Shapefile layer has not been opened.", "msSHPLayerGetItems()"); |
| 2660 | return MS_FAILURE; |
| 2661 | } |
| 2662 | |
| 2663 | layer->numitems = msDBFGetFieldCount(shpfile->hDBF); |
| 2664 | layer->items = msDBFGetItems(shpfile->hDBF); |
| 2665 | if(layer->numitems == 0) return MS_SUCCESS; /* No items is a valid case (#3147) */ |
| 2666 | if(!layer->items) return MS_FAILURE; |
| 2667 | |
| 2668 | /* -------------------------------------------------------------------- */ |
| 2669 | /* consider populating the field definitions in metadata. */ |
| 2670 | /* -------------------------------------------------------------------- */ |
| 2671 | if((value = msOWSLookupMetadata(&(layer->metadata), "G", "types")) != NULL |
| 2672 | && strcasecmp(value,"auto") == 0 ) |
| 2673 | msSHPPassThroughFieldDefinitions( layer, shpfile->hDBF ); |
| 2674 | |
| 2675 | return msLayerInitItemInfo(layer); |
| 2676 | } |
| 2677 | |
| 2678 | int msSHPLayerGetExtent(layerObj *layer, rectObj *extent) |
| 2679 | { |
nothing calls this directly
no test coverage detected