Trung Dinh wrote:

> I have just downloaded Geotools 2.2.1 for testing. It seems that the 
> new line of code does not solve all the problem. Now Geotools will not 
> throw Exception anymore, but if my original FidFilter before the 
> transformation has more than 1 ids in it, after the transformation we 
> will only have 1.
>
> This is the code I use to test:
>
> [0] public static void main(String[] arg) {
> [1]    List fiveFeatureId = new ArrayList();
> [2]    for (int i = 0; i < 5; i++) {
> [3]        fiveFeatureId.add("parcell."+ i );
> [4]    }
>
> [5]    FidFilter fidF = 
> FilterFactoryFinder.createFilterFactory().createFidFilter();
> [6]    fidF.addAllFids(fiveFeatureId);
>
> [7]    Style styleBefore = new StyleBuilder().createStyle();
> [8]    Symbolizer sym = new StyleBuilder().createPolygonSymbolizer();
> [9]    Rule r = new StyleBuilder().createRule(sym);
> [10]    r.setFilter(fidF);
> [11]    FeatureTypeStyle featureTypeStyle = 
> styleBefore.getFeatureTypeStyles()[0];
> [12]    featureTypeStyle.addRule(r);
> [13]    styleBefore.addFeatureTypeStyle(featureTypeStyle);
>
> [14]    String filterName = fidF.getClass().getName();
> [15]    try {
> [16]        String sld = new SLDTransformer().transform(new Style[] { 
> styleBefore });
>
> [17]        InputStream is = new ByteArrayInputStream(sld.getBytes());
> [18]        Style[] styles = new 
> SLDParser(StyleFactoryFinder.createStyleFactory(), is).readXML();
>
> [19]        System.out.println("Transformation with '" + filterName + 
> "' Correctly: " +  styleBefore.equals(styles[0]));
> [20]        //This would print something like "Transformation with 
> 'org.geotools.filter.FidFilterImpl' Correctly: false"
>
> [21]    } catch (TransformerException e) {
> [22]        System.err.println("Tranformation Error When 
> Transforming... ");
> [23]    }
> [24] }
>
> ---------------------------------------------------------------------
> Using Eclipse's debugging tool, I can see that 'styleBefore' in line 
> [16] has a FidFilter with a set of 5 ids, "[ parcell.2, parcell.0, 
> parcell.3, parcell.1, parcell.4 ]", while styler[0] in line [19] has a 
> filer with only 1 id, "[parcell.4]".
>
> So it looks like between writing stuff into XML and reading it back, 
> some ids got droped. I will not paste the XML string here, since my 
> Yahoo Mail will make it something else. But I attached it as a text 
> file for you.
>
> Do you know if this bug has been reported/fixed?

Hi Trung,

Thank you for the test case -- this made the issue much quicker to fix.

I created a bug for this issue in our JIRA tracker:
http://jira.codehaus.org/browse/GEOT-992

I have a partial fix completed, but it is getting late... will finish 
tomorrow.

Cheers,
Cory.

---
Cory Horner
Refractions Research
http://www.refractions.net

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to