Hi developers, hi Martin. For several of my geowidgets I need EPSG factries as "CRSAuthorityFactory" implementations. The intend is to show a list of available objects, for example CRS, to the user. This is done in uDig (map properties), which is instantaneous: The user doesn't have to wait. I tried the very same with a slightly modified version in GeoWidgets and it took two seconds for the CRSs alone ... and I need to query several kinds of objects (-> 19 secs total, inacceptable).
A closer look a the code differences revealed that uDig gets a "EPSGCRSAuthorityFactory", calls factory.getAuthorityCodes(CoordinateReferenceSystem.class); and uses the returned 2707 objects without any further check. I get a "DefaultFactory", also call factory.getAuthorityCodes(CoordinateReferenceSystem.class); get 3534 (with HSQL) resp. 3325 (with Access) objects back in no time and check each and every one if it can be instantiated, which takes some seconds. Indeed, several objects fail this check ... so it is not in vain. The reason for the difference is that uDig uses the WKT plugin while I need the metadata only offered by Access or HSQL databases. Question 1: Why do they return a different number of Codes? Is this, because the WKT based factory only contains objects that can indeed be instantiated? The point is that I have the choice: On the one hand also show "invalid" objects to the user (which, when the user selects them, will not work). On the other hand spend a few seconds testing every returned EPSG code. A dilemma. Question 2: Would it be possible to enhance the DefaultFactory to do some kind of (quicker!) check internally and return only objects that can indeed be instantiated. Maybe use a "validOnly" hint or sth. similar. If not, what other solution are there to reduce the time, given the constraints that I need the metadata (not offered by WKT) and that I don't want to show invalid objects to the user. Matthias Basler [EMAIL PROTECTED] ---------------------------------------------------------------- This mail was sent through http://webmail.uni-jena.de ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel