Tabnine Logo
CRS.getAuthorityFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
getAuthorityFactory
method
in
org.geotools.referencing.CRS

Best Java code snippets using org.geotools.referencing.CRS.getAuthorityFactory (Showing top 14 results out of 315)

origin: geotools/geotools

/** 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();
}
origin: geotools/geotools

/** 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();
}
origin: geotools/geotools

    (AbstractAuthorityFactory) getAuthorityFactory(true);
final IdentifiedObjectFinder finder =
    xyFactory.getIdentifiedObjectFinder(object.getClass());
origin: geotools/geotools

result = getAuthorityFactory(longitudeFirst).createCoordinateReferenceSystem(code);
if (longitudeFirst) {
  defaultCache.put(code, result);
origin: geotools/geotools

@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));
}
origin: org.geoserver.web/web-core

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;
}
origin: org.locationtech.geogig/geogig-core

/**
 * 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);
}
origin: locationtech/geogig

/**
 * 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);
}
origin: matsim-org/matsim

/**
 * 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;
}
origin: org.geoserver.web/gs-web-core

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;
}
origin: matsim-org/matsim

/**
 * 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;
}
origin: org.geoserver.community/gs-gpxppio

public void encode(OutputStream lFileOutputStream, SimpleFeatureCollection collection)
    throws XMLStreamException, NoSuchAuthorityCodeException, FactoryException {
  CRSAuthorityFactory crsFactory = CRS.getAuthorityFactory(true);
origin: com.conveyal/gtfs-lib

CRS.getAuthorityFactory(false);
origin: org.geoserver.web/gs-web-demo

String name = "";
try {
  name = CRS.getAuthorityFactory(true).getDescriptionText(code).toString(getLocale());
} catch (Exception e) {
org.geotools.referencingCRSgetAuthorityFactory

Javadoc

Returns the CRS authority factory used by the #decode(String,boolean) methods. This factory is org.geotools.referencing.factory.BufferedAuthorityFactory, scans over org.geotools.referencing.factory.AllAuthoritiesFactory and uses additional factories as org.geotools.referencing.factory.FallbackAuthorityFactory if there is more than one ReferencingFactoryFinder#getCRSAuthorityFactories for the same authority.

This factory can be used as a kind of system-wide factory for all authorities. However for more determinist behavior, consider using a more specific factory (as returned by ReferencingFactoryFinder#getCRSAuthorityFactory when the authority in known.

Popular methods of CRS

  • decode
  • findMathTransform
  • equalsIgnoreMetadata
  • parseWKT
  • lookupEpsgCode
  • transform
  • getAxisOrder
  • lookupIdentifier
  • toSRS
  • getHorizontalCRS
  • getEnvelope
  • getCoordinateOperationFactory
  • getEnvelope,
  • getCoordinateOperationFactory,
  • getMapProjection,
  • getSupportedCodes,
  • getGeographicBoundingBox,
  • reset,
  • getEllipsoid,
  • getProjectedCRS,
  • getTemporalCRS

Popular in Java

  • Creating JSON documents from java classes using gson
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • String (java.lang)
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now