0

I am trying to define within my map definition document test1.map a layer that comes from a ESRI file geodatabase (from ArcMap 10.2), and display different styles/fill colors for each item based upon a field within the layer, in this case ws_condition. I have defined it like this:

LAYER
    NAME "analysis_sp__test1__a1__demo2__ws_condition"
    TYPE POLYGON
    STATUS ON
    PROJECTION 
        "init=epsg:32049"
    END 
    METADATA 
        "wms_title" "ws_conditionLayer"
        "wfs_title" "ws_conditionLayer"
        "wfs_srs"    "EPSG:32049"
        "gml_include_items" "all"
        "gml_featureid"  "objectid"
        "wfs_enable_request" "*"
    END
    CONNECTIONTYPE OGR
    CONNECTION "C:\OSGeo4W\apps\demo1\data\demo1.gdb"
    DATA "demo2__a1__test1__merged"             
    CLASS
        EXPRESSION('[ws_condition]' < -.6)
        STYLE
            COLOR 255 0 0 
            OUTLINECOLOR 0 0 0
        END         

    END
    CLASS
        EXPRESSION('[ws_condition]' > -.6 AND '[ws_condition]' < -.2)
        STYLE
            COLOR 240 128 128
            OUTLINECOLOR 0 0 0
        END         

    END
    CLASS
        EXPRESSION('[ws_condition]' > -.2 AND '[ws_condition]' < .2)
        STYLE
            COLOR 229 204 255
            OUTLINECOLOR 0 0 0
        END         

    END
    CLASS
        EXPRESSION('[ws_condition]' > .2 AND '[ws_condition]' < .6) 
        STYLE
            COLOR 142 229 238
            OUTLINECOLOR 0 0 0
        END         

    END
    CLASS
        EXPRESSION('[ws_condition]' > .6)
        STYLE
            COLOR 0 0 139
            OUTLINECOLOR 0 0 0
        END         

    END

END

Now I receive nothing on the map, and worse, when I try to open it inside of the MapServer Manager, I receive an error saying there is a parsing error. Is there any way to make this work within the map definition file, or possibly how to create a simple WFS server layer in OpenLayers (keeping it simple, the WFS server will be on the same server and domain as the OpenLayers server). I have tried many different things, including trying to use CLASSITEM and specifying the field name, but it seems to only be doing a string comparison and not a numeric comparison.

  • Are you running on Windows 32bit or 64bit – nmtoken Sep 22 '16 at 19:09
1

It's doing a string comparison because you are saying in your expression you have a string when using the quote.

For a numeric comparison you need expressions like:

EXPRESSION([ws_condition] > .6)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.