Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.5
    • Fix Version/s: 2.5.7, 2.6-M2
    • Component/s: xml
    • Labels:
      None

      Description

      When you try to create a AND filter of PropertyIsLike filters the filter tag only has 1 and tag: If done with a propertyIsEqualTo filter it's ok.

      public static void main(String[] args) throws IOException {
      FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      org.geotools.xml.Configuration configuration2 = new OGCConfiguration();
      org.geotools.xml.Encoder encoder = new org.geotools.xml.Encoder(configuration2);

      //create filters:
      ArrayList al = new ArrayList();
      for (int i = 0; i < 4; i++)

      { //al.add(ff.equals(ff.property("number"), ff.literal("number"+i))); al.add(ff.like(ff.property("number"), "number"+i)); }

      //make and filter
      Filter andFilter = ff.and(al);
      //encode
      encoder.encode(andFilter, org.geotools.filter.v1_1.OGC.Filter, baos);
      String s = baos.toString();
      System.out.println("Equal filter: /n" + s);
      }

      Output:
      <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><ogc:And/></ogc:Filter>

        Activity

        Hide
        Justin Deoliveira added a comment -
        Fixed on 2.5.x and trunk.
        Show
        Justin Deoliveira added a comment - Fixed on 2.5.x and trunk.
        Hide
        Andrea Aime added a comment -
        Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update
        Show
        Andrea Aime added a comment - Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update

          People

          • Assignee:
            Justin Deoliveira
            Reporter:
            Roy Braam
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: