Is finally making me mad :-( FactorySPI may come out of the box with Java but it is not simple; and in the form we are using it here not understandable; ie it was never intended to have parameters (in the form of hints) or keep functional implementations around to share between threads. Seem to recall the idea was to keep a single instance around to share between applets originally? A low level tool for JRE plugins to use ...
We have a couple of ways to keep going: 1) upgrade to more fashionable technology - JNDI for services shared between applications in a web container - todays applets. It is a story already in use for referencing since nobody wants to play our way - Pico (for automatic) or Spring (for manual) or some other form of configuration (text file?) rather than the classpath for configuration 2) downgrade to simple java coding - Make the various FactoryFinders keep instances in a static Map for the expensive factories that hold state (and database connections) - Use the connection pool stuff that andrea set up to manage the database connections - or go really simple and make the factories cheap to create and cheap to throw away; and cache the artifacts at the CRS utility class level Back to the debug train ... So here is an operation factory as found by CRS.findMathtransform( ... ... ) > CoordinateOperationFactory operationFactory = > getCoordinateOperationFactory(lenient); > CoordinateOperation operation = > operationFactory.createOperation(sourceCRS, targetCRS); > return operation.getMathTransform(); It actually finds a CoordinateOperationFactory as follows (using lenient false): > BufferedCoordinateOperationFactory > CRS_FACTORY = ReferencingObjectFactory > CS_FACTORY = (same as CRS_FACTORY) > DATUM_FACTORY = DatumAliases > MATH_TRANSFORM_FACTORY = DefaultMathTransformFactory > COORDINATE_OPERATION_FACTORY = DefaultCoordinateOperationFactory > DATUM_SHIFT_METHOD = Molodenski > LENIENT_DATUM_SHIFT = false > CRS_FACTORY = (same as CRS_FACTORY) > CS_FACTORY = (same as CRS_FACTORY) > DATUM_FACTORY = (same as DATUM_FACTORY) > MATH_TRANSFORM_FACTORY = (same as MATH_TRANSFORM_FACTORY) The code inside ReferencedEnvelope tries to do a similar look up (using lenient true): > CoordinateOperationFactory coordinateOperationFactory = > CRS.getCoordinateOperationFactory(lenient); > final CoordinateOperation operation = > coordinateOperationFactory.createOperation(crs, targetCRS); > final GeneralEnvelope transformed = CRS.transform(operation, this); And fails ... for now I am going to turn lenient to false so uDig can run; and I will try and reproduce this problem over on the GeoTools side of things. Jody ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
