Schema - "complex" criteria

Wise forum folks,

One more question for you.  XFM Schema appears to have difficulty with interpreting "complex" criteria (e.g., criteria that reference more than one attribute), such as:

     ([attribute1]>0) && ([attribute2]<100)

Or even better:

     COMPARE("[attributea]","True","") && ([attributeb]>0)

I couldn't find guidance in the Help files addressing situations like this.  Has anyone else tried something similar?

Thanks.

Janice

  • Hi. This should work. You can refer to an example in the geo_example schema that is delivered with Bentley Map. Look at the road_name criteria.

       Martin

      

  • Martin - thanks, I'll take a look at the example schema.  Might come back with some more questions after that.

    Janice

  • Ok, I took a look at the road_name criteria.  It looks almost identical to the first example I gave, inasmuch as it concatenates two conditions, each evaluating a different attribute, that share the same basic logic (i.e., both are COMPARE criteria):

        COMPARE("[Road:Name]", "MAIN","") && COMPARE ("[Road:Type]","2-Lane","")

    So Example #1 works - check.  But what about Example #2 that I gave above?  The main difference here is that both conditions have different sort of logic.  The reason I ask is because the last time I tried to implement this scenario, it didn't work.

    Thanks.

    Janice

  • Also, for what it's worth, what's the difference between the following criteria expressions?  Both evaluate a feature's property value as a string against the string value "compareValue".  I get that the second uses the C string compare function "strcmp", but what's really the difference here?  Just curious.

        COMPARE("[feature_instance_alias:property_name]", "compareValue", "")

        0==strcmp("[feature_instance_alias:property_name]","compareValue")

  • COMPARE function allows passing a delimeter string in the last parameter to compare a value against a delimited list of possible values.

    For example...

    From "Performance Notes" paragraph in the XFM Overview section of the Bentley Map Customization Guide (search for  "Performance Notes"):

    If you need to compare a single property to numerous values then use the COMPARE function with a delimited list of values instead of separate COMPARE functions.

    Instead of: COMPARE("[SIZE]","220","") || COMPARE("[SIZE]","240","") || COMPARE("[SIZE]","640","")

    Consider using: COMPARE("[SIZE]","220|240|640","|")

    Regards,

    Chris


    This is a test