Package org.geotools.renderer

Examples of org.geotools.renderer.ScreenMap


        FeatureReader<SimpleFeatureType, SimpleFeature> features;
        if (isNaturalOrder(query.getSortBy())) {
            Integer offset = query.getStartIndex();
            Integer maxFeatures = query.getMaxFeatures() == Integer.MAX_VALUE ? null : query
                    .getMaxFeatures();
            ScreenMap screenMap = (ScreenMap) query.getHints().get(Hints.SCREENMAP);
            features = getNativeReader(Query.NO_NAMES, filter, offset, maxFeatures, screenMap);
        } else {
            features = getReader(query);
        }
        ReferencedEnvelope bounds = new ReferencedEnvelope(crs);
View Full Code Here


            return size;
        }

        FeatureReader<SimpleFeatureType, SimpleFeature> features;
        if (isNaturalOrder(query.getSortBy())) {
            ScreenMap screenMap = (ScreenMap) query.getHints().get(Hints.SCREENMAP);
            features = getNativeReader(Query.NO_NAMES, filter, offset, maxFeatures, screenMap);
        } else {
            features = getReader(query);
        }
        int count = 0;
View Full Code Here

        final boolean naturalOrder = isNaturalOrder(query.getSortBy());
        final int startIndex = Optional.fromNullable(query.getStartIndex()).or(Integer.valueOf(0));
        final Integer maxFeatures = query.getMaxFeatures() == Integer.MAX_VALUE ? null : query
                .getMaxFeatures();
        final Filter filter = query.getFilter();
        final ScreenMap screenMap = (ScreenMap) query.getHints().get(Hints.SCREENMAP);
        final String[] propertyNames = query.getPropertyNames();
        if (naturalOrder) {
            reader = getNativeReader(propertyNames, filter, startIndex, maxFeatures, screenMap);
        } else {
            reader = getNativeReader(propertyNames, filter, null, null, screenMap);
View Full Code Here

               
                // expand the screenmaps by the meta buffer, otherwise we'll throw away geomtries
                // that sit outside of the map, but whose symbolizer may contribute to it
                for (LiteFeatureTypeStyle lfts : styles) {
                    if(lfts.screenMap != null) {
                        lfts.screenMap = new ScreenMap(lfts.screenMap, metaBuffer);
                    }
                }
            }
        }
       
View Full Code Here

                    lfts = new LiteFeatureTypeStyle(new DelayedBackbufferGraphic(graphics, screenSize),
                            ruleList, elseRuleList, fts.getTransformation());
                }
                if (screenMapEnabled(lfts)) {
                    int renderingBuffer = getRenderingBuffer();
                    lfts.screenMap = new ScreenMap(screenSize.x - renderingBuffer, screenSize.y
                            - renderingBuffer, screenSize.width + renderingBuffer * 2,
                            screenSize.height + renderingBuffer * 2);
                }
                                                  
                result.add(lfts);
View Full Code Here

        FeatureReader<SimpleFeatureType, SimpleFeature> reader = ds.getFeatureReader(
                new Query(ds.getTypeNames()[0], filter), Transaction.AUTO_COMMIT);
        assertTrue(reader instanceof IndexedShapefileFeatureReader);

        // prepare a screenmap that will heavily prune features
        ScreenMap screenMap = new ScreenMap(-180, -90, 360, 180);
        screenMap.setSpans(1.0, 1.0);
        screenMap.setTransform(IdentityTransform.create(2));
        ((ShapefileFeatureReader) reader).setScreenMap(screenMap);
        ((ShapefileFeatureReader) reader).setSimplificationDistance(1.0);

        int count = 0;
        while (reader.hasNext()) {
View Full Code Here

                    Transaction.AUTO_COMMIT);
        } else {
            reader = ds.getFeatureReader();
        }

        ScreenMap screenMap = new ScreenMap(-180, -90, 360, 180);
        screenMap.setSpans(1.0, 1.0);
        screenMap.setTransform(IdentityTransform.create(2));

        ((ShapefileFeatureReader)reader).setScreenMap(screenMap);
        ((ShapefileFeatureReader)reader).setSimplificationDistance(1.0);

        assertTrue(reader.hasNext());
View Full Code Here

     * Test method for 'org.geotools.renderer.shape.ScreenMap.set(int, int)'
     */
    public void testSet() {
        ymin = xmin = 0;
        height = width = 8;
        ScreenMap map = new ScreenMap(0, 0, 8, 8);

        for (int x = 0; x < 8; x++) {
            for (int y = 0; y < 8; y++) {
                assertEquals(false, map.get(x, y));
            }
        }

        setOne(map, 0, 0, true, false);
        setOne(map, 0, 0, false, true);
View Full Code Here

    public void testSubsetScreen() throws Exception {
        xmin = 478;
        ymin = 0;
        width = 283;
        height = 452;
        ScreenMap map = new ScreenMap(xmin, ymin, width + 1, height + 1);

        // test 4 corners
        setOne(map, xmin, ymin, true, false);
        setOne(map, xmin, ymin, false, true);
View Full Code Here

    public void testOutsideScreen() throws Exception {
        xmin = 0;
        ymin = 0;
        width = 10;
        height = 10;
        ScreenMap map = new ScreenMap(xmin, ymin, width, height);

        // check points outside the screen
        assertFalse(map.checkAndSet(-10, -10));
        assertFalse(map.checkAndSet(-10, -10));
        assertFalse(map.checkAndSet(-10, 10));
        assertFalse(map.checkAndSet(-10, 10));
        assertFalse(map.checkAndSet(20, 10));
        assertFalse(map.checkAndSet(20, 10));
        assertFalse(map.checkAndSet(20, -10));
        assertFalse(map.checkAndSet(20, -10));

        // compare with one inside
        assertFalse(map.checkAndSet(0, 0));
        assertTrue(map.checkAndSet(0, 0));
    }
View Full Code Here

TOP

Related Classes of org.geotools.renderer.ScreenMap

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.