GeoTools
  1. GeoTools
  2. GEOT-3137

SLD : ExternalGraphic doesn't support complete dynamic URL from feature attribute

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5.8, 2.6-M0, 2.6-M1, 2.6-M2, 2.6-M3, 2.6-RC1, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.7-M0
    • Fix Version/s: 2.7.6
    • Component/s: render
    • Labels:
      None
    • Testcase included:
      yes

      Description

      Dynamic ExternalGraphic href supports expressions as part of an URL like
      http://myservice/$

      {icon}

      where icon is a attribute of a FeatureType (Attribute value would be myimage.png).

      But if there is a complete URL stored as an attribute value a MalformedURLException will be thrown for a SLD looking like that:
      <ExternalGraphic>
      <OnlineResource xlink:type="simple" xlink:href="$

      {attributeImageURL}

      "/>
      <Format>image/png</Format>
      </ExternalGraphic>

        Issue Links

          Activity

          Hide
          Frank Gasdorf added a comment -
          Dynamic ExternalGraphics to support Image Services
          Show
          Frank Gasdorf added a comment - Dynamic ExternalGraphics to support Image Services
          Hide
          Andrea Aime added a comment -
          Thanks for the patch. I won't have time to review and apply until the next week, if I forget please ping me back
          Show
          Andrea Aime added a comment - Thanks for the patch. I won't have time to review and apply until the next week, if I forget please ping me back
          Hide
          Frank Gasdorf added a comment - - edited
          Patch to fix the two test failures in SLDStyleFactoryTest. Maybe it's not the best way to change the ExternalGraphic interface but it's a initial try to get this fixed.
          Show
          Frank Gasdorf added a comment - - edited Patch to fix the two test failures in SLDStyleFactoryTest. Maybe it's not the best way to change the ExternalGraphic interface but it's a initial try to get this fixed.
          Hide
          Andrea Aime added a comment -
          Changing the interface is definitely bad, it would require a PMC vote to get the patch in with a full explanation and subsequent discussion. Can you explain why you had to do that?
          Show
          Andrea Aime added a comment - Changing the interface is definitely bad, it would require a PMC vote to get the patch in with a full explanation and subsequent discussion. Can you explain why you had to do that?
          Hide
          Frank Gasdorf added a comment -
          It's because of the single point of access to the Location via getLocation() where the internal URI is transformed to URL Object. If the internal uri (as a String Object) only contains a CQL Expression the conversion fails. Maybe an other way is to write a StyleVisitor (like org.geotools.styling.visitor.DuplicatingStyleVisitor) but I guess there is the same problem to get the internal String without getting a MalformedURLException.
          Show
          Frank Gasdorf added a comment - It's because of the single point of access to the Location via getLocation() where the internal URI is transformed to URL Object. If the internal uri (as a String Object) only contains a CQL Expression the conversion fails. Maybe an other way is to write a StyleVisitor (like org.geotools.styling.visitor.DuplicatingStyleVisitor) but I guess there is the same problem to get the internal String without getting a MalformedURLException.
          Hide
          Andrea Aime added a comment -
          I see, makes sense. However not even a core developer can go and make API changes without a discussion on the ml.
          So please, start a thread discussing the API change and why you need it.
          Show
          Andrea Aime added a comment - I see, makes sense. However not even a core developer can go and make API changes without a discussion on the ml. So please, start a thread discussing the API change and why you need it.
          Hide
          Frank Gasdorf added a comment - - edited
          Well probably its the best to split this issue into two, one for the ExternalGraphic URL as a bug, because CQL expression can already be used but not standalone. And the other would be an improvement to support dynamic attributes and in general expressions for the format tag (see GEOT-3139).
          Show
          Frank Gasdorf added a comment - - edited Well probably its the best to split this issue into two, one for the ExternalGraphic URL as a bug, because CQL expression can already be used but not standalone. And the other would be an improvement to support dynamic attributes and in general expressions for the format tag (see GEOT-3139 ).
          Hide
          Frank Gasdorf added a comment -
          separated fixes and test case for GEOT-3137 and GEOT-3139
          Show
          Frank Gasdorf added a comment - separated fixes and test case for GEOT-3137 and GEOT-3139
          Hide
          Andrea Aime added a comment -
          Has there any discussion on the ml to change the API? I'd have time to apply the patch now but without a shared agreement of the development team API cannot be changed
          Show
          Andrea Aime added a comment - Has there any discussion on the ml to change the API? I'd have time to apply the patch now but without a shared agreement of the development team API cannot be changed
          Hide
          Frank Gasdorf added a comment -
          Andrea, not yet. I can start it on mailing list to get support for this feature ...
          Show
          Frank Gasdorf added a comment - Andrea, not yet. I can start it on mailing list to get support for this feature ...
          Hide
          Andrea Aime added a comment -
          Hi Frank, a long time ago I've sent you the link to a zip containg a lot of shapefiles with esri like prj files... still interested in looking at it with ESRI tools and see if they grok it?
          Show
          Andrea Aime added a comment - Hi Frank, a long time ago I've sent you the link to a zip containg a lot of shapefiles with esri like prj files... still interested in looking at it with ESRI tools and see if they grok it?
          Hide
          Frank Gasdorf added a comment -
          Andrea, I guess your comment is related to GEOT-3571, isn't it?
          Show
          Frank Gasdorf added a comment - Andrea, I guess your comment is related to GEOT-3571 , isn't it?

            People

            • Assignee:
              Andrea Aime
              Reporter:
              Frank Gasdorf
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: