Refine search
/** * 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 ); }
/** * Make sure a JNDI context is available */ public boolean isAvailable() { try { GeoTools.getInitialContext(GeoTools.getDefaultHints()); return true; } catch (Exception e) { return false; } }
/** 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 ); }
/** * 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 ); }
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()); } } }
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. */
public DuplicatingFilterVisitor() { this(CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints())); }
/** * 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 ); }
.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();
public RulesBuilder() { ff = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints()); styleFactory = CommonFactoryFinder.getStyleFactory(GeoTools.getDefaultHints()); sb = new StyleBuilder(); }
/** * 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(); }
FilterFactory2 filterFac = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints()); requestedCRS, targetCRS, new Hints( Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE));
(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);
/** * Creates a new instance of this factory. */ public HsqlDialectEpsgMediator() throws FactoryException { this( GeoTools.getDefaultHints() ); }
private static Hints addDefaultHints(final Hints hints) { final Hints completed = GeoTools.getDefaultHints(); if (hints != null) { completed.add(hints); } return completed; }
/** * @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 ); }
/** * 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); } } }
private static FeatureCollections instance() { // depend on CommonFactoryFinder's FactoryRegistry to hold singleton return CommonFactoryFinder.getFeatureCollections( GeoTools.getDefaultHints() ); }
/** * 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() ); }
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"); }