| 219 | |
| 220 | |
| 221 | int FLTGML2Shape_XMLNode(CPLXMLNode *psNode, shapeObj *psShp) |
| 222 | { |
| 223 | lineObj line={0,NULL}; |
| 224 | CPLXMLNode *psCoordinates = NULL; |
| 225 | char *pszTmpCoord = NULL; |
| 226 | char **szCoords = NULL; |
| 227 | int nCoords = 0; |
| 228 | |
| 229 | |
| 230 | if (!psNode || !psShp) |
| 231 | return MS_FALSE; |
| 232 | |
| 233 | |
| 234 | if( strcasecmp(psNode->pszValue,"PointType") == 0 |
| 235 | || strcasecmp(psNode->pszValue,"Point") == 0) |
| 236 | { |
| 237 | psCoordinates = CPLGetXMLNode(psNode, "coordinates"); |
| 238 | |
| 239 | if (psCoordinates && psCoordinates->psChild && |
| 240 | psCoordinates->psChild->pszValue) |
| 241 | { |
| 242 | pszTmpCoord = psCoordinates->psChild->pszValue; |
| 243 | szCoords = msStringSplit(pszTmpCoord, ',', &nCoords); |
| 244 | if (szCoords && nCoords >= 2) |
| 245 | { |
| 246 | line.numpoints = 1; |
| 247 | line.point = (pointObj *)malloc(sizeof(pointObj)); |
| 248 | line.point[0].x = atof(szCoords[0]); |
| 249 | line.point[0].y = atof(szCoords[1]); |
| 250 | #ifdef USE_POINT_Z_M |
| 251 | line.point[0].m = 0; |
| 252 | #endif |
| 253 | |
| 254 | psShp->type = MS_SHAPE_POINT; |
| 255 | |
| 256 | msAddLine(psShp, &line); |
| 257 | free(line.point); |
| 258 | |
| 259 | return MS_TRUE; |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | return MS_FALSE; |
| 265 | } |
| 266 | |
| 267 | |
| 268 |
nothing calls this directly
no test coverage detected