Error encoding ID Filter to XML
-------------------------------
Key: GEOT-1782
URL: http://jira.codehaus.org/browse/GEOT-1782
Project: GeoTools
Issue Type: Bug
Components: core filter
Environment: win2000, jre 1.6
Reporter: Michael Fröhler
When calling encode with an ID filter i get a RunntimeException:
Failed to get Property : fid
-------------expample------------
//function to create the id filter
public static Filter getIdFilter(String fid) throws Exception{
HashSet setID=new HashSet();
setID.add(filterFactory.featureId(fid));
return filterFactory.id(setID);
}
//Function to encode the id filter
public String encode(Filter filter) throws Exception{
Encoder encoder = new Encoder( new
org.geotools.filter.v1_0.OGCConfiguration() );
OutputStream xml = new StringOutputStream();
encoder.encode( filter,
org.geotools.filter.v1_0.OGC.Filter,xml );
strFilter=xml.toString();
return strFilter
}
-----------------------------------
Stack trace of the RuntimeException:
-----------------------------------------------------------------------------
java.lang.RuntimeException: Failed to get property: fid
at
org.geotools.xml.impl.GetPropertyExecutor.visit(GetPropertyExecutor.java:47)
at
org.geotools.xml.impl.BindingWalker$BindingExecutionChain.execute(BindingWalker.java:197)
at org.geotools.xml.impl.BindingWalker.walk(BindingWalker.java:163)
at org.geotools.xml.impl.BindingWalker.walk(BindingWalker.java:167)
at org.geotools.xml.Encoder.encode(Encoder.java:498)
at
de.riwagis.geotools.data.riwasrv.RiwaSrvDataStore.getFilterText(RiwaSrvDataStore.java:235)
at
de.riwagis.geotools.data.riwasrv.RiwaSrvDataStore.getFeatureReader(RiwaSrvDataStore.java:196)
at
org.geotools.data.AbstractDataStore.getFeatureReader(AbstractDataStore.java:367)
at
de.riwagis.geotools.data.model.FeaturestoreMetadata.getFeatureReader(FeaturestoreMetadata.java:507)
at
de.riwagis.gis.context.jump.VectorLayerContextImpl.setSelection(VectorLayerContextImpl.java:91)
at
de.riwagis.gis.context.jump.MapContextImpl.setSelection(MapContextImpl.java:87)
at
de.riwagis.webgiscli.servlet.actions.GeometryAction.executeInternal(GeometryAction.java:91)
at
de.riwagis.webgiscli.servlet.actions.AbstractLocalAction$1.run(AbstractLocalAction.java:41)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: org.geotools.filter.FidFilterImpl
cannot be cast to org.opengis.filter.identity.FeatureId
at
org.geotools.filter.v1_0.OGCFeatureIdTypeBinding.getProperty(OGCFeatureIdTypeBinding.java:78)
at
org.geotools.xml.impl.GetPropertyExecutor.visit(GetPropertyExecutor.java:44)
... 13 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel