/ void msSLDParseLineSymbolizer(CPLXMLNode *psRoot, layerObj */ psLayer) */ / Parses the LineSymbolizer rule and creates a class in the */ layer. */ / */
| 1115 | /* ... */ |
| 1116 | /************************************************************************/ |
| 1117 | int msSLDParseLineSymbolizer(CPLXMLNode *psRoot, layerObj *psLayer, |
| 1118 | int bNewClass) |
| 1119 | { |
| 1120 | int nClassId = 0; |
| 1121 | CPLXMLNode *psStroke=NULL, *psOffset=NULL; |
| 1122 | int iStyle = 0; |
| 1123 | |
| 1124 | if (!psRoot || !psLayer) |
| 1125 | return MS_FAILURE; |
| 1126 | |
| 1127 | psStroke = CPLGetXMLNode(psRoot, "Stroke"); |
| 1128 | if (psStroke) |
| 1129 | { |
| 1130 | if (bNewClass || psLayer->numclasses <= 0) |
| 1131 | { |
| 1132 | if (msGrowLayerClasses(psLayer) == NULL) |
| 1133 | return MS_FAILURE; |
| 1134 | initClass(psLayer->class[psLayer->numclasses]); |
| 1135 | nClassId = psLayer->numclasses; |
| 1136 | psLayer->numclasses++; |
| 1137 | } |
| 1138 | else |
| 1139 | nClassId = psLayer->numclasses-1; |
| 1140 | |
| 1141 | iStyle = psLayer->class[nClassId]->numstyles; |
| 1142 | msMaybeAllocateClassStyle(psLayer->class[nClassId], iStyle); |
| 1143 | |
| 1144 | msSLDParseStroke(psStroke, psLayer->class[nClassId]->styles[iStyle], |
| 1145 | psLayer->map, 0); |
| 1146 | |
| 1147 | /*parse PerpendicularOffset SLD 1.1.10*/ |
| 1148 | psOffset = CPLGetXMLNode(psRoot, "PerpendicularOffset"); |
| 1149 | if (psOffset && psOffset->psChild && psOffset->psChild->pszValue) |
| 1150 | { |
| 1151 | psLayer->class[nClassId]->styles[iStyle]->offsetx = atoi(psOffset->psChild->pszValue); |
| 1152 | psLayer->class[nClassId]->styles[iStyle]->offsety = psLayer->class[nClassId]->styles[iStyle]->offsetx; |
| 1153 | } |
| 1154 | } |
| 1155 | |
| 1156 | return MS_SUCCESS; |
| 1157 | } |
| 1158 | |
| 1159 | |
| 1160 |
no test coverage detected