/** * Returns the first implementation of {@link PrecisionModel} matching the specified hints. If * no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first precision model that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link PrecisionModel} category and the given hints. */ public static synchronized PrecisionModel getPrecisionModel(Hints hints) throws FactoryRegistryException { return JTSFactoryFinder.getPrecisionModel(hints); }
/** * Creates a new instance of the specified factory using the specified hints. * * @param category The category to instantiate. * @param implementation The factory class to instantiate. * @param hints The implementation hints. * @return The factory. * @throws FactoryRegistryException if the factory creation failed. */ protected Object createServiceProvider( final Class category, final Class implementation, final Hints hints) throws FactoryRegistryException { if (GeometryFactory.class.isAssignableFrom(category) && GeometryFactory.class.equals(implementation)) { return new GeometryFactory( getPrecisionModel(hints), getSRID(hints), getCoordinateSequenceFactory(hints)); } return super.createServiceProvider(category, implementation, hints); }
/** * Returns the first implementation of {@link PrecisionModel} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first precision model that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link PrecisionModel} category and the given hints. */ public static synchronized PrecisionModel getPrecisionModel(Hints hints) throws FactoryRegistryException { return JTSFactoryFinder.getPrecisionModel(hints); }
/** * Creates a new instance of the specified factory using the specified hints. * * @param category The category to instantiate. * @param implementation The factory class to instantiate. * @param hints The implementation hints. * @return The factory. * @throws FactoryRegistryException if the factory creation failed. */ protected Object createServiceProvider(final Class category, final Class implementation, final Hints hints) throws FactoryRegistryException { if (GeometryFactory.class.isAssignableFrom(category) && GeometryFactory.class.equals(implementation)) { return new GeometryFactory(getPrecisionModel(hints), getSRID(hints), getCoordinateSequenceFactory(hints)); } return super.createServiceProvider(category, implementation, hints); }