MCPcopy Index your code
hub / github.com/MapServer/MapServer / msSHPLayerOpen

Function msSHPLayerOpen

mapshape.c:2502–2528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2500}
2501
2502int msSHPLayerOpen(layerObj *layer)
2503{
2504 char szPath[MS_MAXPATHLEN];
2505 shapefileObj *shpfile;
2506
2507 if(layer->layerinfo) return MS_SUCCESS; /* layer already open */
2508
2509 /* allocate space for a shapefileObj using layer->layerinfo */
2510 shpfile = (shapefileObj *) malloc(sizeof(shapefileObj));
2511 MS_CHECK_ALLOC(shpfile, sizeof(shapefileObj), MS_FAILURE);
2512
2513 if ( msCheckParentPointer(layer->map,"map")==MS_FAILURE )
2514 return MS_FAILURE;
2515
2516
2517 layer->layerinfo = shpfile;
2518
2519 if(msShapefileOpen(shpfile, "rb", msBuildPath3(szPath, layer->map->mappath, layer->map->shapepath, layer->data), MS_TRUE) == -1) {
2520 if(msShapefileOpen(shpfile, "rb", msBuildPath(szPath, layer->map->mappath, layer->data), MS_TRUE) == -1) {
2521 layer->layerinfo = NULL;
2522 free(shpfile);
2523 return MS_FAILURE;
2524 }
2525 }
2526
2527 return MS_SUCCESS;
2528}
2529
2530int msSHPLayerIsOpen(layerObj *layer)
2531{

Callers

nothing calls this directly

Calls 4

msCheckParentPointerFunction · 0.85
msShapefileOpenFunction · 0.85
msBuildPath3Function · 0.85
msBuildPathFunction · 0.85

Tested by

no test coverage detected