本文整理了Java中org.geotools.factory.GeoTools
类的一些代码示例,展示了GeoTools
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeoTools
类的具体详情如下:
包路径:org.geotools.factory.GeoTools
类名称:GeoTools
[英]Static methods relative to the global GeoTools configuration. GeoTools can be configured in a system-wide basis through System#getProperties, some of them are declared as String constants in this class.
There are many aspects to the configuration of GeoTools:
代码示例来源:origin: org.geotools/gt-main
/**
* Creates an instance of a Filter factory.
*
* @return An instance of the Filter factory.
*
* @throws FactoryRegistryException If the factory is not found.
*/
public static FilterFactory createFilterFactory() throws FactoryRegistryException {
Hints hints = GeoTools.getDefaultHints();
return (FilterFactory) CommonFactoryFinder.getFilterFactory( hints );
}
代码示例来源:origin: org.geotools/gt2-jdbc
/**
* Make sure a JNDI context is available
*/
public boolean isAvailable() {
try {
GeoTools.getInitialContext(GeoTools.getDefaultHints());
return true;
} catch (Exception e) {
return false;
}
}
代码示例来源:origin: org.geotools/gt2-geometry
/** Just the defaults, use GeometryFactoryFinder for the rest */
public ComplexFactoryImpl( Hints hints ) {
if (hints == null) {
this.crs = DefaultGeographicCRS.WGS84;
hints = GeoTools.getDefaultHints();
hints.put(Hints.CRS, crs );
}
else {
this.crs = (CoordinateReferenceSystem) hints.get( Hints.CRS );
if( crs == null ){
throw new NullPointerException("A CRS Hint is required in order to use ComplexFactoryImpl");
}
}
hintsWeCareAbout.put(Hints.CRS, crs );
}
代码示例来源:origin: org.geotools/gt2-main
/**
* Use the supplied FilterFactory when building styles
*
* @param filterFactory Use this FilterFactory to build the style
*/
public StyleBuilder(FilterFactory filterFactory ) {
this( CommonFactoryFinder.getStyleFactory( GeoTools.getDefaultHints() ), filterFactory );
}
代码示例来源:origin: org.geoserver.community/importer-core
public GeoToolsCoverageTransformer(String defaultSRS) {
// create basic hints
hints = new Hints(GeoTools.getDefaultHints());
if (defaultSRS != null) {
try {
final CoordinateReferenceSystem crs = CRS.decode(defaultSRS);
hints.add(new RenderingHints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, crs));
} catch (Exception e) {
LOGGER.log(Level.FINE, "Cannot parse CRS " + defaultSRS, new Exception());
hints = new Hints(GeoTools.getDefaultHints());
}
}
}
代码示例来源:origin: org.geotools/gt-wms
protected static boolean isGeotoolsLongitudeFirstAxisOrderForced() {
return Boolean.getBoolean(GeoTools.FORCE_LONGITUDE_FIRST_AXIS_ORDER)
|| GeoTools.getDefaultHints().get(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER)
== Boolean.TRUE;
}
/** Sets BBOX and SRS using the provided Envelope. */
代码示例来源:origin: org.geotools/gt-main
public DuplicatingFilterVisitor() {
this(CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints()));
}
代码示例来源:origin: org.geotools/gt2-main
/**
* Create a new FeatureTypeFactory with the given typeName.
*
* @param name The typeName of the feature to create.
*
* @return A new FeatureTypeFactory instance.
*
* @throws FactoryConfigurationError If there exists a configuration error.
*/
public static FeatureTypeFactory newInstance(String typeName)
throws FactoryConfigurationError {
// warning not sure if CommonFactoryFinder is going to cache the instance or not?
//
Hints hints = GeoTools.getDefaultHints();
if( hints == null ){
hints = new Hints( Hints.FEATURE_TYPE_FACTORY_NAME, typeName );
}
else {
hints.put( Hints.FEATURE_TYPE_FACTORY_NAME, typeName );
}
hints.put( Hints.FEATURE_TYPE_FACTORY_NAME, typeName );
return CommonFactoryFinder.getFeatureTypeFactory( hints );
}
代码示例来源:origin: org.integratedmodelling/klab-server
.equals(Hints.getSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER))) {
Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http");
Hints.putSystemDefault(Hints.LENIENT_DATUM_SHIFT, true);
GeoTools.init((Hints) null);
Hints.putSystemDefault(Hints.FILTER_FACTORY, CommonFactoryFinder
.getFilterFactory2(null));
Hints.putSystemDefault(Hints.STYLE_FACTORY, CommonFactoryFinder
.getStyleFactory(null));
Hints.putSystemDefault(Hints.FEATURE_FACTORY, CommonFactoryFinder
.getFeatureFactory(null));
final Hints defHints = GeoTools.getDefaultHints();
代码示例来源:origin: org.geoserver.community/gs-sldservice
public RulesBuilder() {
ff = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
styleFactory = CommonFactoryFinder.getStyleFactory(GeoTools.getDefaultHints());
sb = new StyleBuilder();
}
代码示例来源:origin: org.geotools/gt-legacy
/**
* Create a new FeatureTypeFactory with the given typeName.
*
* @param name The typeName of the feature to create.
*
* @return A new FeatureTypeFactory instance.
*
* @throws FactoryRegistryException If there exists a configuration error.
*/
public static FeatureTypeFactory newInstance(String typeName)
throws FactoryRegistryException {
// warning not sure if CommonFactoryFinder is going to cache the instance or not?
//
Hints hints = GeoTools.getDefaultHints();
if( hints == null ){
hints = new Hints( Hints.FEATURE_TYPE_FACTORY_NAME, typeName );
}
else {
hints.put( Hints.FEATURE_TYPE_FACTORY_NAME, typeName );
}
hints.put( Hints.FEATURE_TYPE_FACTORY_NAME, typeName );
return new DefaultFeatureTypeFactory();
}
代码示例来源:origin: org.geoserver/wms
FilterFactory2 filterFac = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
requestedCRS, targetCRS, new Hints(
Hints.LENIENT_DATUM_SHIFT,
Boolean.TRUE));
代码示例来源:origin: org.geoserver/gs-wms
(GridCoverage2DReader)
cinfo.getGridCoverageReader(
new NullProgressListener(), GeoTools.getDefaultHints());
targetCRS,
requestedCRS,
new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE));
try {
coverageMedianPosition.transform(targetCoverageMedianPosition);
requestedCRS,
targetCRS,
new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE));
try {
arbitraryToInternal.transform(position);
代码示例来源:origin: org.geotools/gt-epsg-hsql
/**
* Creates a new instance of this factory.
*/
public HsqlDialectEpsgMediator() throws FactoryException {
this( GeoTools.getDefaultHints() );
}
代码示例来源:origin: org.geotools/gt2-main
private static Hints addDefaultHints(final Hints hints) {
final Hints completed = GeoTools.getDefaultHints();
if (hints != null) {
completed.add(hints);
}
return completed;
}
代码示例来源:origin: org.geotools/gt2-geometry
/**
* @param crs
*/
public PrimitiveFactoryImpl(CoordinateReferenceSystem crs, PositionFactory positionFactory) {
this.crs = crs;
if( crs == null ){
throw new NullPointerException("A non null crs is required in order to use PrimitiveFactoryImpl");
}
if (positionFactory == null) {
Hints hints = GeoTools.getDefaultHints();
hints.put(Hints.CRS, crs );
this.positionFactory = GeometryFactoryFinder.getPositionFactory(hints);
}
else {
this.positionFactory = positionFactory;
}
geomValidate = true;
hintsWeCareAbout.put(Hints.CRS, crs );
hintsWeCareAbout.put(Hints.POSITION_FACTORY, positionFactory );
hintsWeCareAbout.put(Hints.GEOMETRY_VALIDATE, geomValidate );
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Reports the GeoTools {@linkplain #getVersion version} number to the
* {@linkplain System#out standard output stream}.
*/
public static void main(String[] args) {
final Arguments arguments = new Arguments(args);
args = arguments.getRemainingArguments(0);
arguments.out.print("GeoTools version ");
arguments.out.println(getVersion());
final Hints hints = getDefaultHints();
if (hints!=null && !hints.isEmpty()) {
arguments.out.println(hints);
}
}
}
代码示例来源:origin: org.geotools/gt2-main
private static FeatureCollections instance() {
// depend on CommonFactoryFinder's FactoryRegistry to hold singleton
return CommonFactoryFinder.getFeatureCollections( GeoTools.getDefaultHints() );
}
代码示例来源:origin: org.geotools/gt2-main
/**
* Returns the default attribute factory for the system - constucting a new
* one if this is first time the method has been called.
*
* @return the default instance of AttributeTypeFactory.
*/
public static AttributeTypeFactory defaultInstance() {
// depend on CommonFactoryFinder to keep singleton cached
//
return CommonFactoryFinder.getAttributeTypeFactory( GeoTools.getDefaultHints() );
}
代码示例来源:origin: org.geotools/gt2-main
private static FilterFactory2 findFactory2() {
Set factories = CommonFactoryFinder.getFilterFactories(GeoTools.getDefaultHints());
for (Iterator iter = factories.iterator(); iter.hasNext();) {
FilterFactory factory = (FilterFactory) iter.next();
if (factory instanceof FilterFactory2) {
return (FilterFactory2) factory;
}
}
throw new FactoryNotFoundException("There is no FilterFactory2 instance available for the default system hints");
}
内容来源于网络,如有侵权,请联系作者删除!