/** Creates an instance of the specified authority. */ private Command(final String authority) { factory = (authority == null) ? CRS.getAuthorityFactory(false) : ReferencingFactoryFinder.getCRSAuthorityFactory(authority, HINTS); formatter = new Parser(); }
/** Prints all {@linkplain AuthorityFactory authority factory} dependencies as a tree. */ private static void printAuthorityFactoryDependencies( final PrintWriter out, final boolean colors) { final FactoryDependencies printer = new FactoryDependencies(CRS.getAuthorityFactory(false)); printer.setAttributeEnabled(true); printer.setColorEnabled(colors); printer.print(out); out.flush(); }
(AbstractAuthorityFactory) getAuthorityFactory(true); final IdentifiedObjectFinder finder = xyFactory.getIdentifiedObjectFinder(object.getClass());
result = getAuthorityFactory(longitudeFirst).createCoordinateReferenceSystem(code); if (longitudeFirst) { defaultCache.put(code, result);
@Test public void testTransformBBOXIsCorrect() throws Exception { Style style = RendererBaseTest.loadStyle(this, "noop_colormap.sld"); GeoTiffReader reader = new GeoTiffReader(TestData.file(this, "watertemp.tiff")); MapContent mc = new MapContent(); mc.addLayer(new GridReaderLayer(reader, style)); StreamingRenderer renderer = new StreamingRenderer(); renderer.setMapContent(mc); CRSAuthorityFactory factory = CRS.getAuthorityFactory(true); CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem("EPSG:4326"); ReferencedEnvelope reWgs84 = new ReferencedEnvelope( 9.848993475036622, 11.958867853088378, 40.74254816253662, 41.64941961090088, crs); BufferedImage image = RendererBaseTest.showRender("Transform BBOX", renderer, 4000, reWgs84); // last pixel is white when doing a transformation and the rendering transform BBOX // transforms are // incorrect, it shouldn't be assertNotEquals(Color.WHITE, getPixelColor(image, 299, 0)); assertEquals(new Color(133, 130, 188), getPixelColor(image, 299, 0)); }
public String getDescription() { // lazy loading of description if (description == null) { // grab the description String desc = "-"; try { // REVISIT: as far as I know the EPSG names are not localized? anyway, if // they're revisit to use the page locale // description = CRS.getAuthorityFactory(true).getDescriptionText("EPSG:" + // code) // .toString(getLocale()).toUpperCase(); desc = CRS.getAuthorityFactory(true).getDescriptionText("EPSG:" + code) .toString(); } catch (Exception e) { // no problem } description = desc; } return description; }
/** * Search for the given CRS (EPSG code), return the bounds (domain of validity) * * @param refId the input CRS * @return projectionBounds an Envelope describing the CRS bounds, throws * a NoSuchAuthorityException, a CRSException, or a TransformException if the CRS cannot be found */ public Envelope getCRSBounds(String refId) throws CRSException, FactoryException, TransformException { CRSAuthorityFactory authorityFactory = CRS.getAuthorityFactory(true); CoordinateReferenceSystem crs = authorityFactory.createCoordinateReferenceSystem(refId); return getExtents(crs); }
/** * Search for the given CRS (EPSG code), return the bounds (domain of validity) * * @param refId the input CRS * @return projectionBounds an Envelope describing the CRS bounds, throws * a NoSuchAuthorityException, a CRSException, or a TransformException if the CRS cannot be found */ public Envelope getCRSBounds(String refId) throws CRSException, FactoryException, TransformException { CRSAuthorityFactory authorityFactory = CRS.getAuthorityFactory(true); CoordinateReferenceSystem crs = authorityFactory.createCoordinateReferenceSystem(refId); return getExtents(crs); }
/** * Retrieves the coordinate reference system from the EPSG database. * * @param srid * the spatial reference id. * * @return a coordinate reference system. */ public static CoordinateReferenceSystem getCRS(int srid) { CoordinateReferenceSystem crs = crsMappings.get(srid); if (crs == null) { /* * Force longitude/latitude order. */ CRSAuthorityFactory factory = CRS.getAuthorityFactory(true); try { crs = factory.createCoordinateReferenceSystem("EPSG:" + srid); } catch (NoSuchAuthorityCodeException e) { logger.warn(e.getLocalizedMessage()); } catch (FactoryException e) { e.printStackTrace(); } } return crs; }
public String getDescription() { // lazy loading of description if (description == null) { // grab the description String desc = "-"; try { // REVISIT: as far as I know the EPSG names are not localized? anyway, if // they're revisit to use the page locale // description = CRS.getAuthorityFactory(true).getDescriptionText("EPSG:" + // code) // .toString(getLocale()).toUpperCase(); desc = CRS.getAuthorityFactory(true) .getDescriptionText("EPSG:" + code) .toString(); } catch (Exception e) { // no problem } description = desc; } return description; }
/** * Retrieves the coordinate reference system from the EPSG database. * * @param srid * the spatial reference id. * * @return a coordinate reference system. */ public static CoordinateReferenceSystem getCRS(int srid) { CoordinateReferenceSystem crs = crsMappings.get(srid); if (crs == null) { /* * Force longitude/latitude order. */ CRSAuthorityFactory factory = CRS.getAuthorityFactory(true); try { crs = factory.createCoordinateReferenceSystem("EPSG:" + srid); } catch (NoSuchAuthorityCodeException e) { logger.warn(e.getLocalizedMessage()); } catch (FactoryException e) { e.printStackTrace(); } } return crs; }
public void encode(OutputStream lFileOutputStream, SimpleFeatureCollection collection) throws XMLStreamException, NoSuchAuthorityCodeException, FactoryException { CRSAuthorityFactory crsFactory = CRS.getAuthorityFactory(true);
CRS.getAuthorityFactory(false);
String name = ""; try { name = CRS.getAuthorityFactory(true).getDescriptionText(code).toString(getLocale()); } catch (Exception e) {