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

Function msShapeToRange

mapdraw.c:2792–2808  ·  view source on GitHub ↗

* take the value from the shape and use it to change the * color in the style to match the range map */

Source from the content-addressed store, hash-verified

2790 * color in the style to match the range map
2791 */
2792int msShapeToRange(styleObj *style, shapeObj *shape)
2793{
2794 double fieldVal;
2795 char* fieldStr;
2796
2797 /*first, get the value of the rangeitem, which should*/
2798 /*evaluate to a double*/
2799 fieldStr = shape->values[style->rangeitemindex];
2800 if (fieldStr == NULL) /*if there's not value, bail*/
2801 {
2802 return MS_FAILURE;
2803 }
2804 fieldVal = 0.0;
2805 fieldVal = atof(fieldStr); /*faith that it's ok -- */
2806 /*should switch to strtod*/
2807 return msValueToRange(style, fieldVal);
2808}
2809
2810/**
2811 * Allow direct mapping of a value so that mapscript can use the

Callers 1

msDrawShapeFunction · 0.85

Calls 1

msValueToRangeFunction · 0.85

Tested by

no test coverage detected