I found some examples in the ML archive about FidFilter and apparently
filterFactory.createFidFilter() is still the standard way to use a FID filter.
But I don't understand why there is in my case this useless second request
(without any filter!) sent to the WFS datastore. Am I the only one to
experiment it?
Regards,
Vincent.
________________________________
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de zze-M2S FRISON V
ext RD-BIZZ
Envoyé : jeudi 22 février 2007 15:01
À : [email protected]
Objet : [Geotools-gt2-users] How to use a FidFilter
Hi all,
I'm still confused with FIDs. My problem is no more with inserting (thanks to
Andrea) but with retrieving. I have severals kind of filter which are working
well, except from the FidFilter.
With this filter, it's very strange: as soon as my debuger passes through
col.size() or col.features() calls, I can see two different requests in the
geoserver logs:
The first request seems ok: fid parameter is set to 1000043
/////////////////////////////////
9818382 [INFO] org.vfny.geoserver.servlets.AbstractService - handling request:
Request: null
output format:GML2
max features:2147483647
version:
queries:
Query []
feature type: esig:esig_points
filter: [ esig_points.1000043 ]
[properties: ALL ]
But the second one is wrong: no more filter!
/////////////////////////////////
9818493 [INFO] org.vfny.geoserver.servlets.AbstractService - handling request:
Request: null
output format:GML2
max features:2147483647
version:
queries:
Query []
feature type: esig:esig_points
[properties: ALL ]
I don't understand why a second request is occuring. Since the wrong request
(without any filter) is the second one, there's always some features returned,
whatever the FID is. :(
If I replace the filterFactory.createFidFilter() call by another filter (such
my private method getFilterByUserId(), see below), it works correctly (ie. just
one request is sent, with the appropriate filter).
And, if I run my test program without breakpoint I have an exception:
Stopping
org.geotools.xml.gml.GMLComplexTypes$AbstractFeatureType.stream(GMLComplexTypes.java:4312)
org.geotools.xml.gml.GMLComplexTypes$AbstractFeatureType.getValue(GMLComplexTypes.java:4177)
org.geotools.xml.handlers.xsi.ComplexTypeHandler$DefaultComplexType.getValue(ComplexTypeHandler.java:1072)
org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:185)
org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:264)
org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:579)
org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNamespaceBinder.java:897)
org.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.java:643)
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:1972)
org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:878)
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleEndElement(XMLDocumentFragmentScannerImpl.java:1144)
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:987)
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1445)
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:524)
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:580)
org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1169)
javax.xml.parsers.SAXParser.parse(Unknown Source)
javax.xml.parsers.SAXParser.parse(Unknown Source)
org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:139)
org.geotools.data.wfs.WFSFeatureReader.run(WFSFeatureReader.java:125)
But if I run my test program "slowly" (ie. debug with breakpoints), this
exception isn't raised anymore! Fantastic!
What's wrong with filterFactory.createFidFilter()? The method is marked as
obsolete, what would be the new/good approach?
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users