/** UDIG requires this to work. */ @Test public void test42001() throws FactoryException { final ProjectedCRS utm = factory.createProjectedCRS("AUTO:42001,0.0,0.0"); assertNotNull("auto-utm", utm); assertSame(utm, factory.createObject("AUTO :42001 ,0,0")); assertSame(utm, factory.createObject("AUTO2:42001 ,0,0")); assertSame(utm, factory.createObject("42001 ,0,0")); assertNotSame(utm, factory.createObject("AUTO :42001 ,30,0")); assertEquals( "Transverse_Mercator", utm.getConversionFromBase().getMethod().getName().getCode()); }
/** Check we can parse also the unit */ @Test public void test42001Units() throws FactoryException { final ProjectedCRS utm = factory.createProjectedCRS("AUTO:42001,9001,0.0,0.0"); assertNotNull("auto-utm", utm); assertSame(utm, factory.createObject("AUTO :42001, 9001,0,0")); assertSame(utm, factory.createObject("AUTO2:42001, 9001,0,0")); assertSame(utm, factory.createObject("42001, 9001,0,0")); assertNotSame(utm, factory.createObject("AUTO :42001, 9001,30,0")); assertEquals( "Transverse_Mercator", utm.getConversionFromBase().getMethod().getName().getCode()); }
public IdentifiedObject createObject(String code) throws FactoryException { final String key = toKey(code); IdentifiedObject obj = (IdentifiedObject) cache.get(key); if (obj == null) { try { cache.writeLock(key); obj = (IdentifiedObject) cache.peek(key); if (obj == null) { obj = crsAuthority.createObject(code); cache.put(key, obj); } } finally { cache.writeUnLock(key); } } return obj; }
/** A random CRS for fun. */ public void test26910() throws FactoryException { final CRSAuthorityFactory factory = new OrderedAxisAuthorityFactory("EPSG", null, null); final CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem("EPSG:26910"); assertNotNull(crs); assertSame(crs, factory.createObject("EPSG:26910")); }
/** UDIG requires this to work. */ public void test4326() throws FactoryException { final CRSAuthorityFactory factory = new OrderedAxisAuthorityFactory("EPSG", null, null); final CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem("EPSG:4326"); assertNotNull(crs); assertSame(crs, factory.createObject("EPSG:4326")); }
/** UDIG requires this to work. */ public void test4269() throws FactoryException { final CRSAuthorityFactory factory = new OrderedAxisAuthorityFactory("EPSG", null, null); final CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem("EPSG:4269"); assertNotNull(crs); assertSame(crs, factory.createObject("EPSG:4269")); }
@Override public IdentifiedObject createObject(String code) throws FactoryException { return factory().createObject(code); }
@Override public IdentifiedObject createObject(String code) throws FactoryException { return factory().createObject(code); }
expected = crs.createCoordinateReferenceSystem("84"); assertSame(expected, actual); assertSame(expected, all.createObject("CRS:84")); assertSame(expected, all.createObject("AUTO:42001,0,0")); assertSame(expected, all.createObject("CRS:27"));
expected = wms.createCoordinateReferenceSystem("84"); assertSame(expected, actual); assertSame(expected, factory.createObject("CRS:84")); assertSame(expected, factory.createObject("AUTO:42001,0,0")); assertSame(expected, factory.createObject("CRS:27"));