Uploaded image for project: 'GeoTools'
  1. GeoTools
  2. GEOT-5541

Create a function to return number of complex attributes

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 17-beta
    • Component/s: None
    • Labels:
      None

      Description

      We have a specific use case to color code WMS based on number of specific attribute in complex features.
      e.g. if there is 1 xyz attribute -> color red, if there are 2 xyz attributes -> color blue, etc.

      For this I picked up existing LengthFunction in gt-main. I am not really sure the difference between this and strLength function (except strLength is a FilterFunction).

      Anyway, I made it return number of attributes for complex attributes. If the text length is what users are after, they should be using strLength.

      Usage in test example:

      							<sld:CssParameter name="fill">
      								<ogc:Function name="Recode">
      									<!-- Value to transform -->
      									<ogc:Function name="length">
      										<ogc:PropertyName>gsml:specification/gsml:GeologicUnit/gsml:occurrence</ogc:PropertyName>
      									</ogc:Function>
      									<ogc:Literal>1</ogc:Literal>
      									<!-- yellow -->
      									<ogc:Literal>#ffff00</ogc:Literal>
      									<ogc:Literal>2</ogc:Literal>
      									<!-- blue -->
      									<ogc:Literal>#0000ff</ogc:Literal>
      									<ogc:Literal>3</ogc:Literal>
      									<!-- red -->
      									<ogc:Literal>#ff0000</ogc:Literal>
      								</ogc:Function>
      							</sld:CssParameter>
      

        Attachments

          Activity

            People

            • Assignee:
              riniangreani Rini Angreani
              Reporter:
              riniangreani Rini Angreani
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: