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

Function InitShapeAttributes

mapcluster.c:500–535  ·  view source on GitHub ↗

setting the aggregated attributes */

Source from the content-addressed store, hash-verified

498
499/* setting the aggregated attributes */
500static void InitShapeAttributes(layerObj* layer, clusterInfo* base)
501{
502 int i;
503 int* itemindexes = layer->iteminfo;
504
505 for (i = 0; i < layer->numitems; i++)
506 {
507 if (base->shape.numvalues <= i)
508 break;
509
510 if (itemindexes[i] == MSCLUSTER_FEATURECOUNTINDEX)
511 {
512 if (base->shape.values[i])
513 msFree(base->shape.values[i]);
514
515 base->shape.values[i] = msIntToString(base->numsiblings + 1);
516 }
517 else if (itemindexes[i] == MSCLUSTER_GROUPINDEX)
518 {
519 if (base->shape.values[i])
520 msFree(base->shape.values[i]);
521
522 if (base->group)
523 base->shape.values[i] = msStrdup(base->group);
524 else
525 base->shape.values[i] = msStrdup("");
526 }
527 else if (EQUALN(layer->items[i], "Count:", 6))
528 {
529 if (base->shape.values[i])
530 msFree(base->shape.values[i]);
531
532 base->shape.values[i] = msStrdup("1"); // initial count
533 }
534 }
535}
536
537/* update the shape attributes (aggregate) */
538static void UpdateShapeAttributes(layerObj* layer, clusterInfo* base, clusterInfo* current)

Callers 2

findBestClusterFunction · 0.85
RebuildClustersFunction · 0.85

Calls 3

msFreeFunction · 0.85
msIntToStringFunction · 0.85
msStrdupFunction · 0.85

Tested by

no test coverage detected