/** @throws java.lang.Exception */ @Before public void setUp() throws Exception { ReferencingFactoryFinder.addAuthorityFactory( new FactoryUsingWKT(null, AbstractFactory.MAXIMUM_PRIORITY)); factory = (CoordinateOperationFactoryUsingWKT) ReferencingFactoryFinder.getCoordinateOperationAuthorityFactory( "EPSG", new Hints( Hints.COORDINATE_OPERATION_AUTHORITY_FACTORY, CoordinateOperationFactoryUsingWKT.class)); // Read definitions properties = new Properties(); properties.load(this.getClass().getResourceAsStream(DEFINITIONS_FILE_NAME)); }
/** Adds the extra factory to the set of authority factories. */ @Before public void setUp() { assertNull(extra); CRS.reset("all"); extra = new FactoryEPSGExtra(); ReferencingFactoryFinder.addAuthorityFactory(extra); ReferencingFactoryFinder.scanForPlugins(); }
void registerAdditionalCRS() throws KlabException { URL epsg = null; File epp = new File(KLAB.CONFIG.getDataPath() + File.separator + "epsg.properties"); if (epp.exists()) { try { epsg = epp.toURI().toURL(); } catch (MalformedURLException e) { throw new KlabIOException(e); } } if (epsg != null) { Hints hints = new Hints(Hints.CRS_AUTHORITY_FACTORY, PropertyAuthorityFactory.class); ReferencingFactoryContainer referencingFactoryContainer = ReferencingFactoryContainer .instance(hints); PropertyAuthorityFactory factory; try { factory = new PropertyAuthorityFactory(referencingFactoryContainer, Citations .fromName("EPSG"), epsg); ReferencingFactoryFinder.addAuthorityFactory(factory); } catch (IOException e) { throw new KlabIOException(e); } } }