| 334 | } |
| 335 | |
| 336 | int msUnionLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery) |
| 337 | { |
| 338 | int i; |
| 339 | layerObj* srclayer; |
| 340 | rectObj srcRect; |
| 341 | msUnionLayerInfo* layerinfo = (msUnionLayerInfo*)layer->layerinfo; |
| 342 | |
| 343 | if (!layerinfo || !layer->map) |
| 344 | return MS_FAILURE; |
| 345 | |
| 346 | for (i = 0; i < layerinfo->layerCount; i++) |
| 347 | { |
| 348 | layerObj* srclayer = &layerinfo->layers[i]; |
| 349 | |
| 350 | if (layer->styleitem && layer->numitems == 0) |
| 351 | { |
| 352 | /* need to initialize items */ |
| 353 | msUnionLayerFreeExpressionTokens(srclayer); |
| 354 | |
| 355 | /* get only the required items */ |
| 356 | if (msLayerWhichItems(srclayer, MS_FALSE, NULL) != MS_SUCCESS) |
| 357 | return MS_FAILURE; |
| 358 | } |
| 359 | |
| 360 | srcRect = rect; |
| 361 | #ifdef USE_PROJ |
| 362 | if(srclayer->transform == MS_TRUE && srclayer->project && layer->transform == MS_TRUE && layer->project &&msProjectionsDiffer(&(srclayer->projection), &(layer->projection))) |
| 363 | msProjectRect(&layer->projection, &srclayer->projection, &srcRect); /* project the searchrect to source coords */ |
| 364 | #endif |
| 365 | layerinfo->status[i] = msLayerWhichShapes(srclayer, srcRect, isQuery); |
| 366 | if (layerinfo->status[i] == MS_FAILURE) |
| 367 | return MS_FAILURE; |
| 368 | } |
| 369 | |
| 370 | layerinfo->layerIndex = 0; |
| 371 | srclayer = &layerinfo->layers[0]; |
| 372 | |
| 373 | msFree(layerinfo->classgroup); |
| 374 | |
| 375 | layerinfo->classgroup = NULL; |
| 376 | layerinfo->nclasses = 0; |
| 377 | |
| 378 | if (srclayer->classgroup && srclayer->numclasses > 0) |
| 379 | layerinfo->classgroup = msAllocateValidClassGroups(srclayer, &layerinfo->nclasses); |
| 380 | |
| 381 | return MS_SUCCESS; |
| 382 | } |
| 383 | |
| 384 | static int BuildFeatureAttributes(layerObj *layer, layerObj* srclayer, shapeObj *shape) |
| 385 | { |
nothing calls this directly
no test coverage detected