本文整理了Java中org.geotools.referencing.CRS.getAuthorityFactory()
方法的一些代码示例,展示了CRS.getAuthorityFactory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CRS.getAuthorityFactory()
方法的具体详情如下:
包路径:org.geotools.referencing.CRS
类名称:CRS
方法名:getAuthorityFactory
[英]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.
[中]返回#decode(String,boolean)方法使用的CRS授权工厂。这家工厂是有组织的。地理工具。参考。工厂BufferedAuthorityFactory,通过组织进行扫描。地理工具。参考。工厂AllAuthoritiesFactory并使用其他工厂作为组织。地理工具。参考。工厂FallbackAuthorityFactory如果同一权限有多个ReferencengFactoryFinder#GetCrsAuthorityFactory。
该工厂可作为一种适用于所有机构的系统级工厂。然而,对于更具决定论的行为,考虑使用一个更具体的工厂(如在已知权限时引用引用CyfCytoFyfFier-GyrCurthTurthPrimeCurror)。
代码示例来源: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) {
内容来源于网络,如有侵权,请联系作者删除!