* take the value from the shape and use it to change the * color in the style to match the range map */
| 2790 | * color in the style to match the range map |
| 2791 | */ |
| 2792 | int 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 |
no test coverage detected