Package org.geotools.factory

Examples of org.geotools.factory.Hints


    protected void setUp() throws Exception {
        super.setUp();
        if( factory == null ){
            DataSource datasource = HsqlEpsgDatabase.createDataSource();
            Connection connection = datasource.getConnection();
            Hints hints = new Hints(Hints.CACHE_POLICY, "default");
            factory = new HsqlDialectEpsgMediator( hints );
        }
        if( finder == null ){
            finder = factory.getIdentifiedObjectFinder(CoordinateReferenceSystem.class);
        }
View Full Code Here


    Hints hints;
   
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        hints = new Hints(Hints.CACHE_POLICY, "none");
        hints.put(Hints.AUTHORITY_MAX_ACTIVE, Integer.valueOf(MAX_WORKERS));

        final DataSource database = HsqlEpsgDatabase.createDataSource();
        datasource = new BasicDataSource(){
          {
View Full Code Here

        // Preparing an useful layout in case the image is striped.
        final ImageLayout l = new ImageLayout();
        l.setTileGridXOffset(0).setTileGridYOffset(0).setTileHeight(3).setTileWidth(1);

        Hints hints = new Hints();
        hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, l));

        // get a reader
        final URL url = file.toURI().toURL();
        final Object source = url;
        final BaseGDALGridCoverage2DReader reader = new AIGReader(source, hints);
View Full Code Here

    Hints hints;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        hints = new Hints(Hints.CACHE_POLICY, "none");
        hints.put(Hints.AUTHORITY_MAX_ACTIVE, Integer.valueOf(MAX_WORKERS));
        datasource = HsqlEpsgDatabase.createDataSource();
        mediator = new HsqlDialectEpsgMediator(80, hints, datasource);
        codes = getCodes();
    }
View Full Code Here

        // Preparing an useful layout in case the image is striped.
        final ImageLayout l = new ImageLayout();
        l.setTileGridXOffset(0).setTileGridYOffset(0).setTileHeight(512).setTileWidth(512);

        Hints hints = new Hints();
        hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, l));

        File file = null;
        try{
            file = TestData.file(this, fileName);
        }catch (FileNotFoundException fnfe){
View Full Code Here

        // Preparing an useful layout in case the image is striped.
        final ImageLayout l = new ImageLayout();
        l.setTileGridXOffset(0).setTileGridYOffset(0).setTileHeight(512)
                .setTileWidth(512);

        Hints hints = new Hints();
        hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, l));

        // get a reader
        final URL url = file.toURI().toURL();
        final Object source = url;
        final BaseGDALGridCoverage2DReader reader = new EsriHdrReader(source,
View Full Code Here

    // Preparing an useful layout in case the image is striped.
                final ImageLayout l = new ImageLayout();
                l.setTileGridXOffset(0).setTileGridYOffset(0).setTileHeight(512)
                                .setTileWidth(512);

                Hints hints = new Hints();
                hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, l));
      
    final BaseGDALGridCoverage2DReader reader = new NITFReader(file, hints);

    // /////////////////////////////////////////////////////////////////////
    //
View Full Code Here

    private GridCoverage2D renderCoverage(final GridCoverage2D gridCoverage,
            final RasterSymbolizer symbolizer, final Interpolation interpolation,
            final Color background, final int tileSizeX, final int tileSizeY)
            throws FactoryException {
        final Hints oldHints= this.hints.clone();
       
        setupTilingHints(tileSizeX, tileSizeY);
        setupInterpolationHints(interpolation);
        try {
View Full Code Here

        // prepare hints
        // ... basic one, we want fast and compact coordinate sequences and geometries optimized
        // for the collection of one item case (typical in shapefiles)
        LiteCoordinateSequenceFactory csFactory = new LiteCoordinateSequenceFactory();
        GeometryFactory gFactory = new SimpleGeometryFactory(csFactory);
        Hints hints = new Hints(Hints.JTS_COORDINATE_SEQUENCE_FACTORY, csFactory);
        hints.put(Hints.JTS_GEOMETRY_FACTORY, gFactory);
        hints.put(Hints.FEATURE_2D, Boolean.TRUE);
       
        // update the screenmaps
        try {
            CoordinateReferenceSystem crs = getNativeCRS(schema, attributes);
            if(crs != null) {
                Set<RenderingHints.Key> fsHints = source.getSupportedHints();
               
                SingleCRS crs2D = crs == null ? null : CRS.getHorizontalCRS(crs);
                MathTransform mt = buildFullTransform(crs2D, mapCRS, worldToScreenTransform);
                double[] spans = Decimator.computeGeneralizationDistances(mt.inverse(), screenSize, generalizationDistance);
                double distance = spans[0] < spans[1] ? spans[0] : spans[1];
                for (LiteFeatureTypeStyle fts : styles) {
                    if(fts.screenMap != null) {
                        fts.screenMap.setTransform(mt);
                        fts.screenMap.setSpans(spans[0], spans[1]);
                        if(fsHints.contains(Hints.SCREENMAP)) {
                            // replace the renderer screenmap with the hint, and avoid doing
                            // the work twice
                            hints.put(Hints.SCREENMAP, fts.screenMap);
                            fts.screenMap = null;
                        }
                    }
                }
           
                if(renderingTransformation) {
                    // the RT might need valid geometries, we can at most apply a topology
                    // preserving generalization
                    if(fsHints.contains(Hints.GEOMETRY_GENERALIZATION)) {
                        hints.put(Hints.GEOMETRY_GENERALIZATION, distance);
                        inMemoryGeneralization = false;
                    }
                } else {
                    // ... if possible we let the datastore do the generalization
                    if(fsHints.contains(Hints.GEOMETRY_SIMPLIFICATION)) {
                        // good, we don't need to perform in memory generalization, the datastore
                        // does it all for us
                        hints.put(Hints.GEOMETRY_SIMPLIFICATION, distance);
                        inMemoryGeneralization = false;
                    } else if(fsHints.contains(Hints.GEOMETRY_DISTANCE)) {
                        // in this case the datastore can get us close, but we can still
                        // perform some in memory generalization
                        hints.put(Hints.GEOMETRY_DISTANCE, distance);
                    }
                }
            }
        } catch(Exception e) {
            LOGGER.log(Level.INFO, "Error computing the generalization hints", e);
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        if( factory == null ){
            DataSource datasource = HsqlEpsgDatabase.createDataSource();

            Hints hints = new Hints(Hints.CACHE_POLICY, "weak");
            factory = new HsqlDialectEpsgFactory(hints, datasource);
        }
        if( finder == null ){
            finder = factory.getIdentifiedObjectFinder(CoordinateReferenceSystem.class);
        }
View Full Code Here

TOP

Related Classes of org.geotools.factory.Hints

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.