[mapserver-dev] numeric values in string columns

bartvde at osgis.nl bartvde at osgis.nl
Mon Nov 10 04:57:09 EST 2008


Hi list,

we've got a dataset with road numbers, the column in ArcSDE is a character
type. But the values can look like numbers (002 etc.) as well as strings
(e.g. N329).

Mapserver will fail in this case, seeing it will check the value for
determining the type of column (mapogcfilter.c).

Will this be easy to fix, or will it require that Mapserver stores column
types internally?

/* -------------------------------------------------------------------- */
/*      check if the value is a numeric value or alphanumeric. If it    */
/*      is alphanumeric, add quotes around attribute and values.        */
/* -------------------------------------------------------------------- */
    bString = 0;
    if (psFilterNode->psRightNode->pszValue)
    {
        nLenght = strlen(psFilterNode->psRightNode->pszValue);
        for (i=0; i<nLenght; i++)
        {
            if (!isdigit(psFilterNode->psRightNode->pszValue[i]) &&
                psFilterNode->psRightNode->pszValue[i] != '.')
            {
                /* if (psFilterNode->psRightNode->pszValue[i] < '0' || */
                /* psFilterNode->psRightNode->pszValue[i] > '9') */
                bString = 1;
                break;
            }
        }
    }

Best regards,
Bart



More information about the mapserver-dev mailing list